From fd08bfeab5fc4c01a1716b9c3fe95ed8439c5190 Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Wed, 10 Jan 2007 19:36:37 +0000 Subject: [PATCH] procedural: buggy ast renderer fixed --- components/content_pres/acic2Procedural.ml | 2 +- components/content_pres/proceduralTypes.ml | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/content_pres/acic2Procedural.ml b/components/content_pres/acic2Procedural.ml index 18ded2e79..9b8dbf063 100644 --- a/components/content_pres/acic2Procedural.ml +++ b/components/content_pres/acic2Procedural.ml @@ -236,7 +236,7 @@ let mk_obj st = function let text = Printf.sprintf "tactics: %u" count in P.Theorem (s, t, text) :: ast @ [P.Qed ""] | _ -> - [P.Note "not a theorem"] + failwith "not a theorem" (* interface functions ******************************************************) diff --git a/components/content_pres/proceduralTypes.ml b/components/content_pres/proceduralTypes.ml index be1dbee73..0ef73e248 100644 --- a/components/content_pres/proceduralTypes.ml +++ b/components/content_pres/proceduralTypes.ml @@ -155,23 +155,23 @@ let rec render_step sep a = function | Elim (t, xu, s) -> mk_note s :: cont sep (mk_elim t xu :: a) | Apply (t, s) -> mk_note s :: cont sep (mk_apply t :: a) | Branch ([], s) -> a - | Branch ([ps], s) -> cont sep (render_steps a ps) + | Branch ([ps], s) -> render_steps sep a ps | Branch (pss, s) -> let a = mk_ob :: a in - let body = mk_cb :: list_rev_map_concat render_steps mk_vb a pss in + let body = mk_cb :: list_rev_map_concat (render_steps None) mk_vb a pss in mk_note s :: cont sep body -and render_steps a = function +and render_steps sep a = function | [] -> a - | [p] -> render_step None a p - | (Note _ | Theorem _ | Qed _ as p) :: ps -> - render_steps (render_step None a p) ps - | p :: ((Branch ([], _) :: _) as ps) -> - render_steps (render_step None a p) ps + | [p] -> render_step sep a p + | p :: Branch ([], _) :: ps -> + render_steps sep a (p :: ps) | p :: ((Branch (_ :: _ :: _, _) :: _) as ps) -> - render_steps (render_step (Some mk_sc) a p) ps + render_steps sep (render_step (Some mk_sc) a p) ps | p :: ps -> - render_steps (render_step (Some mk_dot) a p) ps + render_steps sep (render_step (Some mk_dot) a p) ps + +let render_steps a = render_steps None a (* counting *****************************************************************) -- 2.39.2