Skip to content

Commit

Permalink
fix: Add enum syntax to grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
MikMuellerDev committed Apr 12, 2023
1 parent a52beb9 commit 727d671
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grammar.ebnf
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,16 @@ Atom = number
| 'null'
| identifier
| '(' , Expression , ')'
| EnumDefinition
| EnumVariant
| ExprWithBlock ;
ExprWithBlock = LoopExpr | WhileExpr | ForExpr | IfExpr | FnExpr | TryExpr | ObjExpr ;
EnumDefinition = 'enum' , '{' , identifier , { ',' , identifier } , [ ',' ] , '}' ;
EnumVariant = identifier , '::' , identifier ;
(*
A <ListLiteral> creates a value of type `List` given an arbitraty amount of <Expression>
Additionaly, the runtime should check that every element in the list is of the same type Lists can
Expand Down

0 comments on commit 727d671

Please sign in to comment.