mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
basic: all but 'dotest.bas' and 'blackjack.bas (as always)' are working
This commit is contained in:
@@ -1612,7 +1612,9 @@ bF._recurseApplyAST = function(tree, action) {
|
||||
(* { word } = word is repeated 0 or more times *)
|
||||
(* [ word ] = word is optional (repeated 0 or 1 times) *)
|
||||
|
||||
line = linenumber , stmt , {":" , stmt} ;
|
||||
line =
|
||||
linenumber , stmt , {":" , stmt}
|
||||
| linenumber , "REM" , ? basically anything ? ;
|
||||
linenumber = digits ;
|
||||
|
||||
stmt =
|
||||
@@ -1731,6 +1733,7 @@ bF._parseTokens = function(lnum, tokens, states) {
|
||||
bF.parserPrintdbg2('Line ', lnum, tokens, states, 0);
|
||||
|
||||
if (tokens.length !== states.length) throw lang.syntaxfehler(lnum);
|
||||
if (tokens[0] == "REM" && states[0] != "qot") return;
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
@@ -2703,9 +2706,15 @@ bF.run = function(args) { // RUN function
|
||||
oldnum = linenumber;
|
||||
|
||||
let trees = programTrees[linenumber];
|
||||
trees.forEach((t,i) => {
|
||||
linenumber = bF._executeAndGet(linenumber, t);
|
||||
});
|
||||
|
||||
if (trees !== undefined) {
|
||||
trees.forEach((t,i) => {
|
||||
linenumber = bF._executeAndGet(linenumber, t);
|
||||
});
|
||||
}
|
||||
else {
|
||||
linenumber += 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
linenumber += 1;
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
20 FOR J = 1 TO 9
|
||||
30 PRINT I; "*"; J; "="; I * J
|
||||
40 NEXT
|
||||
50 INPUT "Press Enter Key..."; A
|
||||
50 INPUT "Press Enter Key..."
|
||||
60 NEXT
|
||||
@@ -27,6 +27,7 @@ bF._parseTokens = function(lnum, tokens, states) {
|
||||
bF.parserPrintdbg2('Line ', lnum, tokens, states, 0);
|
||||
|
||||
if (tokens.length !== states.length) throw lang.syntaxfehler(lnum);
|
||||
if (tokens[0].toUpperCase() == "REM" && states[0] != "qot") return;
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
(* { word } = word is repeated 0 or more times *)
|
||||
(* [ word ] = word is optional (repeated 0 or 1 times) *)
|
||||
|
||||
line = linenumber , stmt , {":" , stmt} ;
|
||||
line =
|
||||
linenumber , stmt , {":" , stmt}
|
||||
| linenumber , "REM" , ? basically anything ? ;
|
||||
linenumber = digits ;
|
||||
|
||||
stmt =
|
||||
|
||||
Reference in New Issue
Block a user