basic: new parser works with correctly entered IF, DEFUN and function_calls

This commit is contained in:
minjaesong
2020-12-11 17:45:56 +09:00
parent 833a8df07b
commit 78b3a69b6d
3 changed files with 82 additions and 10 deletions

View File

@@ -4,7 +4,7 @@ linenumber = digits ;
stmt =
"IF" , if_equation , "THEN" , stmt , ["ELSE" , stmt]
| "DEFUN" , [ident] , "(" , [ident , {" , " , ident}] , ")" , "=" , stmt
| "ON" , ident , ident , equation , {"," , equation}
| "ON" , if_equation , ident , if_equation , {"," , if_equation}
| "(" , stmt , ")"
| function_call ;
@@ -61,7 +61,6 @@ bindigit = "0" | "1" ;
(* all possible token states: lit num op bool qot paren sep *)
IF (type: function, value: IF)
1. cond
2. true