From 36b54159513f10891fb206789f8d2d2c6f8e91fd Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 11 May 2019 07:43:44 +0200 Subject: vhdl-parse: improve error messages. Fix #818 --- src/vhdl/vhdl-parse.adb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/vhdl') diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb index 9b7be9091..cc01dab20 100644 --- a/src/vhdl/vhdl-parse.adb +++ b/src/vhdl/vhdl-parse.adb @@ -5961,6 +5961,20 @@ package body Vhdl.Parse is Scan; Set_Operand (Res, Parse_Primary); + + -- Improve error message for expressions like '?? a and b'; in + -- particular it avoids cascaded errors. + case Current_Token is + when Token_Logical_Type + | Token_Relational_Operator_Type + | Token_Shift_Operator_Type + | Token_Adding_Operator_Type => + Error_Msg_Parse + ("'??' cannot be followed by a binary expression"); + Res := Parse_Binary_Expression (Res, Prio); + when others => + null; + end case; else Left := Parse_Unary_Expression; Res := Parse_Binary_Expression (Left, Prio); -- cgit v1.2.3