aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/simulate
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-01-18 20:44:01 +0100
committerTristan Gingold <tgingold@free.fr>2018-01-20 07:40:52 +0100
commit708f3f8cd68a19361fd1d9a3e6b5d548e313448e (patch)
tree35b589b7ed757396f9c7fc377b6c26e4b64bd211 /src/vhdl/simulate
parentab7f46db88ef03564436f1bf96339c9ed3452787 (diff)
downloadghdl-708f3f8cd68a19361fd1d9a3e6b5d548e313448e.tar.gz
ghdl-708f3f8cd68a19361fd1d9a3e6b5d548e313448e.tar.bz2
ghdl-708f3f8cd68a19361fd1d9a3e6b5d548e313448e.zip
simulate: remove use of Nam_Buffer.
Diffstat (limited to 'src/vhdl/simulate')
-rw-r--r--src/vhdl/simulate/simul-execution.adb56
1 files changed, 30 insertions, 26 deletions
diff --git a/src/vhdl/simulate/simul-execution.adb b/src/vhdl/simulate/simul-execution.adb
index 18cd20c3f..0958462a5 100644
--- a/src/vhdl/simulate/simul-execution.adb
+++ b/src/vhdl/simulate/simul-execution.adb
@@ -1330,32 +1330,36 @@ package body Simul.Execution is
if Is_Character (Id) then
Result := String_To_Iir_Value ((1 => Get_Character (Id)));
else
- Image (Id);
- if Nam_Buffer (1) = '\' then
- -- Reformat extended identifiers for to_image.
- pragma Assert (Nam_Buffer (Nam_Length) = '\');
- declare
- Npos : Natural;
- K : Natural;
- C : Character;
- begin
- Npos := 1;
- K := 2;
- while K < Nam_Length loop
- C := Nam_Buffer (K);
- Nam_Buffer (Npos) := C;
- Npos := Npos + 1;
- if C = '\' then
- K := K + 2;
- else
- K := K + 1;
- end if;
- end loop;
- Nam_Length := Npos - 1;
- end;
- end if;
- Result :=
- String_To_Iir_Value (Nam_Buffer (1 .. Nam_Length));
+ declare
+ Img : String := Image (Id);
+ begin
+ if Img (Img'First) = '\' then
+ -- Reformat extended identifiers for to_image.
+ pragma Assert (Img (Img'Last) = '\');
+ declare
+ Npos : Natural;
+ K : Natural;
+ C : Character;
+ begin
+ Npos := Img'First;
+ K := Npos + 1;
+ while K < Img'Last loop
+ C := Img (K);
+ Img (Npos) := C;
+ Npos := Npos + 1;
+ if C = '\' then
+ K := K + 2;
+ else
+ K := K + 1;
+ end if;
+ end loop;
+ Result := String_To_Iir_Value
+ (Img (Img'First .. Npos - 1));
+ end;
+ else
+ Result := String_To_Iir_Value (Img);
+ end if;
+ end;
end if;
end if;
end;