From db9290e7b92232440a93179c779cad4edeff9719 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 21 Dec 2022 20:56:15 +0100 Subject: vhdl-parse: handle 'end for' in configuration specification. Fix #2277 --- src/vhdl/vhdl-parse.adb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/vhdl/vhdl-parse.adb') diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb index 044f74e79..b61e6ab49 100644 --- a/src/vhdl/vhdl-parse.adb +++ b/src/vhdl/vhdl-parse.adb @@ -4614,6 +4614,15 @@ package body Vhdl.Parse is -- [ LRM93 5.2 ] -- configuration_specification ::= -- FOR component_specification binding_indication ; + -- + -- [ LRM08 7.3 Configuration specification ] + -- configuration_specification ::= + -- simple_configuration_specification + -- | compound_configuration_specification + -- + -- simple_configuration_specification ::= + -- FOR component_specification binding_indication ; + -- [ END FOR ; ] function Parse_Configuration_Specification return Iir_Configuration_Specification is @@ -4631,6 +4640,20 @@ package body Vhdl.Parse is -- Skip ';'. Scan_Semi_Colon_Declaration ("configuration specification"); + if Current_Token = Tok_End then + Check_Vhdl_At_Least_2008 ("'end for'"); + Set_Has_End (Res, True); + + -- Skip 'end'. + Scan; + + -- Skip 'for'. + Expect_Scan (Tok_For, "'for' expected after 'end'"); + + -- Skip ';'. + Scan_Semi_Colon ("';' expected after 'end for'"); + end if; + return Res; end Parse_Configuration_Specification; -- cgit v1.2.3