summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_lexer.lpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/glsl_lexer.lpp')
-rw-r--r--src/glsl/glsl_lexer.lpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/glsl/glsl_lexer.lpp b/src/glsl/glsl_lexer.lpp
index ebfea37597d..702e79a363e 100644
--- a/src/glsl/glsl_lexer.lpp
+++ b/src/glsl/glsl_lexer.lpp
@@ -318,10 +318,38 @@ namespace return NAMESPACE;
using return USING;
/* Additional reserved words in GLSL 1.20. */
-lowp return LOWP;
-mediump return MEDIUMP;
-highp return HIGHP;
-precision return PRECISION;
+lowp {
+ if (yyextra->language_version >= 120){
+ return LOWP;
+ } else {
+ yylval->identifier = strdup(yytext);
+ return IDENTIFIER;
+ }
+ }
+mediump {
+ if (yyextra->language_version >= 120){
+ return MEDIUMP;
+ } else {
+ yylval->identifier = strdup(yytext);
+ return IDENTIFIER;
+ }
+ }return MEDIUMP;
+highp {
+ if (yyextra->language_version >= 120){
+ return HIGHP;
+ } else {
+ yylval->identifier = strdup(yytext);
+ return IDENTIFIER;
+ }
+ }
+precision {
+ if (yyextra->language_version >= 120){
+ return PRECISION;
+ } else {
+ yylval->identifier = strdup(yytext);
+ return IDENTIFIER;
+ }
+ }
[_a-zA-Z][_a-zA-Z0-9]* {
struct _mesa_glsl_parse_state *state = yyextra;