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 |
|---|---|---|
| .. | ||
| 64bit-tokenizer-safety.patch | Loading commit data... | |
| DiagnosticsBase.cpp | Loading commit data... | |
| DiagnosticsBase.h | Loading commit data... | |
| DirectiveHandlerBase.cpp | Loading commit data... | |
| DirectiveHandlerBase.h | Loading commit data... | |
| DirectiveParser.cpp | Loading commit data... | |
| DirectiveParser.h | Loading commit data... | |
| ExpressionParser.cpp | Loading commit data... | |
| ExpressionParser.h | Loading commit data... | |
| ExpressionParser.y | Loading commit data... | |
| Input.cpp | Loading commit data... | |
| Input.h | Loading commit data... | |
| Lexer.cpp | Loading commit data... | |
| Lexer.h | Loading commit data... | |
| Macro.cpp | Loading commit data... | |
| Macro.h | Loading commit data... | |
| MacroExpander.cpp | Loading commit data... | |
| MacroExpander.h | Loading commit data... | |
| Preprocessor.cpp | Loading commit data... | |
| Preprocessor.h | Loading commit data... | |
| SourceLocation.h | Loading commit data... | |
| Token.cpp | Loading commit data... | |
| Token.h | Loading commit data... | |
| Tokenizer.cpp | Loading commit data... | |
| Tokenizer.h | Loading commit data... | |
| Tokenizer.l | Loading commit data... | |
| generate_parser.sh | Loading commit data... | |
| numeric_lex.h | Loading commit data... | |
| pp_utils.h | Loading commit data... |