public SLNameTypePair(SLParameterKind kind, SLIdentifier id, SLType type) : base() { ParameterKind = kind; Name = id; TypeAnnotation = type; }
internal static string ToParameterKindString(SLParameterKind kind) { switch (kind) { case SLParameterKind.None: return(""); case SLParameterKind.Var: return("var"); case SLParameterKind.InOut: return("inout"); default: throw new ArgumentOutOfRangeException(nameof(kind), "unexpected value " + kind.ToString()); } }
public SLUnnamedParameter(SLType type, SLParameterKind kind = SLParameterKind.None) { ParameterKind = kind; TypeAnnotation = Exceptions.ThrowOnNull(type, nameof(type)); }
public SLParameter(string name, SLType type, SLParameterKind kind = SLParameterKind.None) : this(name, name, type, kind) { }
public SLParameter(SLIdentifier name, SLType type, SLParameterKind kind = SLParameterKind.None) : this(name, name, type, kind) { }
public SLParameter(string publicName, string privateName, SLType type, SLParameterKind kind = SLParameterKind.None) : this(publicName != null ? new SLIdentifier(publicName) : null, new SLIdentifier(privateName), type, kind) { }
public SLParameter(SLIdentifier publicName, SLIdentifier privateName, SLType type, SLParameterKind kind = SLParameterKind.None) : base(type, kind) { PublicName = publicName; PrivateName = Exceptions.ThrowOnNull(privateName, nameof(privateName)); }
public SLNameTypePair(SLParameterKind kind, string id, SLType type) : this(kind, id != null ? new SLIdentifier(id) : null, type) { }