mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-16 09:24:05 +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 repeated 0 or more times *)
|
||||||
(* [ word ] = word is optional (repeated 0 or 1 times) *)
|
(* [ word ] = word is optional (repeated 0 or 1 times) *)
|
||||||
|
|
||||||
line = linenumber , stmt , {":" , stmt} ;
|
line =
|
||||||
|
linenumber , stmt , {":" , stmt}
|
||||||
|
| linenumber , "REM" , ? basically anything ? ;
|
||||||
linenumber = digits ;
|
linenumber = digits ;
|
||||||
|
|
||||||
stmt =
|
stmt =
|
||||||
@@ -1731,6 +1733,7 @@ bF._parseTokens = function(lnum, tokens, states) {
|
|||||||
bF.parserPrintdbg2('Line ', lnum, tokens, states, 0);
|
bF.parserPrintdbg2('Line ', lnum, tokens, states, 0);
|
||||||
|
|
||||||
if (tokens.length !== states.length) throw lang.syntaxfehler(lnum);
|
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;
|
oldnum = linenumber;
|
||||||
|
|
||||||
let trees = programTrees[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 {
|
else {
|
||||||
linenumber += 1;
|
linenumber += 1;
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
20 FOR J = 1 TO 9
|
20 FOR J = 1 TO 9
|
||||||
30 PRINT I; "*"; J; "="; I * J
|
30 PRINT I; "*"; J; "="; I * J
|
||||||
40 NEXT
|
40 NEXT
|
||||||
50 INPUT "Press Enter Key..."; A
|
50 INPUT "Press Enter Key..."
|
||||||
60 NEXT
|
60 NEXT
|
||||||
@@ -27,6 +27,7 @@ bF._parseTokens = function(lnum, tokens, states) {
|
|||||||
bF.parserPrintdbg2('Line ', lnum, tokens, states, 0);
|
bF.parserPrintdbg2('Line ', lnum, tokens, states, 0);
|
||||||
|
|
||||||
if (tokens.length !== states.length) throw lang.syntaxfehler(lnum);
|
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 repeated 0 or more times *)
|
||||||
(* [ word ] = word is optional (repeated 0 or 1 times) *)
|
(* [ word ] = word is optional (repeated 0 or 1 times) *)
|
||||||
|
|
||||||
line = linenumber , stmt , {":" , stmt} ;
|
line =
|
||||||
|
linenumber , stmt , {":" , stmt}
|
||||||
|
| linenumber , "REM" , ? basically anything ? ;
|
||||||
linenumber = digits ;
|
linenumber = digits ;
|
||||||
|
|
||||||
stmt =
|
stmt =
|
||||||
|
|||||||
Reference in New Issue
Block a user