public void AddUsing (UsingClause 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<UsingClause> (); clauses.Add (un); }
public virtual void Visit (UsingClause usingClause) { }
void Warning_DuplicateEntry (UsingClause entry) { Compiler.Report.Warning (105, 3, entry.Location, "The using directive for `{0}' appeared previously in this namespace", entry.ResolvedExpression.GetSignatureForError ()); }
public override void Visit(UsingClause 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); }