diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-16 21:46:17 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-17 07:03:30 +0800 |
commit | adbea475963ab376c2ae378a03bc58f2fb454b6e (patch) | |
tree | 4a6f0f245c39dd24c340012f6032bf77b8a86c79 /Parser.cpp | |
parent | 062b51e7bdf572abba25a76fc8c3bb6e96da71c9 (diff) | |
download | dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.gz dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.bz2 dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.lz dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.xz dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.zst dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.zip |
Minor issues, grammar update, new ForStatement test
Diffstat (limited to 'Parser.cpp')
-rw-r--r-- | Parser.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -330,10 +330,7 @@ ASTPointer<Statement> Parser::parseStatement() } break; default: - if (peekVariableDefinition()) - statement = parseVariableDefinition(); - else // "ordinary" expression statement - statement = parseExpressionStatement(); + statement = parseVarDefOrExprStmt(); } expectToken(Token::SEMICOLON); return statement; @@ -382,7 +379,7 @@ ASTPointer<ForStatement> Parser::parseForStatement() // LTODO: Maybe here have some predicate like peekExpression() instead of checking for semicolon and RPAREN? if (m_scanner->getCurrentToken() != Token::SEMICOLON) - initExpression = parseVardefOrExprstatement(); + initExpression = parseVarDefOrExprStmt(); expectToken(Token::SEMICOLON); if (m_scanner->getCurrentToken() != Token::SEMICOLON) @@ -401,7 +398,7 @@ ASTPointer<ForStatement> Parser::parseForStatement() body); } -ASTPointer<Statement> Parser::parseVardefOrExprstatement() +ASTPointer<Statement> Parser::parseVarDefOrExprStmt() { if (peekVariableDefinition()) return parseVariableDefinition(); |