aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-03-13 19:52:46 +0100
committerTristan Gingold <tgingold@free.fr>2019-03-14 07:14:44 +0100
commitb4e20d8af1e23ab124a2f42d7eb56e86aa7850aa (patch)
tree1a7b9c67b4bb200011ef7bbe308def3384511849 /src/vhdl
parentbdf042b5b55d695f5a312bb09699503c5519858f (diff)
downloadghdl-b4e20d8af1e23ab124a2f42d7eb56e86aa7850aa.tar.gz
ghdl-b4e20d8af1e23ab124a2f42d7eb56e86aa7850aa.tar.bz2
ghdl-b4e20d8af1e23ab124a2f42d7eb56e86aa7850aa.zip
vhdl: handle names starting with '_' as an identifier.
Remove assertion. Fix #779
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/scanner.adb5
-rw-r--r--src/vhdl/sem.adb4
2 files changed, 4 insertions, 5 deletions
diff --git a/src/vhdl/scanner.adb b/src/vhdl/scanner.adb
index c24706ec1..c8e5a9765 100644
--- a/src/vhdl/scanner.adb
+++ b/src/vhdl/scanner.adb
@@ -2277,8 +2277,9 @@ package body Scanner is
end if;
when '_' =>
Error_Msg_Scan ("an identifier can't start with '_'");
- Pos := Pos + 1;
- goto Again;
+ Scan_Identifier (Flag_Psl);
+ -- Cannot be a reserved word.
+ return;
when 'A' .. 'Z' | 'a' .. 'z' =>
Scan_Identifier (Flag_Psl);
Identifier_To_Token;
diff --git a/src/vhdl/sem.adb b/src/vhdl/sem.adb
index 89babd3fc..7cecd3d6b 100644
--- a/src/vhdl/sem.adb
+++ b/src/vhdl/sem.adb
@@ -3281,6 +3281,7 @@ package body Sem is
-- Analyze the library unit.
if Library_Unit /= Null_Iir then
+ -- Can be null_iir in case of parse error.
case Iir_Kinds_Library_Unit (Get_Kind (Library_Unit)) is
when Iir_Kind_Entity_Declaration =>
Sem_Entity_Declaration (Library_Unit);
@@ -3297,9 +3298,6 @@ package body Sem is
when Iir_Kind_Context_Declaration =>
Sem_Context_Declaration (Library_Unit);
end case;
- else
- pragma Assert (Flags.Flag_Force_Analysis);
- null;
end if;
Close_Declarative_Region;