From 61f205ecd813dd828ab1ab6212cc6aa0b1869a04 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Tue, 7 May 2013 23:48:06 +0000 Subject: [PATCH] Remove too aggressive and redundant lexical keyword check: attribute and varying can always be error checked in the grammar. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21443 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- glslang/MachineIndependent/glslang.l | 12 ------------ glslang/MachineIndependent/glslang.y | 8 ++++---- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/glslang/MachineIndependent/glslang.l b/glslang/MachineIndependent/glslang.l index 3c37f99e..e5729915 100644 --- a/glslang/MachineIndependent/glslang.l +++ b/glslang/MachineIndependent/glslang.l @@ -67,7 +67,6 @@ LF [lL][fF] #include "glslang_tab.cpp.h" void PaReservedWord(); -void PaCompatibilityWord(TParseContext&); int PaIdentOrType(const char* yytext, TParseContext&, YYSTYPE* pyylval); int PaIdentOrReserved(bool reserved, TParseContext&, int line, const char* text, YYSTYPE* pyylval); int PaES30ReservedFromGLSL(int version, TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword); @@ -110,7 +109,6 @@ int yy_input(char* buf, int max_size); "attribute" { pyylval->lex.line = yylineno; if (parseContext.profile == EEsProfile && parseContext.version >= 300) PaReservedWord(); - PaCompatibilityWord(parseContext); return ATTRIBUTE; } "const" { pyylval->lex.line = yylineno; @@ -122,7 +120,6 @@ int yy_input(char* buf, int max_size); "varying" { pyylval->lex.line = yylineno; if (parseContext.profile == EEsProfile && parseContext.version >= 300) PaReservedWord(); - PaCompatibilityWord(parseContext); return VARYING; } "buffer" { pyylval->lex.line = yylineno; @@ -744,15 +741,6 @@ void PaReservedWord() GlobalParseContext->recover(); } -void PaCompatibilityWord(TParseContext& parseContextlocal) -{ - if (parseContextlocal.profile != EEsProfile && parseContextlocal.profile != ECompatibilityProfile && - parseContextlocal.version > 150) { - GlobalParseContext->error(yylineno, "Keyword requires compatibility profile.", yytext, "", ""); - GlobalParseContext->recover(); - } -} - int PaIdentOrType(const char* yytext, TParseContext& parseContextLocal, YYSTYPE* pyylval) { pyylval->lex.string = NewPoolTString(yytext); diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 4d6fb4b9..ed29c50a 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -1724,8 +1724,8 @@ storage_qualifier } | ATTRIBUTE { parseContext.requireStage($1.line, EShLangVertexMask, "attribute"); - parseContext.checkDeprecated($1.line, ECoreProfile, 150, "attribute"); - parseContext.checkDeprecated($1.line, ENoProfile, 140, "attribute"); + parseContext.checkDeprecated($1.line, ECoreProfile, 130, "attribute"); + parseContext.checkDeprecated($1.line, ENoProfile, 130, "attribute"); parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "attribute"); parseContext.requireNotRemoved($1.line, EEsProfile, 300, "attribute"); @@ -1736,8 +1736,8 @@ storage_qualifier $$.qualifier.storage = EvqVaryingIn; } | VARYING { - parseContext.checkDeprecated($1.line, ENoProfile, 140, "varying"); - parseContext.checkDeprecated($1.line, ECoreProfile, 150, "varying"); + parseContext.checkDeprecated($1.line, ENoProfile, 130, "varying"); + parseContext.checkDeprecated($1.line, ECoreProfile, 130, "varying"); parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "varying"); parseContext.requireNotRemoved($1.line, EEsProfile, 300, "varying");