From c7869413c0ccd9b4b0d85397476458ad88c7e7af Mon Sep 17 00:00:00 2001 From: Itay Dafna Date: Fri, 5 Aug 2022 12:46:45 -0700 Subject: [PATCH] Work through error messages --- compiler/src/parsing/parser.messages | 18 ------------------ compiler/src/parsing/parser.mly | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/compiler/src/parsing/parser.messages b/compiler/src/parsing/parser.messages index e97e3ba6d0..2b204e6b35 100644 --- a/compiler/src/parsing/parser.messages +++ b/compiler/src/parsing/parser.messages @@ -2921,24 +2921,6 @@ program: IMPORT LBRACE WHILE Expected a list of comma-separated identifiers. -program: IMPORT LPAREN WHILE -## -## Ends in an error in state: 125. -## -## non_modid -> lparen . special_op rparen [ THICKARROW STAREQ STAR SLASHEQ SLASH SEMI RPAREN RCARET RBRACK RBRACE PLUSPLUS PLUSEQ PLUS PIPEPIPE PIPE PERCENTEQ PERCENT NOTEQ LPAREN LESSEQ LCARETLCARET LCARET LBRACK ISNT IS GREATEREQ GETS FROM EQUAL EQEQ EOL EOF ELSE DOT DASHEQ DASH COMMA COLON CARET AS AMPAMP AMP ] -## -## The known suffix of the stack is as follows: -## lparen -## -## WARNING: This example involves spurious reductions. -## This implies that, although the LR(1) items shown above provide an -## accurate view of the past (what has been recognized so far), they -## may provide an INCOMPLETE view of the future (what was expected next). -## In state 2, spurious reduction of production lparen -> LPAREN -## - -Expected an infix or prefix operator, e.g. `+`, `-`, `!`. - program: IMPORT STAR EXCEPT LBRACE WHILE ## ## Ends in an error in state: 850. diff --git a/compiler/src/parsing/parser.mly b/compiler/src/parsing/parser.mly index 9912017bf7..78a5bb79a1 100644 --- a/compiler/src/parsing/parser.mly +++ b/compiler/src/parsing/parser.mly @@ -319,7 +319,7 @@ import_ids: | lseparated_nonempty_list(comma, aliasable(id)) comma? {$1} import_shape: - | id { PImportModule $1 } + | type_id { PImportModule $1 } | STAR import_exception? { PImportAllExcept (Option.value ~default:[] $2) } | lbrace import_ids? rbrace { PImportValues (Option.value ~default:[] $2) }