equal
deleted
inserted
replaced
35 struct |
35 struct |
36 |
36 |
37 structure T = OuterLex; |
37 structure T = OuterLex; |
38 structure P = OuterParse; |
38 structure P = OuterParse; |
39 |
39 |
40 |
|
41 |
|
42 (** global references -- defaults for options **) |
40 (** global references -- defaults for options **) |
43 |
41 |
44 val locale = ref ""; |
42 val locale = ref ""; |
45 val display = ref false; |
43 val display = ref false; |
46 val quotes = ref false; |
44 val quotes = ref false; |
166 fun expand (Antiquote.Text s) = s |
164 fun expand (Antiquote.Text s) = s |
167 | expand (Antiquote.Antiq x) = |
165 | expand (Antiquote.Antiq x) = |
168 let val (opts, src) = antiq_args lex x in |
166 let val (opts, src) = antiq_args lex x in |
169 options opts (fn () => command src state) (); (*preview errors!*) |
167 options opts (fn () => command src state) (); (*preview errors!*) |
170 Library.setmp print_mode (! modes @ Latex.modes @ ! print_mode) |
168 Library.setmp print_mode (! modes @ Latex.modes @ ! print_mode) |
171 (options opts (fn () => command src state)) () |
169 (Output.no_warnings (options opts (fn () => command src state))) () |
172 end; |
170 end; |
173 val ants = Antiquote.antiquotes_of (str, pos); |
171 val ants = Antiquote.antiquotes_of (str, pos); |
174 in |
172 in |
175 if Toplevel.is_toplevel state andalso exists Antiquote.is_antiq ants then |
173 if Toplevel.is_toplevel state andalso exists Antiquote.is_antiq ants then |
176 error ("Cannot expand antiquotations at top-level" ^ Position.str_of pos) |
174 error ("Cannot expand antiquotations at top-level" ^ Position.str_of pos) |