grammar.ebnf: Fix ModuleKind grammar

This commit is contained in:
John 2024-02-26 16:19:21 -06:00
parent c36eec216a
commit 87c8d43d11

View File

@ -19,8 +19,8 @@ Const = "const" Identifier ':' Type = Expr ';' ;
Static = "static" Mutability Identifier ':' Type = Expr ';' ; Static = "static" Mutability Identifier ':' Type = Expr ';' ;
Module = "mod" Identifier '{' (Item)* '}' ; Module = "mod" Identifier ModuleKind ;
ModuleKind = (Item+)? ; ModuleKind = '{' Item* '}' | ';' ;
Function = "fn" Identifier '(' (Param ',')* Param? ')' ('->' Type)? Block? ; Function = "fn" Identifier '(' (Param ',')* Param? ')' ('->' Type)? Block? ;
Param = Mutability Identifier ':' Type ; Param = Mutability Identifier ':' Type ;