| Index (_,_,uri) -> "Indexing " ^ UriManager.string_of_uri uri
| Coercion (_, t, do_composites, i, j) ->
pp_coercion ~term_pp t do_composites i j
+ | UnificationHint (_,t) ->
+ "unification hint " ^ term_pp t
| Default (_,what,uris) -> pp_default what uris
| Drop _ -> "drop"
| Include (_,path) -> "include \"" ^ path ^ "\""
GrafiteTypes.status * UriManager.uri list
}
+type 'a eval_comment =
+ {ecm_go: 'term 'lazy_term 'reduction_kind 'obj 'ident.
+ disambiguate_command:
+ (GrafiteTypes.status -> (('term,'obj) GrafiteAst.command) disambiguator_input ->
+ GrafiteTypes.status * (Cic.term,Cic.obj) GrafiteAst.command) ->
+ options -> GrafiteTypes.status ->
+ (('term,'lazy_term,'reduction_kind,'obj,'ident) GrafiteAst.comment) disambiguator_input ->
+ GrafiteTypes.status * UriManager.uri list
+ }
+
type 'a eval_executable =
{ee_go: 'term 'lazy_term 'reduction 'obj 'ident.
disambiguate_tactic:
RefinementTool.ppmetasenv = CicMetaSubst.ppmetasenv;
RefinementTool.pack_coercion_obj = CicRefine.pack_coercion_obj;
}
-
+
+let eval_unification_hint status t =
+ (* XXX no undo *)
+ NCicUnifHint.add_user_provided_hint t;
+ status,[]
+;;
+
let eval_coercion status ~add_composites uri arity saturations =
let uri =
try CicUtil.uri_of_term uri
in
status
-let eval_comment status c = status
-
(* since the record syntax allows to declare coercions, we have to put this
* information inside the moo *)
let add_coercions_of_record_to_moo obj lemmas status =
status,[]
| GrafiteAst.Coercion (loc, uri, add_composites, arity, saturations) ->
eval_coercion status ~add_composites uri arity saturations
+ | GrafiteAst.UnificationHint (loc, t) ->
+ eval_unification_hint status t
| GrafiteAst.Default (loc, what, uris) as cmd ->
LibraryObjects.set_default what uris;
GrafiteTypes.add_moo_content [cmd] status,[]
| GrafiteAst.Executable (_,ex) ->
eval_executable.ee_go ~disambiguate_tactic ~disambiguate_command
~disambiguate_macro opts status (text,prefix_len,ex)
- | GrafiteAst.Comment (_,c) -> eval_comment status (text,prefix_len,c),[]
+ | GrafiteAst.Comment (_,c) ->
+ eval_comment.ecm_go ~disambiguate_command opts status (text,prefix_len,c)
+} and eval_comment = { ecm_go = fun ~disambiguate_command opts status (text,prefix_len,c) ->
+ status, []
}
+;;
+
let eval_ast = eval_ast.ea_go