mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-11 15:24:05 +09:00
basic: syntax update
This commit is contained in:
@@ -2,30 +2,29 @@ line = linenumber , stmt , {":" , stmt} ;
|
|||||||
linenumber = digits ;
|
linenumber = digits ;
|
||||||
|
|
||||||
stmt =
|
stmt =
|
||||||
if_stmt //TODO
|
"IF" , if_conditional , "THEN" , stmt , ["ELSE" , stmt] ; //TODO
|
||||||
| "DEFUN" , [ident] , "(" , [ident , {" , " , ident}] , ")" , "=" , stmt
|
| "DEFUN" , [ident] , "(" , [ident , {" , " , ident}] , ")" , "=" , expr //TODO
|
||||||
| "ON" , if_equation , ident , if_equation , {"," , if_equation}
|
| "ON" , if_conditional , ident , if_conditional , {"," , if_conditional}
|
||||||
| "(" , stmt , ")"
|
| "(" , stmt , ")"
|
||||||
| function_call ;
|
| expr ;
|
||||||
|
|
||||||
if_stmt = "IF" , if_equation , "THEN" , stmt , ["ELSE" , stmt] ; //TODO
|
expr = // ALL TODO
|
||||||
|
"(" , expr , ")"
|
||||||
function_call =
|
|
||||||
if_stmt //TODO
|
|
||||||
| equation ;
|
|
||||||
| ident , "(" , [stmt , {argsep , stmt} , [argsep]] , ")"
|
|
||||||
| ident , stmt , {argsep , stmt} , [argsep]
|
|
||||||
|
|
||||||
equation =
|
|
||||||
lit
|
|
||||||
| "(" , equation , ")"
|
|
||||||
| function_call , op , function_call
|
| function_call , op , function_call
|
||||||
| op_uni , function_call ;
|
| op_uni , function_call
|
||||||
|
| function_call ; //TODO
|
||||||
|
|
||||||
if_equation = if_equation , op - ("=") , if_equation
|
function_call = // ALL TODO
|
||||||
| op_uni , if_equation
|
"IF" , if_conditional , "THEN" , expr , ["ELSE" , expr] ; //TODO
|
||||||
| lit
|
| lit
|
||||||
| "(" , if_equation , ")" ;
|
| ident , "(" , [expr , {argsep , expr} , [argsep]] , ")"
|
||||||
|
| ident , expr , {argsep , expr} , [argsep] ;
|
||||||
|
|
||||||
|
if_conditional =
|
||||||
|
"(" , if_conditional , ")"
|
||||||
|
| function_call , op - "=" , function_call
|
||||||
|
| op_uni , function_call
|
||||||
|
| function_call ; //TODO
|
||||||
|
|
||||||
(* don't bother looking at these, because you already know the stuff *)
|
(* don't bother looking at these, because you already know the stuff *)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user