aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-15 22:08:25 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-15 22:09:24 +0200
commit80c4f065d529ea257dd6e364c8a97a1c649e0bcc (patch)
treed2f88da965aff47ca42b752dbabb631b41f0fd02
parentaea192b38e1ef5575f7ee8149e5fa4b7e41f34a1 (diff)
downloadghdl-80c4f065d529ea257dd6e364c8a97a1c649e0bcc.tar.gz
ghdl-80c4f065d529ea257dd6e364c8a97a1c649e0bcc.tar.bz2
ghdl-80c4f065d529ea257dd6e364c8a97a1c649e0bcc.zip
vpi_handle_by_name: handle extended identifiers. Fix #1228
-rw-r--r--src/grt/grt-vpi.adb13
1 files changed, 12 insertions, 1 deletions
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;