Commit 4b6bfe10 by Jamie Madill

Revert "Track if a non-preprocessor token has been seen and validate #extension with it."

Causing failures in the GLES2 CTS "build", related to extensions. BUG=483252 BUG=angleproject:989 This reverts commit bbdb9e22. Change-Id: I3e1ad989af645194c8ee9b9847b2131e289d09e1 Reviewed-on: https://chromium-review.googlesource.com/269403Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent fee03501
......@@ -123,8 +123,6 @@ std::string Diagnostics::message(ID id)
return "unexpected token after conditional expression";
case PP_UNRECOGNIZED_PRAGMA:
return "unrecognized pragma";
case PP_NON_PP_TOKEN_BEFORE_EXTENSION:
return "extension directive must occur before any non-preprocessor tokens";
// Warnings end.
default:
assert(false);
......
......@@ -70,7 +70,6 @@ class Diagnostics
PP_WARNING_BEGIN,
PP_EOF_IN_DIRECTIVE,
PP_UNRECOGNIZED_PRAGMA,
PP_NON_PP_TOKEN_BEFORE_EXTENSION,
PP_WARNING_END
};
......
......@@ -211,7 +211,6 @@ DirectiveParser::DirectiveParser(Tokenizer *tokenizer,
Diagnostics *diagnostics,
DirectiveHandler *directiveHandler)
: mPastFirstStatement(false),
mSeenNonPreprocessorToken(false),
mTokenizer(tokenizer),
mMacroSet(macroSet),
mDiagnostics(diagnostics),
......@@ -230,10 +229,6 @@ void DirectiveParser::lex(Token *token)
parseDirective(token);
mPastFirstStatement = true;
}
else if (!isEOD(token))
{
mSeenNonPreprocessorToken = true;
}
if (token->type == Token::LAST)
{
......@@ -720,12 +715,6 @@ void DirectiveParser::parseExtension(Token *token)
token->location, token->text);
valid = false;
}
if (valid && mSeenNonPreprocessorToken)
{
mDiagnostics->report(Diagnostics::PP_NON_PP_TOKEN_BEFORE_EXTENSION,
token->location, token->text);
valid = false;
}
if (valid)
mDirectiveHandler->handleExtension(token->location, name, behavior);
}
......
......@@ -70,8 +70,6 @@ class DirectiveParser : public Lexer
}
};
bool mPastFirstStatement;
bool mSeenNonPreprocessorToken; // Tracks if a non-preprocessor token has been seen yet. Some macros, such as
// #extension must be declared before all shader code.
std::vector<ConditionalBlock> mConditionalStack;
Tokenizer *mTokenizer;
MacroSet *mMacroSet;
......
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