diff options
Diffstat (limited to 'ortho')
-rw-r--r-- | ortho/debug/ortho_debug-disp.adb | 9 | ||||
-rw-r--r-- | ortho/oread/ortho_front.adb | 31 |
2 files changed, 24 insertions, 16 deletions
diff --git a/ortho/debug/ortho_debug-disp.adb b/ortho/debug/ortho_debug-disp.adb index ebaf3e9..010f0f1 100644 --- a/ortho/debug/ortho_debug-disp.adb +++ b/ortho/debug/ortho_debug-disp.adb @@ -938,8 +938,8 @@ package body Ortho_Debug.Disp is begin Rem_Tab; Choice := Stmt.Choice_List; - while Choice /= null loop - Put ("when "); + Put ("when "); + loop case Choice.Kind is when ON_Choice_Expr => Disp_Cnode (Choice.Expr, Choice_Type); @@ -950,9 +950,12 @@ package body Ortho_Debug.Disp is when ON_Choice_Default => Put ("default"); end case; - Put_Line (" =>"); Choice := Choice.Next; + exit when Choice = null; + Put_Line (","); + Put (" "); end loop; + Put_Line (" =>"); Add_Tab; end; when ON_Call_Stmt => diff --git a/ortho/oread/ortho_front.adb b/ortho/oread/ortho_front.adb index cea43cd..e29dfeb 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); |