public DeclarationForInStatement(VariableDeclaration Item, Expression Collection, Statement Body, TextSpan Location, TextSpan HeaderLocation, TextPoint In, TextPoint LeftParen, TextPoint RightParen)
			:base(Operation.DeclarationForIn,Collection,Body,Location,HeaderLocation,In,LeftParen,RightParen)
		{
			this.Item = Item;
			this.In = In;
			this.LeftParen = LeftParen;
			this.RightParen = RightParen;
		}
		public VariableDeclarationListElement(VariableDeclaration Declaration, TextPoint CommaLocation)
		{
			this.Declaration = Declaration;
			this.CommaLocation = CommaLocation;
		}
示例#3
0
		private VariableDeclarationStatement ParseVarDeclaration ()
		{
			Token start = current;
			List<VariableDeclarationListElement> declarations = new List<VariableDeclarationListElement>();
			do {
				Next ();
				Identifier name = null;
				if (CheckSyntaxExpected (Token.Type.Identifier))
					name = (current as IdentifierToken).Spelling;

				Next ();
				VariableDeclaration declaration;
				if (current.Kind == Token.Type.Equal) {
					Token start2 = current;
					Next ();
					Expression initializer = ParseAssignmentExpression (false);
					declaration = new InitializerVariableDeclaration (name, initializer, new TextSpan (start2, current), new TextPoint (start2.StartPosition));
					//Next ();
				}
				else
					declaration = new VariableDeclaration (name, new TextSpan (current, current));

				VariableDeclarationListElement vardeclarListElt = new VariableDeclarationListElement (declaration, new TextPoint (current.StartPosition));
				declarations.Add (vardeclarListElt);
			} while (current.Kind == Token.Type.Comma);
			VariableDeclarationStatement statement = new VariableDeclarationStatement (declarations, new TextSpan (start, current));
			InsertSemicolon ();
			return statement;
		}