X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_notation%2FcicNotationPp.ml;h=c3185d6a251ba1ee2b63a1d8a4e63d80ebdfb453;hb=26cce624c98e795521078794c748758798031704;hp=d815506378f90924fa8cd79eda5f4b2cbf09e5bb;hpb=256ea270b884864d0eddd1de66bae2a2cbc513ff;p=helm.git diff --git a/helm/ocaml/cic_notation/cicNotationPp.ml b/helm/ocaml/cic_notation/cicNotationPp.ml index d81550637..c3185d6a2 100644 --- a/helm/ocaml/cic_notation/cicNotationPp.ml +++ b/helm/ocaml/cic_notation/cicNotationPp.ml @@ -44,6 +44,8 @@ let pp_literal l = | `Number s -> s) let rec pp_term = function + | AttributedTerm (`Href _, term) when print_attributes -> + sprintf "#[%s]" (pp_term term) | AttributedTerm (_, term) when print_attributes -> sprintf "@[%s]" (pp_term term) | AttributedTerm (_, term) -> pp_term term @@ -118,6 +120,13 @@ and pp_capture_variable = function | term, None -> pp_term term | term, Some typ -> "(" ^ pp_term term ^ ": " ^ pp_term typ ^ ")" +and pp_box_spec (kind, spacing, indent) = + let int_of_bool b = if b then 1 else 0 in + let kind_string = + match kind with H -> "H" | V -> "V" | HV -> "HV" | HOV -> "HOV" + in + sprintf "%sBOX%d%d" kind_string (int_of_bool spacing) (int_of_bool indent) + and pp_layout = function | Sub (t1, t2) -> sprintf "%s \\SUB %s" (pp_term t1) (pp_term t2) | Sup (t1, t2) -> sprintf "%s \\SUP %s" (pp_term t1) (pp_term t2) @@ -130,14 +139,10 @@ and pp_layout = function | Root (arg, index) -> sprintf "\\ROOT %s \\OF %s" (pp_term index) (pp_term arg) (* | Break -> "\\BREAK" *) - | Box (H, terms) -> - sprintf "\\HBOX [%s]" (String.concat " " (List.map pp_term terms)) - | Box (V, terms) -> - sprintf "\\VBOX [%s]" (String.concat " " (List.map pp_term terms)) - | Box (HV, terms) -> - sprintf "\\HVBOX [%s]" (String.concat " " (List.map pp_term terms)) - | Box (HOV, terms) -> - sprintf "\\HOVBOX [%s]" (String.concat " " (List.map pp_term terms)) +(* | Space -> "\\SPACE" *) + | Box (box_spec, terms) -> + sprintf "\\%s [%s]" (pp_box_spec box_spec) + (String.concat " " (List.map pp_term terms)) and pp_magic = function | List0 (t, sep_opt) -> @@ -151,6 +156,10 @@ and pp_magic = function (pp_fold_kind k) (pp_term p_base) acc (pp_term p_rec) | Default (p_some, p_none) -> sprintf "\\DEFAULT \\[%s\\] \\[%s\\]" (pp_term p_some) (pp_term p_none) + | If (p_guard, p) -> + sprintf "\\IF \\[%s\\] \\[%s\\]" (pp_term p_guard) (pp_term p) + | Unless (p_guard, p) -> + sprintf "\\UNLESS \\[%s\\] \\[%s\\]" (pp_term p_guard) (pp_term p) and pp_fold_kind = function | `Left -> "left"