aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/oread
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-02-21 07:56:25 +0100
committerTristan Gingold <tgingold@free.fr>2016-03-08 06:25:52 +0100
commit77f983ae738583dfce7c3c3aaab5efde16519af0 (patch)
treed7f17de16b115bfc3ff52ad0f6b04e840800dae8 /src/ortho/oread
parenta7bb5f6944b410d2b02b1ae5aa9fdc10c68d7519 (diff)
downloadghdl-77f983ae738583dfce7c3c3aaab5efde16519af0.tar.gz
ghdl-77f983ae738583dfce7c3c3aaab5efde16519af0.tar.bz2
ghdl-77f983ae738583dfce7c3c3aaab5efde16519af0.zip
ortho: add new_default_value to initialize a variable.
Diffstat (limited to 'src/ortho/oread')
-rw-r--r--src/ortho/oread/ortho_front.adb12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ortho/oread/ortho_front.adb b/src/ortho/oread/ortho_front.adb
index 6ba026221..0ef96914e 100644
--- a/src/ortho/oread/ortho_front.adb
+++ b/src/ortho/oread/ortho_front.adb
@@ -1417,6 +1417,8 @@ package body Ortho_Front is
end;
when Tok_Null =>
Res := New_Null_Access (Atype.Type_Onode);
+ when Tok_Default =>
+ Res := New_Default_Value (Atype.Type_Onode);
when others =>
Parse_Error ("bad primary expression: " & Token_Type'Image (Tok));
return O_Cnode_Null;
@@ -2422,6 +2424,11 @@ package body Ortho_Front is
--return Parse_Primary_Expression (Atype);
return Parse_Typed_Literal (Atype);
when Type_Record =>
+ if Tok = Tok_Ident then
+ -- Default value ?
+ return Parse_Typed_Literal (Atype);
+ end if;
+
declare
Constr : O_Record_Aggr_List;
Field : Node_Acc;
@@ -2452,7 +2459,12 @@ package body Ortho_Front is
Next_Token;
return Res;
end;
+
when Type_Union =>
+ if Tok = Tok_Ident then
+ -- Default value ?
+ return Parse_Typed_Literal (Atype);
+ end if;
declare
Field : Node_Acc;
begin