This commit is contained in:
2026-06-21 16:39:05 +10:00
parent b2f6883e62
commit c495b7c6fc
13 changed files with 109 additions and 101 deletions

View File

@@ -30,7 +30,7 @@ Args parseArgs(int argc, char** argv) {
args.action = ARGS_DEBUG;
} else if (strcmp(arg, "-a") == 0 || strcmp(arg, "--assemble") == 0) {
args.action = ARGS_ASSEMBLE;
if (i + i < argc) {
if (i + 1 < argc) {
i++;
args.outputFile = argv[i];
}
@@ -50,13 +50,13 @@ Args parseArgs(int argc, char** argv) {
int main(int argc, char** argv) {
Args args = parseArgs(argc, argv);
if (args.inputFile == NULL) {
fprintf(stderr, "Please specify a bytecode file\n");
return 1;
}
switch (args.action) {
case ARGS_EXECUTE: {
if (args.inputFile == NULL) {
fprintf(stderr, "Please specify a bytecode file\n");
return 1;
}
GroundBytecode bc = Ground.Bytecode.load(args.inputFile);
if (Ground.Flags.error) {
fprintf(stderr, "Failed to load bytecode, printing errors...\n");