basic: parser fixing bug with multi-args function call

This commit is contained in:
minjaesong
2020-12-14 14:03:41 +09:00
parent f1365ed34c
commit 8d733d7ecd
3 changed files with 35 additions and 31 deletions

View File

@@ -10,7 +10,7 @@ stmt =
| "DEFUN" , [ident] , "(" , [ident , {" , " , ident}] , ")" , "=" , expr
| "ON" , expr_sans_asgn , ("GOTO" | "GOSUB") , expr_sans_asgn , {"," , expr_sans_asgn}
| "(" , stmt , ")"
| expr ; (* if the statement contains only one word, treat it as function_call e.g. NEXT for FOR loop *)
| expr ; (* if the statement is 'lit' and contains only one word, treat it as function_call e.g. NEXT for FOR loop *)
expr = (* this basically blocks some funny attemps such as using DEFUN as anon function because everything is global in BASIC *)
lit