public void AddUsing(UsingNamespace un) { if (DeclarationFound) { Compiler.Report.Error(1529, un.Location, "A using clause must precede all other namespace elements except extern alias declarations"); } if (clauses == null) { clauses = new List <UsingNamespace> (); } clauses.Add(un); resolved = false; }
public override void Visit(UsingNamespace un) { var ud = new UsingDeclaration(); var loc = LocationsBag.GetLocations(un); ud.AddChild(new CSharpTokenNode(Convert(un.Location), UsingDeclaration.UsingKeywordRole), UsingDeclaration.UsingKeywordRole); if (un.NamespaceExpression != null) ud.AddChild(ConvertToType(un.NamespaceExpression), UsingDeclaration.ImportRole); if (loc != null) ud.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Semicolon), Roles.Semicolon); AddToNamespace(ud); }
public void AddUsing (UsingNamespace un) { if (DeclarationFound){ Compiler.Report.Error (1529, un.Location, "A using clause must precede all other namespace elements except extern alias declarations"); } if (clauses == null) clauses = new List<UsingNamespace> (); clauses.Add (un); }
public virtual void Visit(UsingNamespace un) { }
void case_18() #line 469 "cs-parser.jay" { var un = new UsingNamespace ((ATypeNameExpression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); current_namespace.AddUsing (un); lbag.AddLocation (un, GetLocation (yyVals[0+yyTop])); }
public virtual void Visit (UsingNamespace un) { }
void Warning_DuplicateEntry (UsingNamespace entry) { Compiler.Report.Warning (105, 3, entry.Location, "The using directive for `{0}' appeared previously in this namespace", entry.ResolvedExpression.GetSignatureForError ()); }
public void AddUsing (UsingNamespace un, bool forceAppend = false) { bool isPlayScript = this.CompilationSourceFile != null && this.CompilationSourceFile.SourceFile != null && this.CompilationSourceFile.SourceFile.FileType == Mono.CSharp.SourceFileType.PlayScript; if (DeclarationFound && !forceAppend && !isPlayScript){ Compiler.Report.Error (1529, un.Location, "A using clause must precede all other namespace elements except extern alias declarations"); } if (clauses == null) clauses = new List<UsingNamespace> (); clauses.Add (un); }