cpp-parser: Port to LibMain :^)

This commit is contained in:
Kenneth Myhra 2021-11-27 21:17:19 +01:00 committed by Brian Gianforcaro
parent 1a81d79705
commit 121fe820d9
Notes: sideshowbarker 2024-07-17 22:56:09 +09:00
2 changed files with 6 additions and 2 deletions

View File

@ -74,6 +74,7 @@ target_link_libraries(config LibConfig)
target_link_libraries(copy LibGUI LibMain)
target_link_libraries(cp LibMain)
target_link_libraries(cpp-lexer LibMain)
target_link_libraries(cpp-parser LibMain)
target_link_libraries(diff LibDiff)
target_link_libraries(disasm LibX86)
target_link_libraries(dmesg LibMain)

View File

@ -7,15 +7,16 @@
#include <LibCore/ArgsParser.h>
#include <LibCore/File.h>
#include <LibCpp/Parser.h>
#include <LibMain/Main.h>
int main(int argc, char** argv)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
Core::ArgsParser args_parser;
const char* path = nullptr;
bool tokens_mode = false;
args_parser.add_option(tokens_mode, "Print Tokens", "tokens", 'T');
args_parser.add_positional_argument(path, "Cpp File", "cpp-file", Core::ArgsParser::Required::No);
args_parser.parse(argc, argv);
args_parser.parse(arguments);
if (!path)
path = "Source/little/main.cpp";
@ -43,4 +44,6 @@ int main(int argc, char** argv)
}
root->dump();
return 0;
}