# HG changeset patch # User haftmann # Date 1628147569 0 # Node ID 7d3e818fe21f3d318697e0160a33cf19ec2f5ded # Parent bc03b0b82fe6044679baa4a82997e390ecdd3650 antiquotation for bundles diff -r bc03b0b82fe6 -r 7d3e818fe21f src/Doc/Isar_Ref/Document_Preparation.thy --- a/src/Doc/Isar_Ref/Document_Preparation.thy Wed Aug 04 22:20:47 2021 +0200 +++ b/src/Doc/Isar_Ref/Document_Preparation.thy Thu Aug 05 07:12:49 2021 +0000 @@ -95,6 +95,7 @@ @{antiquotation_def type} & : & \antiquotation\ \\ @{antiquotation_def class} & : & \antiquotation\ \\ @{antiquotation_def locale} & : & \antiquotation\ \\ + @{antiquotation_def bundle} & : & \antiquotation\ \\ @{antiquotation_def "text"} & : & \antiquotation\ \\ @{antiquotation_def goals} & : & \antiquotation\ \\ @{antiquotation_def subgoals} & : & \antiquotation\ \\ @@ -195,6 +196,7 @@ @@{antiquotation type} options @{syntax embedded} | @@{antiquotation class} options @{syntax embedded} | @@{antiquotation locale} options @{syntax embedded} | + @@{antiquotation bundle} options @{syntax embedded} | (@@{antiquotation command} | @@{antiquotation method} | @@{antiquotation attribute}) options @{syntax name} ; @@ -272,6 +274,8 @@ \<^descr> \@{locale c}\ prints a locale \c\. + \<^descr> \@{bundle c}\ prints a bundle \c\. + \<^descr> \@{command name}\, \@{method name}\, \@{attribute name}\ print checked entities of the Isar language. diff -r bc03b0b82fe6 -r 7d3e818fe21f src/Pure/Isar/bundle.ML --- a/src/Pure/Isar/bundle.ML Wed Aug 04 22:20:47 2021 +0200 +++ b/src/Pure/Isar/bundle.ML Thu Aug 05 07:12:49 2021 +0000 @@ -10,6 +10,7 @@ val check: Proof.context -> xstring * Position.T -> string val get: Proof.context -> name -> Attrib.thms val read: Proof.context -> xstring * Position.T -> Attrib.thms + val extern: Proof.context -> string -> xstring val print_bundles: bool -> Proof.context -> unit val bundle: binding * Attrib.thms -> (binding * typ option * mixfix) list -> local_theory -> local_theory @@ -54,6 +55,8 @@ fun read ctxt = get ctxt o check ctxt; +fun extern ctxt = Name_Space.extern ctxt (Name_Space.space_of_table (get_all ctxt)); + fun define_bundle (b, bundle) context = let val bundle' = Attrib.trim_context_thms bundle; diff -r bc03b0b82fe6 -r 7d3e818fe21f src/Pure/Thy/document_antiquotations.ML --- a/src/Pure/Thy/document_antiquotations.ML Wed Aug 04 22:20:47 2021 +0200 +++ b/src/Pure/Thy/document_antiquotations.ML Thu Aug 05 07:12:49 2021 +0000 @@ -50,6 +50,9 @@ let val thy = Proof_Context.theory_of ctxt in Pretty.str (Locale.extern thy (Locale.check thy (name, pos))) end; +fun pretty_bundle ctxt (name, pos) = + Pretty.str (Bundle.extern ctxt (Bundle.check ctxt (name, pos))); + fun pretty_class ctxt s = Pretty.str (Proof_Context.extern_class ctxt (Proof_Context.read_class ctxt s)); @@ -78,6 +81,7 @@ basic_entity \<^binding>\abbrev\ (Scan.lift Args.embedded_inner_syntax) pretty_abbrev #> basic_entity \<^binding>\typ\ Args.typ_abbrev Syntax.pretty_typ #> basic_entity \<^binding>\locale\ (Scan.lift Args.embedded_position) pretty_locale #> + basic_entity \<^binding>\bundle\ (Scan.lift Args.embedded_position) pretty_bundle #> basic_entity \<^binding>\class\ (Scan.lift Args.embedded_inner_syntax) pretty_class #> basic_entity \<^binding>\type\ (Scan.lift Args.embedded_inner_syntax) pretty_type #> basic_entity \<^binding>\theory\ (Scan.lift Args.embedded_position) pretty_theory #>