assembler - Change error handling: Just quit, don't throw a JS error

This commit is contained in:
n loewen 2023-08-24 16:33:33 +01:00
parent 1bf2144a67
commit 2802623c4c
1 changed files with 3 additions and 6 deletions

View File

@ -110,8 +110,7 @@ function preparseSourceCode(source) {
console.error();
console.error(`Error: Too many arguments`);
console.error(` at line ${info.number}`);
console.error();
throw new Error("Too many arguments");
process.exit();
}
}
return info;
@ -240,8 +239,7 @@ function decodeInstructions(source) {
console.error('');
console.error(`Error: Missing operand ${line.source}`);
console.error(` at line ${line.number}`);
console.error('');
throw new Error("Missing operand");
process.exit();
} else {
// It *is* one of the special optional-arg ops
// So let's fill in the implicit operand with $00
@ -320,8 +318,7 @@ function decodeInstructions(source) {
console.error();
console.error(`Error: Undefined constant '${line.argument}'`);
console.error(` at line ${line.number}`);
console.error();
throw new Error('Undefined constant');
process.exit();
}
decodedArg = decodeNumericOp(constants[line.argument.substring(1)]); // substring(1) strips '>'
}