mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
new ForStatement parsing test and small grammar fix
This commit is contained in:
parent
f7029726be
commit
3f2600bb31
@ -381,7 +381,6 @@ ASTPointer<ForStatement> Parser::parseForStatement()
|
||||
ASTPointer<Expression> conditionExpression = parseExpression();
|
||||
expectToken(Token::SEMICOLON);
|
||||
ASTPointer<ExpressionStatement> loopExpression = parseExpressionStatement();
|
||||
expectToken(Token::SEMICOLON);
|
||||
expectToken(Token::RPAREN);
|
||||
ASTPointer<Statement> body = parseStatement();
|
||||
nodeFactory.setEndPositionFromNode(body);
|
||||
|
@ -20,7 +20,7 @@ Statement = IfStatement | WhileStatement | Block |
|
||||
|
||||
IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )?
|
||||
WhileStatement = 'while' '(' Expression ')' Statement
|
||||
ForStatement = 'for' '(' Expressionstatement Expression Expressionstatement ')' Statement
|
||||
ForStatement = 'for' '(' VardefOrExpressionstatement ';' Expression ';' Expressionstatement ')' Statement
|
||||
Continue = 'continue' ';'
|
||||
Break = 'break' ';'
|
||||
Return = 'return' Expression? ';'
|
||||
|
Loading…
Reference in New Issue
Block a user