|
@@ -7,13 +7,14 @@
|
|
#include <LibCore/ArgsParser.h>
|
|
#include <LibCore/ArgsParser.h>
|
|
#include <LibCore/File.h>
|
|
#include <LibCore/File.h>
|
|
#include <LibCpp/Lexer.h>
|
|
#include <LibCpp/Lexer.h>
|
|
|
|
+#include <LibMain/Main.h>
|
|
|
|
|
|
-int main(int argc, char** argv)
|
|
|
|
|
|
+ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|
{
|
|
{
|
|
Core::ArgsParser args_parser;
|
|
Core::ArgsParser args_parser;
|
|
const char* path = nullptr;
|
|
const char* path = nullptr;
|
|
args_parser.add_positional_argument(path, "Cpp File", "cpp-file", Core::ArgsParser::Required::Yes);
|
|
args_parser.add_positional_argument(path, "Cpp File", "cpp-file", Core::ArgsParser::Required::Yes);
|
|
- args_parser.parse(argc, argv);
|
|
|
|
|
|
+ args_parser.parse(arguments);
|
|
|
|
|
|
auto file = Core::File::construct(path);
|
|
auto file = Core::File::construct(path);
|
|
if (!file->open(Core::OpenMode::ReadOnly)) {
|
|
if (!file->open(Core::OpenMode::ReadOnly)) {
|
|
@@ -27,4 +28,6 @@ int main(int argc, char** argv)
|
|
lexer.lex_iterable([](auto token) {
|
|
lexer.lex_iterable([](auto token) {
|
|
outln("{}", token.to_string());
|
|
outln("{}", token.to_string());
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|