src/Pure/Thy/thy_output.ML
changeset 30368 1a2a54f910c9
parent 30367 ee8841b1b981
child 30381 a59d792d0ccf
equal deleted inserted replaced
30367:ee8841b1b981 30368:1a2a54f910c9
    16   val defined_command: string -> bool
    16   val defined_command: string -> bool
    17   val defined_option: string -> bool
    17   val defined_option: string -> bool
    18   val print_antiquotations: unit -> unit
    18   val print_antiquotations: unit -> unit
    19   val boolean: string -> bool
    19   val boolean: string -> bool
    20   val integer: string -> int
    20   val integer: string -> int
       
    21   val raw_antiquotation: string -> (Args.src -> Toplevel.state ->
       
    22     Context.generic * Args.T list -> string * (Context.generic * Args.T list)) -> unit
       
    23   val antiquotation: string -> (Args.src -> Proof.context ->
       
    24     Context.generic * Args.T list -> string * (Context.generic * Args.T list)) -> unit
    21   val args: (Context.generic * Args.T list -> 'a * (Context.generic * Args.T list)) ->
    25   val args: (Context.generic * Args.T list -> 'a * (Context.generic * Args.T list)) ->
    22     (Args.src -> Proof.context -> 'a -> string) -> Args.src -> Toplevel.state -> string
    26     (Args.src -> Proof.context -> 'a -> string) -> Args.src -> Toplevel.state -> string
    23   datatype markup = Markup | MarkupEnv | Verbatim
    27   datatype markup = Markup | MarkupEnv | Verbatim
    24   val modes: string list ref
    28   val modes: string list ref
    25   val eval_antiquote: Scan.lexicon -> Toplevel.state -> SymbolPos.text * Position.T -> string
    29   val eval_antiquote: Scan.lexicon -> Toplevel.state -> SymbolPos.text * Position.T -> string
   124 
   128 
   125 
   129 
   126 (* args syntax *)
   130 (* args syntax *)
   127 
   131 
   128 fun syntax scan = Args.context_syntax "document antiquotation" scan;
   132 fun syntax scan = Args.context_syntax "document antiquotation" scan;
       
   133 
       
   134 fun raw_antiquotation name scan =
       
   135   add_commands [(name, fn src => fn state =>
       
   136     #1 (syntax (scan src state) src (Toplevel.presentation_context_of state NONE)))];
       
   137 
       
   138 fun antiquotation name scan =
       
   139   raw_antiquotation name (fn src => fn state =>
       
   140     scan src (Toplevel.presentation_context_of state NONE));
   129 
   141 
   130 fun args scan f src state : string =
   142 fun args scan f src state : string =
   131   let
   143   let
   132     val loc = if ! locale = "" then NONE else SOME (! locale);
   144     val loc = if ! locale = "" then NONE else SOME (! locale);
   133     val (x, ctxt) = syntax scan src (Toplevel.presentation_context_of state loc);
   145     val (x, ctxt) = syntax scan src (Toplevel.presentation_context_of state loc);