mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 15:04:03 +09:00
basic: still broken but we're getting there
This commit is contained in:
@@ -247,12 +247,12 @@ bF._parseStmt = function(lnum, tokens, states, recDepth) {
|
||||
}
|
||||
catch (e) {
|
||||
bF.parserPrintdbgline('$', 'Error!', lnum, recDepth);
|
||||
throw new ParserError("Statement cannot be parsed: "+e.stack);
|
||||
throw new ParserError("Statement cannot be parsed in "+lnum+": "+e.stack);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
throw new ParserError("Statement cannot be parsed");
|
||||
throw new ParserError("Statement cannot be parsed in "+lnum);
|
||||
} // END of STMT
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ bF._parseExpr = function(lnum, tokens, states, recDepth, ifMode) {
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
throw new ParserError("Expression cannot be parsed");
|
||||
throw new ParserError("Expression cannot be parsed in "+lnum);
|
||||
} // END of EXPR
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ linenumber = digits ;
|
||||
|
||||
stmt =
|
||||
"IF" , expr_sans_asgn , "THEN" , stmt , ["ELSE" , stmt]
|
||||
| "FOR" , expr // TODO
|
||||
| "DEFUN" , [ident] , "(" , [ident , {" , " , ident}] , ")" , "=" , expr
|
||||
| "ON" , expr_sans_asgn , ("GOTO" | "GOSUB") , expr_sans_asgn , {"," , expr_sans_asgn}
|
||||
| "(" , stmt , ")"
|
||||
@@ -69,6 +70,9 @@ IF (type: function, value: IF)
|
||||
2. true
|
||||
[3. false]
|
||||
|
||||
FOR (type: function, value: FOR)
|
||||
1. expr (normally (=) but not necessarily)
|
||||
|
||||
DEFUN (type: function, value: DEFUN)
|
||||
1. funcname
|
||||
1. arg0
|
||||
|
||||
Reference in New Issue
Block a user