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
This commit is contained in:
John Kessenich 2013-05-07 23:48:06 +00:00
parent 52ac67e913
commit 61f205ecd8
2 changed files with 4 additions and 16 deletions

View File

@ -67,7 +67,6 @@ LF [lL][fF]
#include "glslang_tab.cpp.h" #include "glslang_tab.cpp.h"
void PaReservedWord(); void PaReservedWord();
void PaCompatibilityWord(TParseContext&);
int PaIdentOrType(const char* yytext, TParseContext&, YYSTYPE* pyylval); int PaIdentOrType(const char* yytext, TParseContext&, YYSTYPE* pyylval);
int PaIdentOrReserved(bool reserved, TParseContext&, int line, const char* text, 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); 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; "attribute" { pyylval->lex.line = yylineno;
if (parseContext.profile == EEsProfile && parseContext.version >= 300) if (parseContext.profile == EEsProfile && parseContext.version >= 300)
PaReservedWord(); PaReservedWord();
PaCompatibilityWord(parseContext);
return ATTRIBUTE; return ATTRIBUTE;
} }
"const" { pyylval->lex.line = yylineno; "const" { pyylval->lex.line = yylineno;
@ -122,7 +120,6 @@ int yy_input(char* buf, int max_size);
"varying" { pyylval->lex.line = yylineno; "varying" { pyylval->lex.line = yylineno;
if (parseContext.profile == EEsProfile && parseContext.version >= 300) if (parseContext.profile == EEsProfile && parseContext.version >= 300)
PaReservedWord(); PaReservedWord();
PaCompatibilityWord(parseContext);
return VARYING; return VARYING;
} }
"buffer" { pyylval->lex.line = yylineno; "buffer" { pyylval->lex.line = yylineno;
@ -744,15 +741,6 @@ void PaReservedWord()
GlobalParseContext->recover(); 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) int PaIdentOrType(const char* yytext, TParseContext& parseContextLocal, YYSTYPE* pyylval)
{ {
pyylval->lex.string = NewPoolTString(yytext); pyylval->lex.string = NewPoolTString(yytext);

View File

@ -1724,8 +1724,8 @@ storage_qualifier
} }
| ATTRIBUTE { | ATTRIBUTE {
parseContext.requireStage($1.line, EShLangVertexMask, "attribute"); parseContext.requireStage($1.line, EShLangVertexMask, "attribute");
parseContext.checkDeprecated($1.line, ECoreProfile, 150, "attribute"); parseContext.checkDeprecated($1.line, ECoreProfile, 130, "attribute");
parseContext.checkDeprecated($1.line, ENoProfile, 140, "attribute"); parseContext.checkDeprecated($1.line, ENoProfile, 130, "attribute");
parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "attribute"); parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "attribute");
parseContext.requireNotRemoved($1.line, EEsProfile, 300, "attribute"); parseContext.requireNotRemoved($1.line, EEsProfile, 300, "attribute");
@ -1736,8 +1736,8 @@ storage_qualifier
$$.qualifier.storage = EvqVaryingIn; $$.qualifier.storage = EvqVaryingIn;
} }
| VARYING { | VARYING {
parseContext.checkDeprecated($1.line, ENoProfile, 140, "varying"); parseContext.checkDeprecated($1.line, ENoProfile, 130, "varying");
parseContext.checkDeprecated($1.line, ECoreProfile, 150, "varying"); parseContext.checkDeprecated($1.line, ECoreProfile, 130, "varying");
parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "varying"); parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "varying");
parseContext.requireNotRemoved($1.line, EEsProfile, 300, "varying"); parseContext.requireNotRemoved($1.line, EEsProfile, 300, "varying");