mirror of
https://github.com/inexorabletash/jsbasic.git
synced 2024-11-27 12:49:56 +00:00
Report compile/runtime errors to TTY in script usage
This commit is contained in:
parent
4b6d9c7e2c
commit
9ab4cef8e1
11
script.js
11
script.js
@ -91,11 +91,11 @@
|
||||
program = basic.compile(src);
|
||||
} catch (e) {
|
||||
if (e instanceof basic.ParseError) {
|
||||
// TODO: Print error to display
|
||||
console.log(e.message +
|
||||
' (source line:' + e.line + ', column:' + e.column + ')');
|
||||
tty.writeString(e.message + '\r');
|
||||
tty.writeString('Source line: ' + e.line + ', column: ' + e.column);
|
||||
} else {
|
||||
tty.writeString(e.message);
|
||||
}
|
||||
alert(e);
|
||||
return frame;
|
||||
}
|
||||
|
||||
@ -120,8 +120,7 @@
|
||||
try {
|
||||
state = program.step(driver);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
alert(e.message ? e.message : e);
|
||||
tty.writeString(e.message);
|
||||
stopped = true;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user