From 933e75dc239b56645ec03350ab3d6cfad0903679 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 1 Feb 2014 03:39:21 +0100 Subject: ortho debug/oread: remove syntax ambiguity for multiple case choices. --- ortho/oread/ortho_front.adb | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'ortho/oread') 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); -- cgit v1.2.3