diff --git a/doc/modules/language-guide/examples/grammar.txt b/doc/modules/language-guide/examples/grammar.txt index decdf7fc77c..094858072e0 100644 --- a/doc/modules/language-guide/examples/grammar.txt +++ b/doc/modules/language-guide/examples/grammar.txt @@ -298,8 +298,7 @@ ::= - 'import' ? '='? - 'import' '{' , ';')> '}' '=' + 'import' '='? ::= , ';')> , ';')> diff --git a/src/mo_frontend/parser.mly b/src/mo_frontend/parser.mly index 1dc6d55c3b7..cb236f626ad 100644 --- a/src/mo_frontend/parser.mly +++ b/src/mo_frontend/parser.mly @@ -871,11 +871,8 @@ class_body : (* Programs *) imp : - | IMPORT xf=id_opt EQ? f=TEXT - { let _, x = xf "import" $sloc in - let_or_exp true x (ImportE (f, ref Unresolved)) (at $sloc) } - | IMPORT LCURLY fps=seplist(pat_field, semicolon) RCURLY EQ f=TEXT - { LetD(ObjP(fps) @! at $sloc, ImportE (f, ref Unresolved) @? at $sloc) @? at $sloc } + | IMPORT p=pat_nullary EQ? f=TEXT + { LetD(p, ImportE(f, ref Unresolved) @? at $sloc) @? at $sloc } start : (* dummy non-terminal to satisfy ErrorReporting.ml, that requires a non-empty parse stack *) | (* empty *) { () }