diff options
author | 2015-02-04 14:31:57 +0100 | |
---|---|---|
committer | 2015-02-04 14:31:57 +0100 | |
commit | 00853ca988d304af5b41834ee6b5766532233349 (patch) | |
tree | af6a5dee8ee9ffd9567ceea4ddcbd46b9b981273 /toplevel | |
parent | ab97dd2c8d49e59b7fb623e1fe9606395a176187 (diff) |
Tactic Notation: use stable unique key for notations (Close: 3970)
Diffstat (limited to 'toplevel')
-rw-r--r-- | toplevel/metasyntax.ml | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/toplevel/metasyntax.ml b/toplevel/metasyntax.ml index 161cf8247..9d7baa21d 100644 --- a/toplevel/metasyntax.ml +++ b/toplevel/metasyntax.ml @@ -68,16 +68,24 @@ type tactic_grammar_obj = { tacobj_body : Tacexpr.glob_tactic_expr } -let cache_tactic_notation ((_, key), tobj) = +let key k tobj = + let mp,dp,_ = KerName.repr k in + KerName.make mp dp + (Label.make ("_" ^ string_of_int (Hashtbl.hash tobj.tacobj_tacgram))) + +let cache_tactic_notation ((_,k), tobj) = + let key = key k tobj in Tacenv.register_alias key tobj.tacobj_body; Egramcoq.extend_tactic_grammar key tobj.tacobj_tacgram; Pptactic.declare_notation_tactic_pprule key tobj.tacobj_tacpp -let open_tactic_notation i ((_, key), tobj) = +let open_tactic_notation i ((_,k), tobj) = + let key = key k tobj in if Int.equal i 1 && not tobj.tacobj_local then Egramcoq.extend_tactic_grammar key tobj.tacobj_tacgram -let load_tactic_notation i ((_, key), tobj) = +let load_tactic_notation i ((_,k), tobj) = + let key = key k tobj in (** Only add the printing and interpretation rules. *) Tacenv.register_alias key tobj.tacobj_body; Pptactic.declare_notation_tactic_pprule key tobj.tacobj_tacpp; |