diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-02-01 03:39:21 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-02-01 03:39:21 +0100 |
commit | 933e75dc239b56645ec03350ab3d6cfad0903679 (patch) | |
tree | 5b757aa0da098c073ea00898132817d6b6974d6a /ortho/oread | |
parent | b0bb2f78b3722a2afe626bc748d8c54c0cb41fde (diff) | |
download | ghdl-933e75dc239b56645ec03350ab3d6cfad0903679.tar.gz ghdl-933e75dc239b56645ec03350ab3d6cfad0903679.tar.bz2 ghdl-933e75dc239b56645ec03350ab3d6cfad0903679.zip |
ortho debug/oread: remove syntax ambiguity for multiple case choices.
Diffstat (limited to 'ortho/oread')
-rw-r--r-- | ortho/oread/ortho_front.adb | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/ortho/oread/ortho_front.adb b/ortho/oread/ortho_front.adb index cea43cdd1..e29dfeb08 100644 --- a/ortho/oread/ortho_front.adb +++ b/ortho/oread/ortho_front.adb @@ -2020,24 +2020,29 @@ package body Ortho_Front is loop exit when Tok = Tok_End; Expect (Tok_When); - Start_Choice (Case_Blk); Next_Token; - if Tok = Tok_Default then - New_Default_Choice (Case_Blk); - Next_Token; - else - L := Parse_Typed_Literal (Choice_Type); - if Tok = Tok_Elipsis then + Start_Choice (Case_Blk); + loop + if Tok = Tok_Default then + New_Default_Choice (Case_Blk); Next_Token; - New_Range_Choice - (Case_Blk, L, Parse_Typed_Literal (Choice_Type)); else - New_Expr_Choice (Case_Blk, L); + L := Parse_Typed_Literal (Choice_Type); + if Tok = Tok_Elipsis then + Next_Token; + New_Range_Choice + (Case_Blk, L, Parse_Typed_Literal (Choice_Type)); + else + New_Expr_Choice (Case_Blk, L); + end if; end if; - end if; - Finish_Choice (Case_Blk); - Expect (Tok_Arrow); + exit when Tok = Tok_Arrow; + Expect (Tok_Comma); + Next_Token; + end loop; + -- Skip '=>'. Next_Token; + Finish_Choice (Case_Blk); Parse_Statements; end loop; Finish_Case_Stmt (Case_Blk); |