aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap2.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-05-11 06:32:48 +0200
committerTristan Gingold <tgingold@free.fr>2017-05-11 06:32:48 +0200
commit6714b56ddc9c5011bf404102e57c702e003a561b (patch)
treece5ee8281a770aca94f4f7dcd476d70187ffe947 /src/vhdl/translate/trans-chap2.adb
parent1d71308e25694056dc9280ec06e7e1f3e15c3a06 (diff)
downloadghdl-6714b56ddc9c5011bf404102e57c702e003a561b.tar.gz
ghdl-6714b56ddc9c5011bf404102e57c702e003a561b.tar.bz2
ghdl-6714b56ddc9c5011bf404102e57c702e003a561b.zip
vhdl2008: allow nested packages in uninstantiated package
For #317
Diffstat (limited to 'src/vhdl/translate/trans-chap2.adb')
-rw-r--r--src/vhdl/translate/trans-chap2.adb28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb
index 4b9d1b560..8b73c0e39 100644
--- a/src/vhdl/translate/trans-chap2.adb
+++ b/src/vhdl/translate/trans-chap2.adb
@@ -807,7 +807,8 @@ package body Trans.Chap2 is
Info.Package_Body_Scope'Access);
end if;
- -- Each subprogram has a body instance argument.
+ -- Each subprogram has a body instance argument (because subprogram
+ -- bodys can access to body declarations).
Subprgs.Push_Subprg_Instance
(Info.Package_Body_Scope'Access, Info.Package_Body_Ptr_Type,
Wki_Instance, Prev_Subprg_Instance);
@@ -1239,6 +1240,31 @@ package body Trans.Chap2 is
Package_Instance_Spec_Scope => Src.Package_Instance_Spec_Scope,
Package_Instance_Body_Scope => Src.Package_Instance_Body_Scope);
+ when Kind_Field =>
+ Dest.all := (Kind => Kind_Field,
+ Field_Node => Src.Field_Node,
+ Field_Bound => Src.Field_Bound);
+
+ when Kind_Package =>
+ Dest.all :=
+ (Kind => Kind_Package,
+ Package_Elab_Spec_Subprg => Src.Package_Elab_Spec_Subprg,
+ Package_Elab_Body_Subprg => Src.Package_Elab_Body_Subprg,
+ Package_Elab_Spec_Instance =>
+ Instantiate_Subprg_Instance (Src.Package_Elab_Spec_Instance),
+ Package_Elab_Body_Instance =>
+ Instantiate_Subprg_Instance (Src.Package_Elab_Body_Instance),
+ Package_Elab_Var => Instantiate_Var (Src.Package_Elab_Var),
+ Package_Rti_Const => Src.Package_Rti_Const,
+ Package_Spec_Scope =>
+ Instantiate_Var_Scope (Src.Package_Spec_Scope),
+ Package_Spec_Ptr_Type => Src.Package_Spec_Ptr_Type,
+ Package_Body_Scope =>
+ Instantiate_Var_Scope (Src.Package_Body_Scope),
+ Package_Body_Ptr_Type => Src.Package_Body_Ptr_Type,
+ Package_Spec_Field => Src.Package_Spec_Field,
+ Package_Local_Id => Src.Package_Local_Id);
+
when others =>
raise Internal_Error;
end case;