File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919/* ---- Top-level ---- */
2020
21- statements ::= ( def | try | if | while | class | for
22- | switch | return | break | continue
21+ statements ::= ( def | try | if | while | class | enum
22+ | for | switch | return | break | continue
2323 | equation | block | eol )+
2424
2525/* ---- Functions ---- */
@@ -57,6 +57,17 @@ class ::= "class" id ( ":" id )? eol* class_block
5757class_block ::= " {" class_statements * " }"
5858class_statements ::= def | var_decl | eol
5959
60+ /* ---- Enums ---- */
61+
62+ enum ::= " enum" ( " class" | " struct" ) id ( " :" underlying_type )?
63+ " {" enum_entries ? " }"
64+
65+ enum_entries ::= enum_entry ( " ," enum_entry )*
66+
67+ enum_entry ::= id ( " =" integer )?
68+
69+ underlying_type ::= id
70+
6071/* ---- Blocks & flow keywords ---- */
6172
6273block ::= " {" statements * " }"
You can’t perform that action at this time.
0 commit comments