diff options
author | Eric Anholt <[email protected]> | 2010-07-28 16:58:39 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-07-28 17:32:39 -0700 |
commit | d4a04f315560704bf1103df0b93723e468725df7 (patch) | |
tree | ac9d7ed7f333b9ca9ba909292a8d0599e25d562a /src/glsl/glcpp/glcpp-lex.l | |
parent | 8605c297cfb8068737991601f163f866395c41c9 (diff) |
glcpp: Add __VERSION__ define to the current language version.
Fixes:
glsl-version-define
glsl-version-define-110
glsl-version-define-120
Diffstat (limited to 'src/glsl/glcpp/glcpp-lex.l')
-rw-r--r-- | src/glsl/glcpp/glcpp-lex.l | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l index a4c891bdc69..17a097e633a 100644 --- a/src/glsl/glcpp/glcpp-lex.l +++ b/src/glsl/glcpp/glcpp-lex.l @@ -87,9 +87,17 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return SPACE; } +{HASH}(version) { + yylval->str = xtalloc_strdup (yyextra, yytext); + yylineno++; + yycolumn = 0; + yyextra->space_tokens = 0; + return HASH_VERSION; +} + /* glcpp doesn't handle #extension, #version, or #pragma directives. * Simply pass them through to the main compiler's lexer/parser. */ -{HASH}(extension|version|pragma)[^\n]+ { +{HASH}(extension|pragma)[^\n]+ { yylval->str = xtalloc_strdup (yyextra, yytext); yylineno++; yycolumn = 0; |