aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/glsl/glsllexer.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <[email protected]>2010-11-26 15:50:55 +0100
committerRoberto Raggi <[email protected]>2010-11-26 15:52:59 +0100
commitb19b2a71672ee172786e5d3c2c1ff307f9745a68 (patch)
treee9c341304b0aece191fb8a38337eebb4f552a520 /src/libs/glsl/glsllexer.cpp
parent30e74df0baedcd3a5e2aa309892e2b98d435b0b0 (diff)
Store the numbers and the identifiers in two different sets.
Diffstat (limited to 'src/libs/glsl/glsllexer.cpp')
-rw-r--r--src/libs/glsl/glsllexer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libs/glsl/glsllexer.cpp b/src/libs/glsl/glsllexer.cpp
index 3651d94f5d5..ba67c865c53 100644
--- a/src/libs/glsl/glsllexer.cpp
+++ b/src/libs/glsl/glsllexer.cpp
@@ -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;
}