STOP detection injection for do-loop

This commit is contained in:
minjaesong
2021-04-23 22:37:57 +09:00
parent dbfda580a7
commit c4cccb63c3
2 changed files with 4 additions and 3 deletions

View File

@@ -3012,7 +3012,7 @@ if (exec_args !== undefined && exec_args[1] !== undefined) {
}
catch (e) {
serial.printerr(`${e}\n${e.stack || "Stack trace undefined"}`);
println(e);
println(`${e}`);
}
}
while (!tbasexit) {
@@ -3035,7 +3035,7 @@ while (!tbasexit) {
}
catch (e) {
serial.printerr(`${e}\n${e.stack || "Stack trace undefined"}`);
println(e);
println(`${e}`);
}
}
println(prompt);

View File

@@ -162,7 +162,8 @@ let injectIntChk = (s, n) => {
// primitive way of injecting a code; will replace a JS string that matches the regex...
let k = s
.replace(/while *\([^\n]+\) *{/, "$& "+n+"();")
.replace(/for *\([^\n]+\) *{/, "$& "+n+"();");
.replace(/for *\([^\n]+\) *{/, "$& "+n+"();")
.replace(/do *{/, "$& "+n+"();");
//serial.println(k);
return k;
}