src/Pure/Thy/ml_context.ML
changeset 24149 1b2f1a1a03a3
parent 24056 e134e757fc64
equal deleted inserted replaced
24148:2d4ee876c215 24149:1b2f1a1a03a3
    30   val value_antiq: string ->
    30   val value_antiq: string ->
    31     (Context.generic * Args.T list -> (string * string) * (Context.generic * Args.T list)) -> unit
    31     (Context.generic * Args.T list -> (string * string) * (Context.generic * Args.T list)) -> unit
    32   val proj_value_antiq: string -> (Context.generic * Args.T list ->
    32   val proj_value_antiq: string -> (Context.generic * Args.T list ->
    33       (string * string * string) * (Context.generic * Args.T list)) -> unit
    33       (string * string * string) * (Context.generic * Args.T list)) -> unit
    34   val eval_antiquotes_fn: (string -> string * string) ref  (* FIXME tmp *)
    34   val eval_antiquotes_fn: (string -> string * string) ref  (* FIXME tmp *)
       
    35   val trace: bool ref
    35   val use_mltext: string -> bool -> Context.generic option -> unit
    36   val use_mltext: string -> bool -> Context.generic option -> unit
    36   val use_mltext_update: string -> bool -> Context.generic -> Context.generic
    37   val use_mltext_update: string -> bool -> Context.generic -> Context.generic
    37   val use_let: string -> string -> string -> Context.generic -> Context.generic
    38   val use_let: string -> string -> string -> Context.generic -> Context.generic
    38   val use: Path.T -> unit
    39   val use: Path.T -> unit
    39 end;
    40 end;
   165 
   166 
   166 in
   167 in
   167 
   168 
   168 val eval_antiquotes_fn = ref eval_antiquotes;
   169 val eval_antiquotes_fn = ref eval_antiquotes;
   169 
   170 
       
   171 val trace = ref false;
       
   172 
   170 fun eval_wrapper name verbose txt =
   173 fun eval_wrapper name verbose txt =
   171   let
   174   let
   172     val (txt1, txt2) = ! eval_antiquotes_fn txt;
   175     val (txt1, txt2) = ! eval_antiquotes_fn txt;
   173     val _ =
   176     val _ = if ! trace then tracing (cat_lines [txt1, txt2]) else ();
   174       if txt1 = isabelle_struct0 andalso txt2 = txt then ()
       
   175       else Output.debug (fn () => cat_lines [txt1, txt2]);
       
   176   in eval "" false txt1; eval name verbose txt2; eval "" false isabelle_struct0 end;
   177   in eval "" false txt1; eval name verbose txt2; eval "" false isabelle_struct0 end;
   177 
   178 
   178 end;
   179 end;
   179 
   180 
   180 
   181