diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-24 21:50:05 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-25 21:22:59 +0800 |
commit | ef8355da7f301253303743187d00498791399ab3 (patch) | |
tree | b9bcf9efed416f13b2785d5d503f202ee91a333f | |
parent | 1437521df0136fc3654dd74c816d724c50a125ee (diff) | |
download | dexon-solidity-ef8355da7f301253303743187d00498791399ab3.tar.gz dexon-solidity-ef8355da7f301253303743187d00498791399ab3.tar.zst dexon-solidity-ef8355da7f301253303743187d00498791399ab3.zip |
Remove fallthrough from literal parsing
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index ddfdb667..2f28db3e 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -1309,18 +1309,21 @@ ASTPointer<Expression> Parser::parsePrimaryExpression() Literal::SubDenomination subdenomination = static_cast<Literal::SubDenomination>(m_scanner->currentToken()); m_scanner->next(); expression = nodeFactory.createNode<Literal>(token, literal, subdenomination); - break; } - if (Token::isTimeSubdenomination(m_scanner->peekNextToken())) + else if (Token::isTimeSubdenomination(m_scanner->peekNextToken())) { ASTPointer<ASTString> literal = getLiteralAndAdvance(); nodeFactory.markEndPosition(); Literal::SubDenomination subdenomination = static_cast<Literal::SubDenomination>(m_scanner->currentToken()); m_scanner->next(); expression = nodeFactory.createNode<Literal>(token, literal, subdenomination); - break; } - // fall-through + else + { + nodeFactory.markEndPosition(); + expression = nodeFactory.createNode<Literal>(token, getLiteralAndAdvance()); + } + break; case Token::StringLiteral: nodeFactory.markEndPosition(); expression = nodeFactory.createNode<Literal>(token, getLiteralAndAdvance()); @@ -1357,9 +1360,9 @@ ASTPointer<Expression> Parser::parsePrimaryExpression() } nodeFactory.markEndPosition(); expectToken(oppositeToken); - return nodeFactory.createNode<TupleExpression>(components, isArray); + expression = nodeFactory.createNode<TupleExpression>(components, isArray); + break; } - default: if (Token::isElementaryTypeName(token)) { |