Commit 9624e058 by Geoff Lang

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

Breaks some WebGL applications, holding off until a decision is made. BUG=483252 BUG=angleproject:989 This reverts commit fa55bf1e. Change-Id: Iebef439095a95741c8502716a4ce90c4785561eb Reviewed-on: https://chromium-review.googlesource.com/268742Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 6afcd6dd
...@@ -211,7 +211,6 @@ DirectiveParser::DirectiveParser(Tokenizer *tokenizer, ...@@ -211,7 +211,6 @@ DirectiveParser::DirectiveParser(Tokenizer *tokenizer,
Diagnostics *diagnostics, Diagnostics *diagnostics,
DirectiveHandler *directiveHandler) DirectiveHandler *directiveHandler)
: mPastFirstStatement(false), : mPastFirstStatement(false),
mSeenNonPreprocessorToken(false),
mTokenizer(tokenizer), mTokenizer(tokenizer),
mMacroSet(macroSet), mMacroSet(macroSet),
mDiagnostics(diagnostics), mDiagnostics(diagnostics),
...@@ -230,10 +229,6 @@ void DirectiveParser::lex(Token *token) ...@@ -230,10 +229,6 @@ void DirectiveParser::lex(Token *token)
parseDirective(token); parseDirective(token);
mPastFirstStatement = true; mPastFirstStatement = true;
} }
else if (!isEOD(token))
{
mSeenNonPreprocessorToken = true;
}
if (token->type == Token::LAST) if (token->type == Token::LAST)
{ {
...@@ -720,12 +715,6 @@ void DirectiveParser::parseExtension(Token *token) ...@@ -720,12 +715,6 @@ void DirectiveParser::parseExtension(Token *token)
token->location, token->text); token->location, token->text);
valid = false; valid = false;
} }
if (valid && mSeenNonPreprocessorToken)
{
mDiagnostics->report(Diagnostics::PP_INVALID_EXTENSION_DIRECTIVE,
token->location, token->text);
valid = false;
}
if (valid) if (valid)
mDirectiveHandler->handleExtension(token->location, name, behavior); mDirectiveHandler->handleExtension(token->location, name, behavior);
} }
......
...@@ -70,8 +70,6 @@ class DirectiveParser : public Lexer ...@@ -70,8 +70,6 @@ class DirectiveParser : public Lexer
} }
}; };
bool mPastFirstStatement; 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; std::vector<ConditionalBlock> mConditionalStack;
Tokenizer *mTokenizer; Tokenizer *mTokenizer;
MacroSet *mMacroSet; 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