diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-05-11 07:43:44 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-05-11 18:13:37 +0200 |
commit | 36b54159513f10891fb206789f8d2d2c6f8e91fd (patch) | |
tree | 1a18961257a0f45cda329f3f08cc31457c1a9c09 /src/vhdl | |
parent | 1daff35f06880b69453a819a0ebc5c6f4adfcf19 (diff) | |
download | ghdl-36b54159513f10891fb206789f8d2d2c6f8e91fd.tar.gz ghdl-36b54159513f10891fb206789f8d2d2c6f8e91fd.tar.bz2 ghdl-36b54159513f10891fb206789f8d2d2c6f8e91fd.zip |
vhdl-parse: improve error messages. Fix #818
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/vhdl-parse.adb | 14 |
1 files changed, 14 insertions, 0 deletions
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); |