fix some specs

This commit is contained in:
2025-11-06 01:33:52 +09:00
parent 51773b4906
commit 91f90419e1

View File

@@ -8,11 +8,13 @@
* RCURLY `}`
* LPAREN `(`
* RPAREN `)`
* ID `[all]`
* ID `[any]`
* SEMI `;`
* COMMA `,`
* ARROW `->`
* STAR `*`
* ANDREF `&`
* DOLLAR `$`
* COMMENT `#`
* NUM `[0-9]*(.[0-9]+)?`
* RETURN `return`
@@ -23,8 +25,25 @@
## Syntax Spec
```
decl := val typespec id stmt ;
typespec := id | [id* -> id?]
stmt :=
program := defn*
defn := VAL type ID ;
| VAL type ID expr ;
expr := atom atom* ;
atom := ID
| NUM
| STR
| lambda
| compound
| reference
| dereference
stmt := defn
| expr
stmt := defn | st
```