minor changes for lex spec

This commit is contained in:
2025-11-04 13:43:56 +09:00
parent bbc1838b8a
commit 51773b4906
2 changed files with 13 additions and 2 deletions

View File

@@ -6,6 +6,8 @@
* RBRACK `]`
* LCURLY `{`
* RCURLY `}`
* LPAREN `(`
* RPAREN `)`
* ID `[all]`
* SEMI `;`
* COMMA `,`
@@ -16,4 +18,13 @@
* RETURN `return`
* IF `if`
* ELSE `else`
* STRING `"{any}"`
* STRING `"{any}"`
## Syntax Spec
```
decl := val typespec id stmt ;
typespec := id | [id* -> id?]
stmt :=
```

View File

@@ -1,6 +1,6 @@
val int s 3; # global
val [int->int] fib int n {
val [int->int] fib (int n) {
return if == n 0 {
1
} else {