src/Pure/System/command_line.ML
author wenzelm
Wed, 08 Aug 2012 12:33:40 +0200
changeset 48731 a45ba78abcc1
parent 48681 181b91e1d1c1
child 51312 0ce544fbb509
permissions -rw-r--r--
more casual exit back to ML toplevel, to accomodate commit in SML/NJ which continues at the saved point;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48681
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
     1
(*  Title:      Pure/System/command_line.ML
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
     3
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
     4
Support for Isabelle/ML command line tools.
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
     5
*)
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
     6
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
     7
signature COMMAND_LINE =
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
     8
sig
48731
a45ba78abcc1 more casual exit back to ML toplevel, to accomodate commit in SML/NJ which continues at the saved point;
wenzelm
parents: 48681
diff changeset
     9
  val tool: (unit -> int) -> unit
48681
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    10
end;
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    11
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    12
structure Command_Line: COMMAND_LINE =
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    13
struct
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    14
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    15
fun tool body =
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    16
  uninterruptible (fn restore_attributes => fn () =>
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    17
    let val rc =
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    18
      restore_attributes body () handle exn =>
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    19
        (Output.error_msg (ML_Compiler.exn_message exn); if Exn.is_interrupt exn then 130 else 1);
48731
a45ba78abcc1 more casual exit back to ML toplevel, to accomodate commit in SML/NJ which continues at the saved point;
wenzelm
parents: 48681
diff changeset
    20
    in if rc = 0 then () else exit rc end) ();
48681
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    21
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    22
end;
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    23