Commit dad18f30 by alokp@chromium.org

Deleted unnecessary TParseContext::AfterEOF.

TBR=kbr@chromium.org Review URL: https://codereview.appspot.com/8927045 git-svn-id: https://angleproject.googlecode.com/svn/trunk@2188 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 8b7feb77
...@@ -60,7 +60,6 @@ struct TParseContext { ...@@ -60,7 +60,6 @@ struct TParseContext {
bool checksPrecisionErrors; // true if an error will be generated when a variable is declared without precision, explicit or implicit. bool checksPrecisionErrors; // true if an error will be generated when a variable is declared without precision, explicit or implicit.
bool fragmentPrecisionHigh; // true if highp precision is supported in the fragment language. bool fragmentPrecisionHigh; // true if highp precision is supported in the fragment language.
TString HashErrMsg; TString HashErrMsg;
bool AfterEOF;
TDiagnostics diagnostics; TDiagnostics diagnostics;
TDirectiveHandler directiveHandler; TDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor; pp::Preprocessor preprocessor;
......
...@@ -265,7 +265,7 @@ O [0-7] ...@@ -265,7 +265,7 @@ O [0-7]
<FIELDS>[ \t\v\f\r] {} <FIELDS>[ \t\v\f\r] {}
[ \t\v\n\f\r] { } [ \t\v\n\f\r] { }
<*><<EOF>> { context->AfterEOF = true; yyterminate(); } <*><<EOF>> { yyterminate(); }
<*>. { context->warning(yylineno, "Unknown char", yytext, ""); return 0; } <*>. { context->warning(yylineno, "Unknown char", yytext, ""); return 0; }
%% %%
...@@ -312,11 +312,7 @@ int reserved_word(yyscan_t yyscanner) { ...@@ -312,11 +312,7 @@ int reserved_word(yyscan_t yyscanner) {
void yyerror(TParseContext* context, const char* reason) { void yyerror(TParseContext* context, const char* reason) {
struct yyguts_t* yyg = (struct yyguts_t*) context->scanner; struct yyguts_t* yyg = (struct yyguts_t*) context->scanner;
if (context->AfterEOF) { context->error(yylineno, reason, yytext);
context->error(yylineno, reason, "unexpected EOF");
} else {
context->error(yylineno, reason, yytext);
}
context->recover(); context->recover();
} }
...@@ -343,7 +339,6 @@ int glslang_scan(size_t count, const char* const string[], const int length[], ...@@ -343,7 +339,6 @@ int glslang_scan(size_t count, const char* const string[], const int length[],
TParseContext* context) { TParseContext* context) {
yyrestart(NULL, context->scanner); yyrestart(NULL, context->scanner);
yyset_lineno(EncodeSourceLoc(0, 1), context->scanner); yyset_lineno(EncodeSourceLoc(0, 1), context->scanner);
context->AfterEOF = false;
// Initialize preprocessor. // Initialize preprocessor.
if (!context->preprocessor.init(count, string, length)) if (!context->preprocessor.init(count, string, length))
......
...@@ -1769,7 +1769,7 @@ YY_RULE_SETUP ...@@ -1769,7 +1769,7 @@ YY_RULE_SETUP
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(FIELDS): case YY_STATE_EOF(FIELDS):
{ context->AfterEOF = true; yyterminate(); } { yyterminate(); }
YY_BREAK YY_BREAK
case 154: case 154:
YY_RULE_SETUP YY_RULE_SETUP
...@@ -2990,11 +2990,7 @@ int reserved_word(yyscan_t yyscanner) { ...@@ -2990,11 +2990,7 @@ int reserved_word(yyscan_t yyscanner) {
void yyerror(TParseContext* context, const char* reason) { void yyerror(TParseContext* context, const char* reason) {
struct yyguts_t* yyg = (struct yyguts_t*) context->scanner; struct yyguts_t* yyg = (struct yyguts_t*) context->scanner;
if (context->AfterEOF) { context->error(yylineno, reason, yytext);
context->error(yylineno, reason, "unexpected EOF");
} else {
context->error(yylineno, reason, yytext);
}
context->recover(); context->recover();
} }
...@@ -3021,7 +3017,6 @@ int glslang_scan(size_t count, const char* const string[], const int length[], ...@@ -3021,7 +3017,6 @@ int glslang_scan(size_t count, const char* const string[], const int length[],
TParseContext* context) { TParseContext* context) {
yyrestart(NULL,context->scanner); yyrestart(NULL,context->scanner);
yyset_lineno(EncodeSourceLoc(0, 1),context->scanner); yyset_lineno(EncodeSourceLoc(0, 1),context->scanner);
context->AfterEOF = false;
// Initialize preprocessor. // Initialize preprocessor.
if (!context->preprocessor.init(count, string, length)) if (!context->preprocessor.init(count, string, length))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment