Revert "Add pragma errors for malformed pragmas."
Since this commit was made, dEQP tests were fixed to check that
unrecognized pragma tokens only generate warnings, not errors.
This applies to both ESSL1.00 and ESSL3.00, which specify this
behavior in section 3.4 Preprocessor.
BUG=angleproject:989
TEST=dEQP-GLES2.functional.shaders.preprocessor.pragmas.*
This reverts commit d3c29f57aaeb451b149bbb9fd17b3f1f99101c52.
Change-Id: Ie4e0ec061fa3164d6f3872ac0016a063056ed110
Reviewed-on: https://chromium-review.googlesource.com/293181
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/preprocessor/DirectiveParser.cpp b/src/compiler/preprocessor/DirectiveParser.cpp
index fecfdae..44cd6ba 100644
--- a/src/compiler/preprocessor/DirectiveParser.cpp
+++ b/src/compiler/preprocessor/DirectiveParser.cpp
@@ -631,8 +631,7 @@
break;
case PRAGMA_VALUE:
value = token->text;
- // Pragma value validation is handled in DirectiveHandler::handlePragma
- // because the proper pragma value is dependent on the pragma name.
+ valid = valid && (token->type == Token::IDENTIFIER);
break;
case RIGHT_PAREN:
valid = valid && (token->type == ')');
@@ -649,7 +648,7 @@
(state == RIGHT_PAREN + 1)); // With value.
if (!valid)
{
- mDiagnostics->report(Diagnostics::PP_INVALID_PRAGMA,
+ mDiagnostics->report(Diagnostics::PP_UNRECOGNIZED_PRAGMA,
token->location, name);
}
else if (state > PRAGMA_NAME) // Do not notify for empty pragma.