optimise
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user