uri: (Cic.id, string) Hashtbl.t;
}
-let warning s = prerr_endline ("CicNotation WARNING: " ^ s)
-
let get_types uri =
let o,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in
match o with
| `Forall -> "\\forall"
| `Exists -> "\\exists"
+let binder_attributes = [None, "mathcolor", "blue"]
+let atop_attributes = [None, "linethickness", "0pt"]
+let indent_attributes = [None, "indent", "1em"]
+let keyword_attributes = [None, "mathcolor", "blue"]
+
let pp_ast0 t k =
let reset_href t = Ast.AttributedTerm (`Href [], t) in
let builtin_symbol s = reset_href (Ast.Literal (`Symbol s)) in
+ let binder_symbol s =
+ Ast.AttributedTerm (`XmlAttrs binder_attributes, builtin_symbol s)
+ in
let rec aux = function
| Ast.Appl ts ->
Ast.AttributedTerm (`Level (Parser.apply_prec, Parser.apply_assoc),
Ast.Layout (Ast.Box ((Ast.HV, false, true), [
aux_ty ty;
Ast.Layout (Ast.Box ((Ast.H, false, false), [
- builtin_symbol "\\to";
+ binder_symbol "\\to";
k body]))])))
| Ast.Binder (binder_kind, (id, ty), body) ->
Ast.AttributedTerm (`Level (Parser.binder_prec, Parser.binder_assoc),
Ast.Layout (Ast.Box ((Ast.HV, false, true), [
Ast.Layout (Ast.Box ((Ast.H, false, false), [
- builtin_symbol (resolve_binder binder_kind);
+ binder_symbol (resolve_binder binder_kind);
k id;
builtin_symbol ":";
aux_ty ty ]));
assert (CicNotationEnv.well_typed expected_ty value);
[ CicNotationEnv.term_of_value value ]
| Ast.Magic m -> subst_magic env m
+ | Ast.Literal (`Keyword k) as t ->
+ [ Ast.AttributedTerm (`XmlAttrs keyword_attributes, t) ]
| Ast.Literal _ as t -> [ t ]
| Ast.Layout l -> [ Ast.Layout (subst_layout env l) ]
| t -> [ CicNotationUtil.visit_ast (subst_singleton env) t ]