Store the numbers and the identifiers in two different sets.

This commit is contained in:
Roberto Raggi
2010-11-26 15:50:55 +01:00
parent 30e74df0ba
commit b19b2a7167
5 changed files with 46 additions and 8 deletions

View File

@@ -207,9 +207,12 @@ int Lexer::yylex_helper(const char **position, int *line)
// float constant
case '.':
if (std::isdigit(_yychar)) {
const char *word = _it - 2;
while (std::isalnum(_yychar)) {
yyinp();
}
if (_engine)
_yyval.string = _engine->number(word, _it - word - 1);
return Parser::T_NUMBER;
}
return Parser::T_DOT;
@@ -378,7 +381,7 @@ int Lexer::yylex_helper(const char **position, int *line)
yyinp();
}
if (_engine)
_yyval.string = _engine->identifier(word, _it - word - 1);
_yyval.string = _engine->number(word, _it - word - 1);
return Parser::T_NUMBER;
}