basic: all but 'dotest.bas' and 'blackjack.bas (as always)' are working

This commit is contained in:
minjaesong
2020-12-14 19:59:00 +09:00
parent 186340d704
commit c18c14e760
4 changed files with 18 additions and 6 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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;
/*************************************************************************/

View File

@@ -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 =