aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOndrej Ille <ondrej.ille@gmail.com>2021-04-02 16:55:42 +0200
committertgingold <tgingold@users.noreply.github.com>2021-04-03 20:28:54 +0200
commita54112669f17ed9b4a041fc3fcd6548679c66708 (patch)
tree26c4e5443344808aaa0fa328141ea096d8a97a51 /src
parent42a3bac62c95221096996dfbbbeabb0474130042 (diff)
downloadghdl-a54112669f17ed9b4a041fc3fcd6548679c66708.tar.gz
ghdl-a54112669f17ed9b4a041fc3fcd6548679c66708.tar.bz2
ghdl-a54112669f17ed9b4a041fc3fcd6548679c66708.zip
src: Add Resync_To_End_Of_External_Name.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/vhdl-parse.adb22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb
index 844cee08d..6df41e2ba 100644
--- a/src/vhdl/vhdl-parse.adb
+++ b/src/vhdl/vhdl-parse.adb
@@ -449,6 +449,26 @@ package body Vhdl.Parse is
end loop;
end Resync_To_End_Of_Interface;
+ -- Search for next colon (likely before subtype_indication).
+ -- Others detect when we are totally lost. Semi-colon likely
+ -- at the end of line, Double_Greater at the end of external
+ -- name.
+ procedure Resync_To_End_Of_External_Name is
+ begin
+ loop
+ case Current_Token is
+ when Tok_Colon
+ | Tok_Semi_Colon
+ | Tok_Begin
+ | Tok_Eof
+ | Tok_Double_Greater =>
+ exit;
+ when others =>
+ Scan;
+ end case;
+ end loop;
+ end Resync_To_End_Of_External_Name;
+
procedure Error_Missing_Semi_Colon (Msg : String) is
begin
Error_Msg_Parse (Get_Prev_Location, "missing "";"" at end of " & Msg);
@@ -1324,7 +1344,7 @@ package body Vhdl.Parse is
loop
if Current_Token /= Tok_Identifier then
Error_Msg_Parse ("pathname element expected");
- -- FIXME: resync.
+ Resync_To_End_Of_External_Name;
return Res;
end if;