From 80c4f065d529ea257dd6e364c8a97a1c649e0bcc Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 15 Apr 2020 22:08:25 +0200 Subject: vpi_handle_by_name: handle extended identifiers. Fix #1228 --- src/grt/grt-vpi.adb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/grt') diff --git a/src/grt/grt-vpi.adb b/src/grt/grt-vpi.adb index d5cb85e91..ddb337f87 100644 --- a/src/grt/grt-vpi.adb +++ b/src/grt/grt-vpi.adb @@ -1559,6 +1559,7 @@ package body Grt.Vpi is Err : AvhpiErrorT; Prop : Integer; Res : vpiHandle; + Escaped : Boolean; begin -- Extract the start point. if Scope = null then @@ -1578,9 +1579,19 @@ package body Grt.Vpi is C : Character; begin E := B; + Escaped := Name (E) = '\'; loop C := Name (E + 1); - exit when C = NUL or C = '.'; + + -- '.' is a separator when not inside extended identifiers. + exit when C = NUL or (C = '.' and not Escaped); + + if C = '\' then + -- Start or end of extended identifiers. + -- '\' within an extended identifier is doubled, so like + -- if there were two extended identifiers. + Escaped := not Escaped; + end if; E := E + 1; end loop; end; -- cgit v1.2.3