aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-01-05 20:49:57 +0100
committerTristan Gingold <tgingold@free.fr>2019-01-05 20:49:57 +0100
commit6daac6c7f86fa911bf230fe69419c540d9609c71 (patch)
tree8103b0cef15fece763557cf2109a2b4d2cf30aa3
parentc1c643002ab4067c7dae9a37803743eb99c25573 (diff)
downloadghdl-6daac6c7f86fa911bf230fe69419c540d9609c71.tar.gz
ghdl-6daac6c7f86fa911bf230fe69419c540d9609c71.tar.bz2
ghdl-6daac6c7f86fa911bf230fe69419c540d9609c71.zip
parse_physical_type_definition: check secondary unit definition.
-rw-r--r--src/vhdl/parse.adb16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb
index cacaff1df..874a5ae2d 100644
--- a/src/vhdl/parse.adb
+++ b/src/vhdl/parse.adb
@@ -2430,9 +2430,21 @@ package body Parse is
-- Skip '='.
Expect_Scan (Tok_Equal);
- Multiplier := Parse_Primary;
- Set_Physical_Literal (Unit, Multiplier);
+ case Current_Token is
+ when Tok_Integer
+ | Tok_Identifier
+ | Tok_Real =>
+ Multiplier := Parse_Primary;
+ when others =>
+ Error_Msg_Parse
+ ("physical literal expected to define a secondary unit");
+ Skip_Until_Semi_Colon;
+ Multiplier := Null_Iir;
+ end case;
+
if Multiplier /= Null_Iir then
+ Set_Physical_Literal (Unit, Multiplier);
+
case Get_Kind (Multiplier) is
when Iir_Kind_Simple_Name
| Iir_Kind_Selected_Name