| Ast.AttributedTerm (a, t) -> Ast.AttributedTerm (a, remove_level_info t)
| t -> t
-let add_xml_attrs attrs t =
- if attrs = [] then t else Ast.AttributedTerm (`XmlAttrs attrs, t)
+let add_xml_attrs attrs t = t
+(* if attrs = [] then t else Ast.AttributedTerm (`XmlAttrs attrs, t) *)
-let add_keyword_attrs =
- add_xml_attrs (RenderingAttrs.keyword_attributes `MathML)
+let add_keyword_attrs t = t
+(* add_xml_attrs (RenderingAttrs.keyword_attributes `MathML) *)
let box kind spacing indent content =
Ast.Layout (Ast.Box ((kind, spacing, indent), content))
let keyword k = add_keyword_attrs (Ast.Literal (`Keyword k))
let number s =
- add_xml_attrs (RenderingAttrs.number_attributes `MathML)
+ add_xml_attrs (* (RenderingAttrs.number_attributes `MathML) *) ()
(Ast.Literal (`Number s))
let ident i =
- add_xml_attrs (RenderingAttrs.ident_attributes `MathML)
+ add_xml_attrs (* (RenderingAttrs.ident_attributes `MathML) *) ()
(Ast.Ident (i,`Ambiguous))
let ident_w_href href i =
add_xml_attrs [Some "xlink", "href", href] (ident i)
let binder_symbol s =
- add_xml_attrs (RenderingAttrs.builtin_symbol_attributes `MathML)
+ add_xml_attrs (* (RenderingAttrs.builtin_symbol_attributes `MathML) *) ()
(builtin_symbol s)
let xml_of_sort x =
let to_string x = Ast.Ident (x, `Ambiguous) in
let identify x =
- add_xml_attrs (RenderingAttrs.keyword_attributes `MathML) (to_string x)
+ add_xml_attrs (* (RenderingAttrs.keyword_attributes `MathML) *) () (to_string x)
in
let lvl t = Ast.AttributedTerm (`Level 90,t) in
match x with
NotationEnv.OptValue (Some (pp_value v))
| NotationEnv.ListValue vl ->
NotationEnv.ListValue (List.map pp_value vl)
- | NotationEnv.LocValue _ as v -> v
+ | NotationEnv.DisambiguationValue _ as v -> v
in
let ast_env_of_env env =
List.map (fun (var, (ty, value)) -> (var, (ty, pp_value value))) env
in
aux [] env
-let instantiate_level2 status env loc term =
+let instantiate_level2 status env (loc,uri,desc) term =
(* prerr_endline ("istanzio: " ^ NotationPp.pp_term term); *)
let fresh_env = ref [] in
let lookup_fresh_name n =
| Ast.Num _
| Ast.Sort _
| Ast.UserInput -> term
- | Ast.Symbol _ -> Ast.AttributedTerm (`Loc loc, term)
+ | Ast.Symbol (s,_) -> aux_symbol s loc (uri,desc)
| Ast.Magic magic -> aux_magic env magic
| Ast.Variable var -> aux_variable env var
| Ast.Cast (t, ty) -> Ast.Cast (aux env t, aux env ty)
| _ -> assert false
+ and aux_symbol s loc = function
+ | _, None -> Ast.AttributedTerm (`Loc loc, Ast.Symbol (s, None))
+ | uri, Some desc ->
+ Ast.AttributedTerm (`Loc loc, Ast.Symbol (s, Some (uri,desc)))
and aux_opt env = function
| Some term -> Some (aux env term)
| None -> None