]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_notation/box.ml
ocaml 3.09 transition
[helm.git] / helm / ocaml / cic_notation / box.ml
index 7c4026d8120f0df49214b636f9598d66d9163c0f..c11558a2796040a01b633a892f481d646bd310b8 100644 (file)
@@ -119,3 +119,32 @@ let b_indent = indent
 let b_space = Space [None, "width", "0.5em"]
 let b_kw = b_text (RenderingAttrs.object_keyword_attributes `BoxML)
 
+let pp_attr attr =
+  let pp (ns, n, v) =
+    Printf.sprintf "%s%s=%s" (match ns with None -> "" | Some s -> s ^ ":") n v
+  in
+  String.concat " " (List.map pp attr)
+
+let get_attr = function
+  | Text (attr, _)
+  | Space attr
+  | Ink attr
+  | H (attr, _)
+  | V (attr, _)
+  | HV (attr, _)
+  | HOV (attr, _)
+  | Object (attr, _)
+  | Action (attr, _) ->
+      attr
+
+let set_attr attr = function
+  | Text (_, x) -> Text (attr, x)
+  | Space _ -> Space attr
+  | Ink _ -> Ink attr
+  | H (_, x) -> H (attr, x)
+  | V (_, x) -> V (attr, x)
+  | HV (_, x) -> HV (attr, x)
+  | HOV (_, x) -> HOV (attr, x)
+  | Object (_, x) -> Object (attr, x)
+  | Action (_, x) -> Action (attr, x)
+