This cleans up ExpressionParser so that the lexer only consumes one extra token in case the parser finishes. The parser will also finish with YYACCEPT once it has parsed a complete expression. This will make the preprocessor to generate a more informative unexpected token error instead of a syntax error if there are extra tokens after #if. This will also enable reusing ExpressionParser for parsing expressions in line directives. The format for a line directive that specifies both line and file numbers is as follows: #if line-expression file_expression ExpressionParser will need to be run twice for each line: first to parse line-expression and then to parse file-expression. For that reason, it is essential that ExpressionParser for line-expression stops before consuming more than one token of file-expression. BUG=angleproject:989 TEST=angle_unittests, dEQP-GLES3.functional.shaders.preprocessor.* Change-Id: I0bb92f733c18891eeddbc61e7c5bebdf1003559a Reviewed-on: https://chromium-review.googlesource.com/300962Tested-by:Olli Etuaho <oetuaho@nvidia.com> Reviewed-by:
Jamie Madill <jmadill@chromium.org> Reviewed-by:
Zhenyao Mo <zmo@chromium.org> Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| MockDiagnostics.h | Loading commit data... | |
| MockDirectiveHandler.h | Loading commit data... | |
| PreprocessorTest.cpp | Loading commit data... | |
| PreprocessorTest.h | Loading commit data... | |
| char_test.cpp | Loading commit data... | |
| comment_test.cpp | Loading commit data... | |
| define_test.cpp | Loading commit data... | |
| error_test.cpp | Loading commit data... | |
| extension_test.cpp | Loading commit data... | |
| identifier_test.cpp | Loading commit data... | |
| if_test.cpp | Loading commit data... | |
| input_test.cpp | Loading commit data... | |
| location_test.cpp | Loading commit data... | |
| number_test.cpp | Loading commit data... | |
| operator_test.cpp | Loading commit data... | |
| pragma_test.cpp | Loading commit data... | |
| space_test.cpp | Loading commit data... | |
| token_test.cpp | Loading commit data... | |
| version_test.cpp | Loading commit data... |