tuned signature;
authorwenzelm
Sun, 14 Feb 2016 12:03:32 +0100
changeset 62303 f868f12f9419
parent 62302 236e1ea5a197
child 62304 e7a52a838a23
tuned signature;
src/Pure/Concurrent/bash.scala
src/Pure/Tools/build.scala
src/Pure/Tools/check_source.scala
--- a/src/Pure/Concurrent/bash.scala	Sun Feb 14 11:52:27 2016 +0100
+++ b/src/Pure/Concurrent/bash.scala	Sun Feb 14 12:03:32 2016 +0100
@@ -19,12 +19,13 @@
   {
     def out: String = cat_lines(out_lines)
     def err: String = cat_lines(err_lines)
-    def add_err(s: String): Result = copy(err_lines = err_lines ::: List(s))
-    def set_rc(i: Int): Result = copy(rc = i)
+
+    def error(s: String, err_rc: Int = 0): Result =
+      copy(err_lines = err_lines ::: List(s), rc = rc max err_rc)
 
-    def check_error: Result =
+    def check: Result =
       if (rc == Exn.Interrupt.return_code) throw Exn.Interrupt()
-      else if (rc != 0) error(err)
+      else if (rc != 0) Library.error(err)
       else this
 
     def print: Result =
--- a/src/Pure/Tools/build.scala	Sun Feb 14 11:52:27 2016 +0100
+++ b/src/Pure/Tools/build.scala	Sun Feb 14 12:03:32 2016 +0100
@@ -640,8 +640,8 @@
       timeout_request.foreach(_.cancel)
 
       if (res.rc == Exn.Interrupt.return_code) {
-        if (was_timeout) res.add_err(Output.error_text("Timeout")).set_rc(1)
-        else res.add_err(Output.error_text("Interrupt"))
+        if (was_timeout) res.error(Output.error_text("Timeout"), 1)
+        else res.error(Output.error_text("Interrupt"))
       }
       else res
     }
--- a/src/Pure/Tools/check_source.scala	Sun Feb 14 11:52:27 2016 +0100
+++ b/src/Pure/Tools/check_source.scala	Sun Feb 14 12:03:32 2016 +0100
@@ -41,9 +41,9 @@
   def check_hg(root: Path)
   {
     Output.writeln("Checking " + root + " ...")
-    Isabelle_System.hg("--repository " + File.shell_path(root) + " root").check_error
+    Isabelle_System.hg("--repository " + File.shell_path(root) + " root").check
     for {
-      file <- Isabelle_System.hg("manifest", root).check_error.out_lines
+      file <- Isabelle_System.hg("manifest", root).check.out_lines
       if file.endsWith(".thy") || file.endsWith(".ML") || file.endsWith("/ROOT")
     } check_file(root + Path.explode(file))
   }