equal
deleted
inserted
replaced
17 val variant: string -> Proof.context -> string * Proof.context |
17 val variant: string -> Proof.context -> string * Proof.context |
18 type decl = Proof.context -> string * string |
18 type decl = Proof.context -> string * string |
19 val value_decl: string -> string -> Proof.context -> decl * Proof.context |
19 val value_decl: string -> string -> Proof.context -> decl * Proof.context |
20 val add_antiquotation: binding -> (Token.src -> Proof.context -> decl * Proof.context) -> |
20 val add_antiquotation: binding -> (Token.src -> Proof.context -> decl * Proof.context) -> |
21 theory -> theory |
21 theory -> theory |
22 val print_antiquotations: Proof.context -> unit |
22 val print_antiquotations: bool -> Proof.context -> unit |
23 val eval: ML_Compiler.flags -> Position.T -> ML_Lex.token Antiquote.antiquote list -> unit |
23 val eval: ML_Compiler.flags -> Position.T -> ML_Lex.token Antiquote.antiquote list -> unit |
24 val eval_file: ML_Compiler.flags -> Path.T -> unit |
24 val eval_file: ML_Compiler.flags -> Path.T -> unit |
25 val eval_source: ML_Compiler.flags -> Input.source -> unit |
25 val eval_source: ML_Compiler.flags -> Input.source -> unit |
26 val eval_in: Proof.context option -> ML_Compiler.flags -> Position.T -> |
26 val eval_in: Proof.context option -> ML_Compiler.flags -> Position.T -> |
27 ML_Lex.token Antiquote.antiquote list -> unit |
27 ML_Lex.token Antiquote.antiquote list -> unit |
100 #1 o Name_Space.check (Context.Proof ctxt) (get_antiquotations ctxt); |
100 #1 o Name_Space.check (Context.Proof ctxt) (get_antiquotations ctxt); |
101 |
101 |
102 fun add_antiquotation name f thy = thy |
102 fun add_antiquotation name f thy = thy |
103 |> Antiquotations.map (Name_Space.define (Context.Theory thy) true (name, f) #> snd); |
103 |> Antiquotations.map (Name_Space.define (Context.Theory thy) true (name, f) #> snd); |
104 |
104 |
105 fun print_antiquotations ctxt = |
105 fun print_antiquotations verbose ctxt = |
106 Pretty.big_list "ML antiquotations:" |
106 Pretty.big_list "ML antiquotations:" |
107 (map (Pretty.mark_str o #1) (Name_Space.markup_table ctxt (get_antiquotations ctxt))) |
107 (map (Pretty.mark_str o #1) (Name_Space.markup_table verbose ctxt (get_antiquotations ctxt))) |
108 |> Pretty.writeln; |
108 |> Pretty.writeln; |
109 |
109 |
110 fun apply_antiquotation src ctxt = |
110 fun apply_antiquotation src ctxt = |
111 let val (src', f) = Token.check_src ctxt (get_antiquotations ctxt) src |
111 let val (src', f) = Token.check_src ctxt (get_antiquotations ctxt) src |
112 in f src' ctxt end; |
112 in f src' ctxt end; |