src/Pure/Isar/isar_output.ML
changeset 11714 bc0a84063a9c
parent 11524 197f2e14a714
child 11716 064833efb479
equal deleted inserted replaced
11713:883d559b0b8c 11714:bc0a84063a9c
    15   val integer: string -> int
    15   val integer: string -> int
    16   val args: (Proof.context * Args.T list -> 'a * (Proof.context * Args.T list)) ->
    16   val args: (Proof.context * Args.T list -> 'a * (Proof.context * Args.T list)) ->
    17     (Args.src -> Proof.context -> 'a -> string) -> Args.src -> Toplevel.state -> string
    17     (Args.src -> Proof.context -> 'a -> string) -> Args.src -> Toplevel.state -> string
    18   datatype markup = Markup | MarkupEnv | Verbatim
    18   datatype markup = Markup | MarkupEnv | Verbatim
    19   val interest_level: int ref
    19   val interest_level: int ref
       
    20   val modes: string list ref
    20   val parse_thy: (markup -> OuterLex.token list -> OuterLex.token * OuterLex.token list) ->
    21   val parse_thy: (markup -> OuterLex.token list -> OuterLex.token * OuterLex.token list) ->
    21     Scan.lexicon -> Toplevel.transition list -> (OuterLex.token, 'a) Source.source ->
    22     Scan.lexicon -> Toplevel.transition list -> (OuterLex.token, 'a) Source.source ->
    22       (Toplevel.transition * (Toplevel.state -> Buffer.T -> Buffer.T)) list * Buffer.T
    23       (Toplevel.transition * (Toplevel.state -> Buffer.T -> Buffer.T)) list * Buffer.T
    23   val display: bool ref
    24   val display: bool ref
    24   val quotes: bool ref
    25   val quotes: bool ref
   134 end;
   135 end;
   135 
   136 
   136 
   137 
   137 (* eval_antiquote *)
   138 (* eval_antiquote *)
   138 
   139 
       
   140 val modes = ref ([]: string list);
       
   141 
   139 fun eval_antiquote lex state (str, pos) =
   142 fun eval_antiquote lex state (str, pos) =
   140   let
   143   let
   141     fun expand (Antiquote.Text s) = s
   144     fun expand (Antiquote.Text s) = s
   142       | expand (Antiquote.Antiq x) =
   145       | expand (Antiquote.Antiq x) =
   143           let val (opts, src) = antiq_args lex x in
   146           let val (opts, src) = antiq_args lex x in
   144             options opts (fn () => command src state) ();  (*preview errors!*)
   147             options opts (fn () => command src state) ();  (*preview errors!*)
   145             Library.setmp print_mode (Latex.modes @ ! print_mode)
   148             Library.setmp print_mode (! modes @ Latex.modes @ ! print_mode)
   146               (options opts (fn () => command src state)) ()
   149               (options opts (fn () => command src state)) ()
   147           end;
   150           end;
   148     val ants = Antiquote.antiquotes_of (str, pos);
   151     val ants = Antiquote.antiquotes_of (str, pos);
   149   in
   152   in
   150     if Toplevel.is_toplevel state andalso exists Antiquote.is_antiq ants then
   153     if Toplevel.is_toplevel state andalso exists Antiquote.is_antiq ants then