Deleted unnecessary TParseContext::AfterEOF.

TBR=kbr@chromium.org Review URL: https://codereview.appspot.com/8927045 git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@2227 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0428c72e
......@@ -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 fragmentPrecisionHigh; // true if highp precision is supported in the fragment language.
TString HashErrMsg;
bool AfterEOF;
TDiagnostics diagnostics;
TDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor;
......
......@@ -265,7 +265,7 @@ O [0-7]
<FIELDS>[ \t\v\f\r] {}
[ \t\v\n\f\r] { }
<*><<EOF>> { context->AfterEOF = true; yyterminate(); }
<*><<EOF>> { yyterminate(); }
<*>. { context->warning(yylineno, "Unknown char", yytext, ""); return 0; }
%%
......@@ -312,11 +312,7 @@ int reserved_word(yyscan_t yyscanner) {
void yyerror(TParseContext* context, const char* reason) {
struct yyguts_t* yyg = (struct yyguts_t*) context->scanner;
if (context->AfterEOF) {
context->error(yylineno, reason, "unexpected EOF");
} else {
context->error(yylineno, reason, yytext);
}
context->error(yylineno, reason, yytext);
context->recover();
}
......@@ -343,7 +339,6 @@ int glslang_scan(size_t count, const char* const string[], const int length[],
TParseContext* context) {
yyrestart(NULL, context->scanner);
yyset_lineno(EncodeSourceLoc(0, 1), context->scanner);
context->AfterEOF = false;
// Initialize preprocessor.
if (!context->preprocessor.init(count, string, length))
......
......@@ -1768,7 +1768,7 @@ YY_RULE_SETUP
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(FIELDS):
{ context->AfterEOF = true; yyterminate(); }
{ yyterminate(); }
YY_BREAK
case 154:
YY_RULE_SETUP
......@@ -2990,11 +2990,7 @@ int reserved_word(yyscan_t yyscanner) {
void yyerror(TParseContext* context, const char* reason) {
struct yyguts_t* yyg = (struct yyguts_t*) context->scanner;
if (context->AfterEOF) {
context->error(yylineno, reason, "unexpected EOF");
} else {
context->error(yylineno, reason, yytext);
}
context->error(yylineno, reason, yytext);
context->recover();
}
......@@ -3021,7 +3017,6 @@ int glslang_scan(size_t count, const char* const string[], const int length[],
TParseContext* context) {
yyrestart(NULL,context->scanner);
yyset_lineno(EncodeSourceLoc(0, 1),context->scanner);
context->AfterEOF = false;
// Initialize preprocessor.
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