fix some specs and add for parse
This commit is contained in:
18
README.md
18
README.md
@@ -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
|
||||
```
|
||||
Reference in New Issue
Block a user