mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
cpp-parser: Port to LibMain :^)
This commit is contained in:
parent
1a81d79705
commit
121fe820d9
Notes:
sideshowbarker
2024-07-17 22:56:09 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/121fe820d9b Pull-request: https://github.com/SerenityOS/serenity/pull/11101 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bgianfo ✅ Reviewed-by: https://github.com/creator1creeper1 ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user