mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 11:51:49 +09:00
^C works now
This commit is contained in:
@@ -33,11 +33,11 @@ con.getyx = function() {
|
||||
};
|
||||
con.hitterminate = function() { // ^C
|
||||
sys.poke(-40, 1);
|
||||
return (sys.peek(-41) == 31 && (sys.peek(-41) == 129 || sys.peek(-41) == 130));
|
||||
return (sys.peek(-41) == 31 && (sys.peek(-42) == 129 || sys.peek(-42) == 130));
|
||||
};
|
||||
con.hiteof = function() { // ^D
|
||||
sys.poke(-40, 1);
|
||||
return (sys.peek(-41) == 32 && (sys.peek(-41) == 129 || sys.peek(-41) == 130));
|
||||
return (sys.peek(-41) == 32 && (sys.peek(-42) == 129 || sys.peek(-42) == 130));
|
||||
};
|
||||
con.color_fore = function(n) { // 0..7; -1 for transparent
|
||||
if (n < 0)
|
||||
|
||||
@@ -17,9 +17,9 @@ var cmdbufMemFootPrint = 0;
|
||||
var prompt = "Ok";
|
||||
|
||||
var lang = {};
|
||||
lang.badNumberFormat = "Bad number format";
|
||||
lang.badOperatorFormat = "Bad number format";
|
||||
lang.badFunctionCallFormat = "Bad function call format";
|
||||
lang.badNumberFormat = "Illegal number format";
|
||||
lang.badOperatorFormat = "Illegal number format";
|
||||
lang.badFunctionCallFormat = "Illegal function call";
|
||||
lang.unmatchedBrackets = "Unmatched brackets";
|
||||
lang.syntaxfehler = function(line, reason) {
|
||||
return "Syntax error" + ((line !== undefined) ? (" in "+line) : "") + (reason !== undefined) ? (": "+reason) : "";
|
||||
@@ -1170,9 +1170,6 @@ basicFunctions.fre = function(args) {
|
||||
basicFunctions.run = function(args) { // RUN function
|
||||
var linenumber = 1;
|
||||
var oldnum = 1;
|
||||
|
||||
var countup = 0;
|
||||
|
||||
do {
|
||||
if (cmdbuf[linenumber] !== undefined) {
|
||||
oldnum = linenumber;
|
||||
@@ -1181,8 +1178,7 @@ basicFunctions.run = function(args) { // RUN function
|
||||
else {
|
||||
linenumber += 1;
|
||||
}
|
||||
countup += 1;
|
||||
if (con.hitterminate() || countup >= 100) {
|
||||
if (con.hitterminate()) {
|
||||
println("Break in "+oldnum);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user