src/Pure/Thy/export.ML
changeset 70907 7e3f25a0cee4
parent 70499 f389019024ce
child 70991 f9f7c34b7dd4
equal deleted inserted replaced
70906:b9567a9f44a0 70907:7e3f25a0cee4
    14   val export_executable: theory -> Path.binding -> string list -> unit
    14   val export_executable: theory -> Path.binding -> string list -> unit
    15   val export_file: theory -> Path.binding -> Path.T -> unit
    15   val export_file: theory -> Path.binding -> Path.T -> unit
    16   val export_executable_file: theory -> Path.binding -> Path.T -> unit
    16   val export_executable_file: theory -> Path.binding -> Path.T -> unit
    17   val markup: theory -> Path.T -> Markup.T
    17   val markup: theory -> Path.T -> Markup.T
    18   val message: theory -> Path.T -> string
    18   val message: theory -> Path.T -> string
       
    19   val protocol_message: Properties.T -> string list -> unit
    19 end;
    20 end;
    20 
    21 
    21 structure Export: EXPORT =
    22 structure Export: EXPORT =
    22 struct
    23 struct
    23 
    24 
    65   in Active.make_markup Markup.theory_exportsN {implicit = false, properties = [name]} end;
    66   in Active.make_markup Markup.theory_exportsN {implicit = false, properties = [name]} end;
    66 
    67 
    67 fun message thy path =
    68 fun message thy path =
    68   "See " ^ Markup.markup (markup thy path) "theory exports";
    69   "See " ^ Markup.markup (markup thy path) "theory exports";
    69 
    70 
       
    71 
       
    72 (* protocol message (bootstrap) *)
       
    73 
       
    74 fun protocol_message props output =
       
    75   (case props of
       
    76     function :: args =>
       
    77       if function = (Markup.functionN, Markup.exportN) andalso
       
    78         not (null args) andalso #1 (hd args) = Markup.idN
       
    79       then
       
    80         let
       
    81           val path = Path.expand (Path.explode ("$ISABELLE_EXPORT_TMP/export" ^ serial_string ()));
       
    82           val _ = File.write_list path output;
       
    83         in Protocol_Message.inline (#2 function) (tl args @ [(Markup.fileN, Path.implode path)]) end
       
    84       else raise Output.Protocol_Message props
       
    85   | [] => raise Output.Protocol_Message props);
       
    86 
       
    87 val _ =
       
    88   if Thread_Data.is_virtual then ()
       
    89   else Private_Output.protocol_message_fn := protocol_message;
       
    90 
    70 end;
    91 end;