From 93355b06a8270f02d345bdbe7b6a8c1bea9789bb Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Thu, 28 Sep 2023 14:34:11 +0200 Subject: Reduced the number of error messages --- lib/parser.mly | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/parser.mly') diff --git a/lib/parser.mly b/lib/parser.mly index 353aaab..a0a45e6 100644 --- a/lib/parser.mly +++ b/lib/parser.mly @@ -5,19 +5,24 @@ %parameter %start main +%on_error_reduce expression instruction %% main: - | EOL* - LOCATION_START + | before_location* + LOCATION_START EOL+ expressions = line_statement* - LOCATION_END + LOCATION_END { Analyzer.Location.location $loc expressions } +before_location: + | EOL {} + | COMMENT EOL { } + (* All these statement should terminate with EOL *) line_statement: | COMMENT EOL+ { Analyzer.Instruction.comment $loc } -- cgit v1.2.3