Merge branch 'pitweb' into mach

This commit is contained in:
2026-02-09 11:17:45 -06:00
75 changed files with 4438 additions and 1859 deletions

View File

@@ -387,8 +387,34 @@ static int run_eval(const char *script_or_file, int print_bytecode, int use_boot
return result;
}
static void print_usage(const char *prog)
{
printf("Usage: %s [options] <script> [args...]\n\n", prog);
printf("Run a cell script (.ce actor or .cm module).\n\n");
printf("Options:\n");
printf(" -e, --eval <code|file> Evaluate code or run a file directly\n");
printf(" -p, --print-bytecode <code|file> Compile and print bytecode\n");
printf(" -s, --serializers <code|file> Run with json/nota/wota in env\n");
printf(" --ast <code|file> Output AST as JSON\n");
printf(" --tokenize <code|file> Output token array as JSON\n");
printf(" --mcode <code|file> Output MCODE IR as JSON\n");
printf(" --run-mcode <code|file> Compile and run through MCODE interpreter\n");
printf(" --mach <code|file> Output MACH bytecode\n");
printf(" --mach-run <code|file> Compile and run through MACH VM\n");
printf(" --test [heap_size] Run C test suite\n");
printf(" -h, --help Show this help message\n");
printf("\nRecompile after changes: make\n");
printf("Bootstrap from scratch: make bootstrap\n");
}
int cell_init(int argc, char **argv)
{
/* Check for --help flag */
if (argc >= 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)) {
print_usage(argv[0]);
return 0;
}
/* Check for --test flag to run C test suite */
if (argc >= 2 && strcmp(argv[1], "--test") == 0) {
size_t heap_size = 64 * 1024; /* 64KB default */