mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove fallthrough from literal parsing
This commit is contained in:
parent
1437521df0
commit
ef8355da7f
@ -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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user