Refactor solidity::Token into an enum class with TokenTraits helper namespace

This commit is contained in:
Christian Parpart
2018-10-22 17:00:51 +02:00
parent c13b5280c1
commit f112377dd4
22 changed files with 357 additions and 364 deletions
+3 -3
View File
@@ -42,13 +42,13 @@ SemVerMatchExpression parseExpression(string const& _input)
{
Scanner scanner{CharStream(_input)};
vector<string> literals;
vector<Token::Value> tokens;
vector<Token> tokens;
while (scanner.currentToken() != Token::EOS)
{
auto token = scanner.currentToken();
string literal = scanner.currentLiteral();
if (literal.empty() && Token::toString(token))
literal = Token::toString(token);
if (literal.empty() && TokenTraits::toString(token))
literal = TokenTraits::toString(token);
literals.push_back(literal);
tokens.push_back(token);
scanner.next();