@@ -2679,7 +2679,6 @@ let pp_axiom ?(long=false) (ppe : PPEnv.t) fmt (x, ax) =
26792679type ppnode1 = [
26802680 | `Asgn of (EcModules .lvalue * EcTypes .expr )
26812681 | `Raise of EcTypes .expr
2682- | `ERaise of (EcTypes .expr * EcTypes .expr )
26832682 | `Call of (EcModules .lvalue option * P .xpath * EcTypes .expr list )
26842683 | `Rnd of (EcModules .lvalue * EcTypes .expr )
26852684 | `Abstract of EcIdent .t
@@ -2708,10 +2707,6 @@ let at (ppe : PPEnv.t) n i =
27082707 | Swhile (e , s ), 0 -> Some (`While e, `P , s.s_node)
27092708 | Swhile _ , 1 -> Some (`EBlk , `B , [] )
27102709
2711- | Sif (e , {s_node =[{i_node= Sraise p}]} , {s_node = [] } ), 0 ->
2712- Some (`ERaise (p,e), `P , [] )
2713- | Sif (_ , {s_node =[{i_node= Sraise _}]} , {s_node = [] } ), 1 ->
2714- None
27152710 | Sif (e , s , _ ), 0 -> Some (`If e, `P , s.s_node)
27162711 | Sif (_ , _ , s ), 1 -> begin
27172712 match s.s_node with
@@ -2804,10 +2799,6 @@ let pp_i_asgn (ppe : PPEnv.t) fmt (lv, e) =
28042799let pp_i_raise (ppe : PPEnv.t ) fmt (e : expr ) =
28052800 Format. fprintf fmt " raise %a" (pp_expr ppe) e
28062801
2807- let pp_i_eraise (ppe : PPEnv.t ) fmt (p ,e ) =
2808- Format. fprintf fmt " ensure %a -> %a"
2809- (pp_expr ppe) (add_not e) (pp_expr ppe) p
2810-
28112802let pp_i_call (ppe : PPEnv.t ) fmt (lv , xp , args ) =
28122803 match lv with
28132804 | None ->
@@ -2854,7 +2845,6 @@ let c_ppnode1 ~width ppe (pp1 : ppnode1) =
28542845 match pp1 with
28552846 | `Asgn x -> c_split ~width (pp_i_asgn ppe) x
28562847 | `Raise x -> c_split ~width (pp_i_raise ppe) x
2857- | `ERaise x -> c_split ~width (pp_i_eraise ppe) x
28582848 | `Call x -> c_split ~width (pp_i_call ppe) x
28592849 | `Rnd x -> c_split ~width (pp_i_rnd ppe) x
28602850 | `Abstract x -> c_split ~width (pp_i_abstract ppe) x
@@ -3481,19 +3471,18 @@ let rec pp_instr_r (ppe : PPEnv.t) fmt i =
34813471 Format. fprintf fmt " @[<v>while (@[%a@])%a@]"
34823472 (pp_expr ppe) e (pp_block ppe) s
34833473
3484- | Sif (e , {s_node =[{i_node= Sraise p}]} , {s_node = [] } )->
3485- Format. fprintf fmt " @[<hov 2>ensure@ @[%a@]@ ->@ %a@];"
3486- (pp_expr ppe) (add_not e) (pp_expr ppe) p
3487-
34883474 | Sif (e , s1 , s2 ) ->
3475+ let pp_then ppe fmt s =
3476+ if s.s_node = [] then ()
3477+ else pp_block ppe fmt s in
34893478 let pp_else ppe fmt s =
34903479 match s.s_node with
34913480 | [] -> ()
34923481 | [_] -> Format. fprintf fmt " @,else %a" (pp_block ppe) s
34933482 | _ -> Format. fprintf fmt " @ else %a" (pp_block ppe) s
34943483 in
34953484 Format. fprintf fmt " @[<v>if (@[%a@]) %a%a@]"
3496- (pp_expr ppe) e (pp_block ppe) s1 (pp_else ppe) s2
3485+ (pp_expr ppe) e (pp_then ppe) s1 (pp_else ppe) s2
34973486
34983487 | Smatch (e , ps ) ->
34993488 let p, tyd, typ = oget (EcEnv.Ty. get_top_decl e.e_ty ppe.PPEnv. ppe_env) in
0 commit comments