src/HOL/Tools/BNF/bnf_fp_util.ML
changeset 71245 e5664a75f4b5
parent 70494 41108e3e9ca5
child 71246 30db0523f9b0
--- a/src/HOL/Tools/BNF/bnf_fp_util.ML	Thu Dec 05 21:03:06 2019 +0100
+++ b/src/HOL/Tools/BNF/bnf_fp_util.ML	Fri Dec 06 11:12:55 2019 +0100
@@ -213,7 +213,6 @@
     binding list -> (string * sort) list -> (string * sort) list -> (string * sort) list ->
     typ list -> BNF_Comp.comp_cache -> local_theory ->
     ((BNF_Def.bnf list * BNF_Comp.absT_info list) * BNF_Comp.comp_cache) * 'a
-  val fp_antiquote_setup: binding -> theory -> theory
 end;
 
 structure BNF_FP_Util : BNF_FP_UTIL =
@@ -982,7 +981,12 @@
     (((pre_bnfs, absT_infos), comp_cache'), res)
   end;
 
-fun fp_antiquote_setup binding =
+
+(** document antiquotations **)
+
+local
+
+fun antiquote_setup binding =
   Thy_Output.antiquotation_pretty_source_embedded binding
     (Args.type_name {proper = true, strict = true})
     (fn ctxt => fn fcT_name =>
@@ -1005,4 +1009,13 @@
              flat (separate [Pretty.brk 1, Pretty.str "| "] (map (single o pretty_ctr) ctrs)))
          end));
 
+in
+
+val _ =
+  Theory.setup
+   (antiquote_setup \<^binding>\<open>datatype\<close> #>
+    antiquote_setup \<^binding>\<open>codatatype\<close>);
+
 end;
+
+end;