src/Pure/System/bash.scala
author wenzelm
Thu, 06 Aug 2020 22:58:18 +0200
changeset 72105 a1fb4d28e609
parent 71712 c6b7f4da67b3
child 72598 d9f2be66ebad
permissions -rw-r--r--
unused --- superseded by PIDE messages;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62584
6cd36a0d2a28 clarified files;
wenzelm
parents: 62574
diff changeset
     1
/*  Title:      Pure/System/bash.scala
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
     3
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
     4
GNU bash processes, with propagation of interrupts.
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
     5
*/
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
     6
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
     7
package isabelle
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
     8
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
     9
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    10
import java.io.{File => JFile, BufferedReader, InputStreamReader,
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    11
  BufferedWriter, OutputStreamWriter}
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    12
71706
wenzelm
parents: 71705
diff changeset
    13
import scala.annotation.tailrec
wenzelm
parents: 71705
diff changeset
    14
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    15
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    16
object Bash
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    17
{
64304
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    18
  /* concrete syntax */
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    19
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    20
  private def bash_chr(c: Byte): String =
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    21
  {
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    22
    val ch = c.toChar
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    23
    ch match {
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    24
      case '\t' => "$'\\t'"
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    25
      case '\n' => "$'\\n'"
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    26
      case '\f' => "$'\\f'"
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    27
      case '\r' => "$'\\r'"
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    28
      case _ =>
67200
wenzelm
parents: 65317
diff changeset
    29
        if (Symbol.is_ascii_letter(ch) || Symbol.is_ascii_digit(ch) || "+,-./:_".contains(ch))
64304
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    30
          Symbol.ascii(ch)
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    31
        else if (c < 0) "$'\\x" + Integer.toHexString(256 + c) + "'"
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    32
        else if (c < 16) "$'\\x0" + Integer.toHexString(c) + "'"
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    33
        else if (c < 32 || c >= 127) "$'\\x" + Integer.toHexString(c) + "'"
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    34
        else  "\\" + ch
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    35
    }
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    36
  }
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    37
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    38
  def string(s: String): String =
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    39
    if (s == "") "\"\""
71601
97ccf48c2f0c misc tuning based on hints by IntelliJ IDEA;
wenzelm
parents: 67200
diff changeset
    40
    else UTF8.bytes(s).iterator.map(bash_chr).mkString
64304
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    41
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    42
  def strings(ss: List[String]): String =
71601
97ccf48c2f0c misc tuning based on hints by IntelliJ IDEA;
wenzelm
parents: 67200
diff changeset
    43
    ss.iterator.map(Bash.string).mkString(" ")
64304
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    44
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    45
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    46
  /* process and result */
96bc94c87a81 clarified modules;
wenzelm
parents: 63996
diff changeset
    47
62545
8ebffdaf2ce2 Bash.process always uses a closed script instead of an open argument list, for extra robustness on Windows, where quoting is not well-defined;
wenzelm
parents: 62543
diff changeset
    48
  def process(script: String,
62573
27f90319a499 isabelle.Build uses ML_Process directly;
wenzelm
parents: 62569
diff changeset
    49
      cwd: JFile = null,
62610
4c89504c76fb more uniform signature for various process invocations;
wenzelm
parents: 62604
diff changeset
    50
      env: Map[String, String] = Isabelle_System.settings(),
62602
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
    51
      redirect: Boolean = false,
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
    52
      cleanup: () => Unit = () => ()): Process =
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
    53
    new Process(script, cwd, env, redirect, cleanup)
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    54
63996
3f47fec9edfc tuned whitespace;
wenzelm
parents: 63805
diff changeset
    55
  class Process private[Bash](
62602
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
    56
      script: String,
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
    57
      cwd: JFile,
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
    58
      env: Map[String, String],
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
    59
      redirect: Boolean,
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
    60
      cleanup: () => Unit)
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    61
  {
62604
wenzelm
parents: 62602
diff changeset
    62
    private val timing_file = Isabelle_System.tmp_file("bash_timing")
62569
5db10482f4cf bash process with builtin timing;
wenzelm
parents: 62558
diff changeset
    63
    private val timing = Synchronized[Option[Timing]](None)
65317
b9f5cd845616 more informative session result;
wenzelm
parents: 65316
diff changeset
    64
    def get_timing: Timing = timing.value getOrElse Timing.zero
62569
5db10482f4cf bash process with builtin timing;
wenzelm
parents: 62558
diff changeset
    65
5db10482f4cf bash process with builtin timing;
wenzelm
parents: 62558
diff changeset
    66
    private val script_file = Isabelle_System.tmp_file("bash_script")
62545
8ebffdaf2ce2 Bash.process always uses a closed script instead of an open argument list, for extra robustness on Windows, where quoting is not well-defined;
wenzelm
parents: 62543
diff changeset
    67
    File.write(script_file, script)
8ebffdaf2ce2 Bash.process always uses a closed script instead of an open argument list, for extra robustness on Windows, where quoting is not well-defined;
wenzelm
parents: 62543
diff changeset
    68
62296
b04a5ddd6121 clarified bash process -- similar to ML version;
wenzelm
parents: 61025
diff changeset
    69
    private val proc =
62610
4c89504c76fb more uniform signature for various process invocations;
wenzelm
parents: 62604
diff changeset
    70
      Isabelle_System.process(
4c89504c76fb more uniform signature for various process invocations;
wenzelm
parents: 62604
diff changeset
    71
        List(File.platform_path(Path.variable("ISABELLE_BASH_PROCESS")), "-",
4c89504c76fb more uniform signature for various process invocations;
wenzelm
parents: 62604
diff changeset
    72
          File.standard_path(timing_file), "bash", File.standard_path(script_file)),
4c89504c76fb more uniform signature for various process invocations;
wenzelm
parents: 62604
diff changeset
    73
        cwd = cwd, env = env, redirect = redirect)
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    74
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    75
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    76
    // channels
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    77
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    78
    val stdin: BufferedWriter =
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    79
      new BufferedWriter(new OutputStreamWriter(proc.getOutputStream, UTF8.charset))
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    80
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    81
    val stdout: BufferedReader =
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    82
      new BufferedReader(new InputStreamReader(proc.getInputStream, UTF8.charset))
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    83
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    84
    val stderr: BufferedReader =
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    85
      new BufferedReader(new InputStreamReader(proc.getErrorStream, UTF8.charset))
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    86
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    87
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    88
    // signals
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    89
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    90
    private val pid = stdout.readLine
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    91
71707
wenzelm
parents: 71706
diff changeset
    92
    @tailrec private def kill(signal: String, count: Int = 1): Boolean =
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
    93
    {
71706
wenzelm
parents: 71705
diff changeset
    94
      count <= 0 ||
wenzelm
parents: 71705
diff changeset
    95
      {
71707
wenzelm
parents: 71706
diff changeset
    96
        Isabelle_System.kill(signal, pid)
wenzelm
parents: 71706
diff changeset
    97
        val running = Isabelle_System.kill("0", pid)._2 == 0
wenzelm
parents: 71706
diff changeset
    98
        if (running) {
71705
7b75d52a1bf1 clarified interrupt handling;
wenzelm
parents: 71684
diff changeset
    99
          Time.seconds(0.1).sleep
71707
wenzelm
parents: 71706
diff changeset
   100
          kill(signal, count - 1)
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   101
        }
71706
wenzelm
parents: 71705
diff changeset
   102
        else false
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   103
      }
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   104
    }
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   105
71712
c6b7f4da67b3 more robust kill: not always running on Isabelle_Thread (e.g. POSIX_Interrupt handler);
wenzelm
parents: 71708
diff changeset
   106
    def terminate(): Unit = Isabelle_Thread.try_uninterruptible
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   107
    {
71708
dd9fc8a3036c terminate faster;
wenzelm
parents: 71707
diff changeset
   108
      kill("INT", count = 7) && kill("TERM", count = 3) && kill("KILL")
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   109
      proc.destroy
62602
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
   110
      do_cleanup()
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   111
    }
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   112
71712
c6b7f4da67b3 more robust kill: not always running on Isabelle_Thread (e.g. POSIX_Interrupt handler);
wenzelm
parents: 71708
diff changeset
   113
    def interrupt(): Unit = Isabelle_Thread.try_uninterruptible
71705
7b75d52a1bf1 clarified interrupt handling;
wenzelm
parents: 71684
diff changeset
   114
    {
7b75d52a1bf1 clarified interrupt handling;
wenzelm
parents: 71684
diff changeset
   115
      Isabelle_System.kill("INT", pid)
7b75d52a1bf1 clarified interrupt handling;
wenzelm
parents: 71684
diff changeset
   116
    }
7b75d52a1bf1 clarified interrupt handling;
wenzelm
parents: 71684
diff changeset
   117
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   118
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   119
    // JVM shutdown hook
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   120
71712
c6b7f4da67b3 more robust kill: not always running on Isabelle_Thread (e.g. POSIX_Interrupt handler);
wenzelm
parents: 71708
diff changeset
   121
    private val shutdown_hook = Isabelle_Thread.create(() => terminate())
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   122
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   123
    try { Runtime.getRuntime.addShutdownHook(shutdown_hook) }
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   124
    catch { case _: IllegalStateException => }
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   125
62545
8ebffdaf2ce2 Bash.process always uses a closed script instead of an open argument list, for extra robustness on Windows, where quoting is not well-defined;
wenzelm
parents: 62543
diff changeset
   126
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   127
    // cleanup
62545
8ebffdaf2ce2 Bash.process always uses a closed script instead of an open argument list, for extra robustness on Windows, where quoting is not well-defined;
wenzelm
parents: 62543
diff changeset
   128
62602
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
   129
    private def do_cleanup()
62545
8ebffdaf2ce2 Bash.process always uses a closed script instead of an open argument list, for extra robustness on Windows, where quoting is not well-defined;
wenzelm
parents: 62543
diff changeset
   130
    {
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   131
      try { Runtime.getRuntime.removeShutdownHook(shutdown_hook) }
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   132
      catch { case _: IllegalStateException => }
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   133
62545
8ebffdaf2ce2 Bash.process always uses a closed script instead of an open argument list, for extra robustness on Windows, where quoting is not well-defined;
wenzelm
parents: 62543
diff changeset
   134
      script_file.delete
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   135
62569
5db10482f4cf bash process with builtin timing;
wenzelm
parents: 62558
diff changeset
   136
      timing.change {
5db10482f4cf bash process with builtin timing;
wenzelm
parents: 62558
diff changeset
   137
        case None =>
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   138
          if (timing_file.isFile) {
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   139
            val t =
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   140
              Word.explode(File.read(timing_file)) match {
63805
c272680df665 clarified modules;
wenzelm
parents: 62610
diff changeset
   141
                case List(Value.Long(elapsed), Value.Long(cpu)) =>
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   142
                  Timing(Time.ms(elapsed), Time.ms(cpu), Time.zero)
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   143
                case _ => Timing.zero
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   144
              }
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   145
            timing_file.delete
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   146
            Some(t)
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   147
          }
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   148
          else Some(Timing.zero)
62569
5db10482f4cf bash process with builtin timing;
wenzelm
parents: 62558
diff changeset
   149
        case some => some
5db10482f4cf bash process with builtin timing;
wenzelm
parents: 62558
diff changeset
   150
      }
62602
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
   151
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
   152
      cleanup()
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   153
    }
62569
5db10482f4cf bash process with builtin timing;
wenzelm
parents: 62558
diff changeset
   154
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   155
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   156
    // join
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   157
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   158
    def join: Int =
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   159
    {
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   160
      val rc = proc.waitFor
62602
96e679f042ec more thorough cleanup -- in Scala;
wenzelm
parents: 62584
diff changeset
   161
      do_cleanup()
62545
8ebffdaf2ce2 Bash.process always uses a closed script instead of an open argument list, for extra robustness on Windows, where quoting is not well-defined;
wenzelm
parents: 62543
diff changeset
   162
      rc
8ebffdaf2ce2 Bash.process always uses a closed script instead of an open argument list, for extra robustness on Windows, where quoting is not well-defined;
wenzelm
parents: 62543
diff changeset
   163
    }
62543
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   164
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   165
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   166
    // result
62543
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   167
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   168
    def result(
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   169
      progress_stdout: String => Unit = (_: String) => (),
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   170
      progress_stderr: String => Unit = (_: String) => (),
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   171
      strict: Boolean = true): Process_Result =
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   172
    {
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   173
      stdin.close
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   174
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   175
      val out_lines =
72105
a1fb4d28e609 unused --- superseded by PIDE messages;
wenzelm
parents: 71712
diff changeset
   176
        Future.thread("bash_stdout") { File.read_lines(stdout, progress_stdout) }
62543
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   177
      val err_lines =
72105
a1fb4d28e609 unused --- superseded by PIDE messages;
wenzelm
parents: 71712
diff changeset
   178
        Future.thread("bash_stderr") { File.read_lines(stderr, progress_stderr) }
62543
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   179
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   180
      val rc =
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   181
        try { join }
62574
ec382bc689e5 more robust cleanup;
wenzelm
parents: 62573
diff changeset
   182
        catch { case Exn.Interrupt() => terminate(); Exn.Interrupt.return_code }
62543
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   183
      if (strict && rc == Exn.Interrupt.return_code) throw Exn.Interrupt()
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   184
65317
b9f5cd845616 more informative session result;
wenzelm
parents: 65316
diff changeset
   185
      Process_Result(rc, out_lines.join, err_lines.join, false, get_timing)
62543
57f379ef662f clarified modules;
wenzelm
parents: 62400
diff changeset
   186
    }
60991
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   187
  }
2fc5a44346b5 clarified modules, like ML version;
wenzelm
parents:
diff changeset
   188
}