src/Doc/more_antiquote.ML
changeset 69597 ff784d5a5bfb
parent 67710 cc2db3239932
child 70304 1514efa1e57a
equal deleted inserted replaced
69596:c8a2755bf220 69597:ff784d5a5bfb
     8 struct
     8 struct
     9 
     9 
    10 (* class specifications *)
    10 (* class specifications *)
    11 
    11 
    12 val _ =
    12 val _ =
    13   Theory.setup (Thy_Output.antiquotation_pretty @{binding class_spec} (Scan.lift Args.name)
    13   Theory.setup (Thy_Output.antiquotation_pretty \<^binding>\<open>class_spec\<close> (Scan.lift Args.name)
    14     (fn ctxt => fn s =>
    14     (fn ctxt => fn s =>
    15       let
    15       let
    16         val thy = Proof_Context.theory_of ctxt;
    16         val thy = Proof_Context.theory_of ctxt;
    17         val class = Sign.intern_class thy s;
    17         val class = Sign.intern_class thy s;
    18       in Pretty.chunks (Class.pretty_specification thy class) end));
    18       in Pretty.chunks (Class.pretty_specification thy class) end));
    25     val ctxt' = Variable.set_body false ctxt;
    25     val ctxt' = Variable.set_body false ctxt;
    26     val ((_, [thm]), _) = Variable.import true [thm] ctxt';
    26     val ((_, [thm]), _) = Variable.import true [thm] ctxt';
    27   in thm end;
    27   in thm end;
    28 
    28 
    29 val _ =
    29 val _ =
    30   Theory.setup (Thy_Output.antiquotation_pretty @{binding code_thms} Args.term
    30   Theory.setup (Thy_Output.antiquotation_pretty \<^binding>\<open>code_thms\<close> Args.term
    31     (fn ctxt => fn raw_const =>
    31     (fn ctxt => fn raw_const =>
    32       let
    32       let
    33         val thy = Proof_Context.theory_of ctxt;
    33         val thy = Proof_Context.theory_of ctxt;
    34         val const = Code.check_const thy raw_const;
    34         val const = Code.check_const thy raw_const;
    35         val { eqngr, ... } = Code_Preproc.obtain true { ctxt = ctxt, consts = [const], terms = [] };
    35         val { eqngr, ... } = Code_Preproc.obtain true { ctxt = ctxt, consts = [const], terms = [] };