From 04867afa5d47443fcae1ab24bb648cca2244e671 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 16 Nov 2018 20:25:48 +0100 Subject: parse: strenghten --- src/vhdl/parse.adb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index 04db4c777..5b2dcea9d 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -793,28 +793,43 @@ package body Parse is Prefix := String_To_Operator_Symbol (Prefix); end if; + -- Skip '.'. Scan; + case Current_Token is when Tok_All => Res := Create_Iir (Iir_Kind_Selected_By_All_Name); Set_Location (Res); Set_Prefix (Res, Prefix); + + -- Skip 'all'. + Scan; + when Tok_Identifier | Tok_Character => Res := Create_Iir (Iir_Kind_Selected_Name); Set_Location (Res); Set_Prefix (Res, Prefix); Set_Identifier (Res, Current_Identifier); + + -- Skip identifier/character. + Scan; + when Tok_String => Res := Create_Iir (Iir_Kind_Selected_Name); Set_Location (Res); Set_Prefix (Res, Prefix); Set_Identifier (Res, Scan_To_Operator_Name (Get_Token_Location)); + + -- Skip string. + Scan; + when others => - Error_Msg_Parse ("an identifier or all is expected"); + Error_Msg_Parse + ("identifier or all is expected after '.'"); end case; - Scan; + when others => if not Allow_Signature and then Get_Kind (Res) = Iir_Kind_Signature -- cgit v1.2.3