public AstName(AstName nameToCopy) { _parts = nameToCopy._parts.Select(p => new NamePart(p)).ToArray(); _nameIndex = nameToCopy._nameIndex; _parameterCount = nameToCopy._parameterCount; Kind = nameToCopy.Kind; Prefix = nameToCopy.Prefix; Postfix = nameToCopy.Postfix; }
public AstSymbolName(AstName symbolName) { if (symbolName.Kind == AstNameKind.Canonical) { _native = _canonical = symbolName ?? throw new ArgumentNullException(nameof(symbolName)); } else { _native = symbolName ?? throw new ArgumentNullException(nameof(symbolName)); _canonical = symbolName.ToCanonical(); } }
/// <summary>Parse a local source code or external symbol name.</summary> public static AstSymbolName Parse(string symbolName, AstNameKind nameKind = AstNameKind.Local) { var native = AstName.ParseFullName(symbolName, nameKind); return(new AstSymbolName(native)); }
public AstSymbolName(AstSymbolName nameToCopy) { _native = new AstName(nameToCopy.NativeName); _canonical = new AstName(nameToCopy.CanonicalName); }
public AstTypeReferenceExternal(TypeMetadata typeReference) { _typeReference = typeReference; _externalName = AstName.FromExternal(typeReference.Namespace, typeReference.Name); }
public AstIdentifier(string symbolName, AstIdentifierKind identifierKind) : this(AstName.ParseFullName(symbolName), identifierKind) { }
public AstIdentifier(AstName symbolName, AstIdentifierKind identifierKind) : this(new AstSymbolName(symbolName), identifierKind) { }