From bc7cdfabf99d30f1ff25300a9f4744676610e277 Mon Sep 17 00:00:00 2001 From: Andrea Asperti Date: Thu, 23 Nov 2006 14:44:48 +0000 Subject: [PATCH] Added a new command "index" for the indexing terms in the "universe". --- helm/software/components/grafite/grafiteAst.ml | 3 ++- helm/software/components/grafite/grafiteAstPp.ml | 1 + helm/software/components/grafite/grafiteMarshal.ml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/helm/software/components/grafite/grafiteAst.ml b/helm/software/components/grafite/grafiteAst.ml index 8816f2efa..7108a323a 100644 --- a/helm/software/components/grafite/grafiteAst.ml +++ b/helm/software/components/grafite/grafiteAst.ml @@ -118,9 +118,10 @@ type 'term macro = (** 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 diff --git a/helm/software/components/grafite/grafiteAstPp.ml b/helm/software/components/grafite/grafiteAstPp.ml index 2e3d95abe..366c0e264 100644 --- a/helm/software/components/grafite/grafiteAstPp.ml +++ b/helm/software/components/grafite/grafiteAstPp.ml @@ -226,6 +226,7 @@ let pp_coercion uri do_composites arity = (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" diff --git a/helm/software/components/grafite/grafiteMarshal.ml b/helm/software/components/grafite/grafiteMarshal.ml index cc4423b96..056b1225d 100644 --- a/helm/software/components/grafite/grafiteMarshal.ml +++ b/helm/software/components/grafite/grafiteMarshal.ml @@ -46,6 +46,8 @@ let rehash_cmd_uris = 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 -- 2.39.2