mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 07:14:58 +00:00
Utilities: Rename PreprocessorTest=>cpp-preprocessor
This commit is contained in:
parent
7d493bbf98
commit
06e47ce7aa
2 changed files with 1 additions and 1 deletions
23
Userland/Utilities/cpp-preprocessor.cpp
Normal file
23
Userland/Utilities/cpp-preprocessor.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCpp/Preprocessor.h>
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
auto file = Core::File::construct("/home/anon/Source/little/other.h");
|
||||
if (!file->open(Core::OpenMode::ReadOnly)) {
|
||||
perror("open");
|
||||
exit(1);
|
||||
}
|
||||
auto content = file->read_all();
|
||||
Cpp::Preprocessor cpp("other.h", StringView { content });
|
||||
auto tokens = cpp.process_and_lex();
|
||||
for (auto& token : tokens) {
|
||||
dbgln("{}", token.to_string());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue