fix some specs and add for parse

This commit is contained in:
2025-11-10 02:30:48 +09:00
parent 91f90419e1
commit 62b7024734
4 changed files with 15 additions and 8 deletions

View File

@@ -26,10 +26,13 @@
```
program := defn*
defn := VAL type ID ;
| VAL type ID expr ;
expr := atom atom* ;
type := ID | [] | [type] | [ type* ARROW type? ]
expr := atom atom*
atom := ID
| NUM
@@ -40,10 +43,9 @@ atom := ID
| dereference
stmt := defn
| expr
stmt := defn | st
| expr ; // expr statement
| return expr ; // return statement
| $ ID expr ; // assignment statement
| if expr compound ; // if statement
| if expr compound else compound ; // if-else statement
```