(** To be increased each time the command type below changes, used for "safe"
* marshalling *)
-let magic = 10
+let magic = 11
type ('term,'obj) command =
+ | Index of loc * 'term option (* key *) * UriManager.uri (* value *)
| Coercion of loc * UriManager.uri * bool (* add_obj *) * int (* arity *)
| Default of loc * string * UriManager.uri list
| Drop of loc
(if do_composites then "compounds" else "no compounds")
let pp_command ~term_pp ~obj_pp = function
+ | Index (_,_,uri) -> "Indexing " ^ UriManager.string_of_uri uri
| Coercion (_, uri, do_composites, i) -> pp_coercion uri do_composites i
| Default (_,what,uris) -> pp_default what uris
| Drop _ -> "drop"
GrafiteAst.Default (loc, name, uris)
| GrafiteAst.Coercion (loc, uri, close, arity) ->
GrafiteAst.Coercion (loc, rehash_uri uri, close, arity)
+ | GrafiteAst.Index (loc, key, uri) ->
+ GrafiteAst.Index (loc, HExtlib.map_option CicUtil.rehash_term key, rehash_uri uri)
| cmd ->
prerr_endline "Found a command not expected in a .moo:";
let term_pp _ = assert false in