skopy/cli/main.c

23 lines
404 B
C
Raw Normal View History

2024-03-31 15:44:34 +00:00
#include <stdio.h>
2024-03-31 21:10:56 +00:00
#include <module.h>
#include <errors.h>
2024-03-31 15:44:34 +00:00
2024-03-31 21:10:56 +00:00
int main(int argc, char** argv)
2024-03-31 15:44:34 +00:00
{
2024-03-31 21:10:56 +00:00
if (argc == 2)
{
errors_init();
struct module module;
2024-04-07 18:43:13 +00:00
module_init(&module, argv[1]);
2024-03-31 21:10:56 +00:00
module_load_source(&module, argv[1]);
int status = module_compile(&module);
2024-03-31 21:10:56 +00:00
module_free(&module);
errors_free();
return status;
2024-03-31 21:10:56 +00:00
}
2024-03-31 15:44:34 +00:00
return 0;
}