mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +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
|
@ -134,14 +134,14 @@ void test_complete_includes()
|
|||
add_file(filedb, "sample_header.h");
|
||||
CppComprehensionEngine autocomplete(filedb);
|
||||
|
||||
auto suggestions = autocomplete.get_suggestions("complete_includes.cpp", { 0, 23 });
|
||||
auto suggestions = autocomplete.get_suggestions("complete_includes.cpp", { 0, 22 });
|
||||
if (suggestions.size() != 1)
|
||||
FAIL(project include - bad size);
|
||||
|
||||
if (suggestions[0].completion != "sample_header.h")
|
||||
FAIL("project include - wrong results");
|
||||
|
||||
suggestions = autocomplete.get_suggestions("complete_includes.cpp", { 1, 19 });
|
||||
suggestions = autocomplete.get_suggestions("complete_includes.cpp", { 1, 18 });
|
||||
if (suggestions.size() != 1)
|
||||
FAIL(global include - bad size);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue