diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-10-24 19:17:59 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-10-24 19:17:59 +0200 |
commit | 782ae0cb5931974eca5b6ce7fa777560e7e91527 (patch) | |
tree | 9bca5389d55ed1a6616f4132093016946a48e5c3 /src/vhdl | |
parent | 0aba06b92bf72e6870ee690a26eca485c2e74714 (diff) | |
download | ghdl-782ae0cb5931974eca5b6ce7fa777560e7e91527.tar.gz ghdl-782ae0cb5931974eca5b6ce7fa777560e7e91527.tar.bz2 ghdl-782ae0cb5931974eca5b6ce7fa777560e7e91527.zip |
parser: improve error on extra comma in interface list.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/parse.adb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index b842bd008..01bd61f60 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -7064,6 +7064,7 @@ package body Parse is Actual: Iir; Nbr_Assocs : Natural; Loc : Location_Type; + Comma_Loc : Location_Type; begin Sub_Chain_Init (Res, Last); @@ -7083,8 +7084,7 @@ package body Parse is case Current_Token is when Tok_To | Tok_Downto => - -- To/downto can appear in slice name (which are parsed as - -- function call). + -- To/downto can appear in slice name. if Actual = Null_Iir then -- Left expression is missing ie: (downto x). @@ -7129,8 +7129,17 @@ package body Parse is Sub_Chain_Append (Res, Last, El); exit when Current_Token = Tok_Right_Paren; + + -- Eat ','. + Comma_Loc := Get_Token_Location; Expect (Tok_Comma); Scan; + + if Current_Token = Tok_Right_Paren then + Error_Msg_Parse (Comma_Loc, "extra ',' ignored"); + exit; + end if; + Nbr_Assocs := Nbr_Assocs + 1; end loop; |