mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +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
Notes:
sideshowbarker
2024-07-18 07:18:16 +09:00
Author: https://github.com/itamar8910
Commit: 4673a517f6
Pull-request: https://github.com/SerenityOS/serenity/pull/9230
Reviewed-by: https://github.com/alimpfard
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