src/Pure/System/command_line.ML
author wenzelm
Sun, 05 Aug 2012 13:42:21 +0200
changeset 48681 181b91e1d1c1
child 48731 a45ba78abcc1
permissions -rw-r--r--
prefer general Command_Line.tool wrapper (cf. Scala version);
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
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
     9
  val tool: (unit -> int) -> 'a
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);
181b91e1d1c1 prefer general Command_Line.tool wrapper (cf. Scala version);
wenzelm
parents:
diff changeset
    20
    in exit rc; raise Fail "ERROR" end) ();
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