From 002ec21cce78961fe5a74c8b51dae0dd55aa4457 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Thu, 5 Oct 2023 21:18:22 +0200 Subject: Added a new error message --- lib/expression_parser.messages | 28 ++++++++++++++++++++++++++++ lib/parser.mly | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/expression_parser.messages b/lib/expression_parser.messages index 2bdf477..c9ee7b0 100644 --- a/lib/expression_parser.messages +++ b/lib/expression_parser.messages @@ -322,3 +322,31 @@ main: LOCATION_START EOL IF IDENT COLUMN EOL ELSE STAR ## Unexpected operator after `ELSE` + +main: LOCATION_START EOL IDENT DECR INTEGER SET +## +## Ends in an error in state: 103. +## +## expression -> expression . EQUAL expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . LT GT expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . EXCLAMATION expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . PLUS expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . MINUS expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . STAR expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . DIV expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . MOD expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . GT expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . LT expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . AND expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . GT EQUAL expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . LT EQUAL expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . EQUAL GT expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . EQUAL LT expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## expression -> expression . OR expression [ STAR PLUS OR MOD MINUS LT GT EXCLAMATION EQUAL EOL ELSE DIV AND AMPERSAND ] +## let_assignation -> variable assignation_operator expression . [ EOL ELSE AMPERSAND ] +## +## The known suffix of the stack is as follows: +## variable assignation_operator expression +## + +Missing separator between instructions diff --git a/lib/parser.mly b/lib/parser.mly index 9b5297c..84c1af8 100644 --- a/lib/parser.mly +++ b/lib/parser.mly @@ -5,7 +5,7 @@ %parameter %start main -%on_error_reduce expression instruction binary_operator unary_operator +%on_error_reduce expression instruction unary_operator assignation_operator %% -- cgit v1.2.3