summaryrefslogtreecommitdiff
path: root/chapter14
diff options
context:
space:
mode:
Diffstat (limited to 'chapter14')
-rw-r--r--chapter14/docs/14-grammar.md11
1 files changed, 6 insertions, 5 deletions
diff --git a/chapter14/docs/14-grammar.md b/chapter14/docs/14-grammar.md
index 4534684d..d7b11d24 100644
--- a/chapter14/docs/14-grammar.md
+++ b/chapter14/docs/14-grammar.md
@@ -20,7 +20,7 @@ statement
| metaStatement
;
-type
+PRIMTYPE
: 'int'
| 'i8'
| 'i16'
@@ -34,9 +34,10 @@ type
| 'f64'
| 'bool'
;
-
+
field
- : type IDENTIFIER ';'
+ : PRIMTYPE IDENTIFIER ';'
+ | structName IDENTIFIER ('?')? ';'
;
fields
@@ -81,7 +82,7 @@ structName
;
declStatement
- : type IDENTIFIER '=' expression ';'
+ : PRIMTYPE IDENTIFIER '=' expression ';'
| structName IDENTIFIER ('?')? '=' expression ';'
;
@@ -110,7 +111,7 @@ additiveExpression
;
multiplicativeExpression
- : unaryExpression (('*' | '|') unaryExpression)*
+ : unaryExpression (('*' | '/') unaryExpression)*
;
unaryExpression