aboutsummaryrefslogtreecommitdiff
path: root/vernac
diff options
context:
space:
mode:
authorMaxime Dénès2018-07-19 11:41:48 +0200
committerMaxime Dénès2018-12-12 18:41:11 +0100
commit264c208a5eb824c880ef4c46e060185470064df5 (patch)
treece99aabb06f6232d4ecfd2117269d827df24463c /vernac
parentdfd4c4a2b50edf894a19cd50c43517e1804eadc9 (diff)
Higher-level libobject API for objects with fixed scopes
Diffstat (limited to 'vernac')
-rw-r--r--vernac/metasyntax.ml8
1 files changed, 3 insertions, 5 deletions
diff --git a/vernac/metasyntax.ml b/vernac/metasyntax.ml
index dccd776fa8..790b62c9d0 100644
--- a/vernac/metasyntax.ml
+++ b/vernac/metasyntax.ml
@@ -33,11 +33,9 @@ open Nameops
let cache_token (_,s) = CLexer.add_keyword s
let inToken : string -> obj =
- declare_object {(default_object "TOKEN") with
- open_function = (fun i o -> if Int.equal i 1 then cache_token o);
- cache_function = cache_token;
- subst_function = Libobject.ident_subst_function;
- classify_function = (fun o -> Substitute o)}
+ declare_object @@ global_object_nodischarge "TOKEN"
+ ~cache:cache_token
+ ~subst:(Some Libobject.ident_subst_function)
let add_token_obj s = Lib.add_anonymous_leaf (inToken s)