Пример #1
0
        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;
        }
Пример #2
0
			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);
			}
Пример #3
0
		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);
		}
Пример #4
0
 public virtual void Visit(UsingNamespace un)
 {
 }
Пример #5
0
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]));
	  }
Пример #6
0
		public virtual void Visit (UsingNamespace un)
		{
		}
Пример #7
0
		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 ());
		}
Пример #8
0
		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);
		}