mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
LibCpp: Do lexing in the Preprocessor
We now call Preprocessor::process_and_lex() and pass the result to the parser. Doing the lexing in the preprocessor will allow us to maintain the original position information of tokens after substituting definitions.
This commit is contained in:
parent
bf7262681e
commit
4673a517f6
9 changed files with 42 additions and 39 deletions
|
@ -43,7 +43,8 @@ TEST_CASE(test_regression)
|
|||
auto target_ast = read_all(ast_file_path);
|
||||
|
||||
StringView source_view(source);
|
||||
::Cpp::Parser parser(source_view, file_path);
|
||||
Cpp::Preprocessor preprocessor(file_path, source_view);
|
||||
Cpp::Parser parser(preprocessor.process_and_lex(), file_path);
|
||||
auto root = parser.parse();
|
||||
|
||||
EXPECT(parser.errors().is_empty());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue