src/Pure/ML/ml_antiquotations2.ML
author wenzelm
Sun, 02 May 2021 14:07:19 +0200
changeset 73613 c1d8cd6d1a49
child 74164 7b93dc3f2b34
permissions -rw-r--r--
early definition of ML antiquotations;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
73613
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
     1
(*  Title:      Pure/ML/ml_antiquotations2.ML
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
     3
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
     4
Miscellaneous ML antiquotations: part 2.
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
     5
*)
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
     6
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
     7
structure ML_Antiquotations2: sig end =
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
     8
struct
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
     9
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    10
val _ = Theory.setup
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    11
 (ML_Antiquotation.inline_embedded \<^binding>\<open>method\<close>
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    12
    (Args.context -- Scan.lift Args.embedded_position >> (fn (ctxt, (name, pos)) =>
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    13
      ML_Syntax.print_string (Method.check_name ctxt (name, pos)))) #>
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    14
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    15
  ML_Antiquotation.inline_embedded \<^binding>\<open>locale\<close>
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    16
   (Args.context -- Scan.lift Args.embedded_position >> (fn (ctxt, (name, pos)) =>
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    17
      Locale.check (Proof_Context.theory_of ctxt) (name, pos)
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    18
      |> ML_Syntax.print_string)));
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    19
c1d8cd6d1a49 early definition of ML antiquotations;
wenzelm
parents:
diff changeset
    20
end;