src/Pure/System/invoke_scala.scala
changeset 49470 ee564db2649b
parent 49173 fa01a202399c
child 52111 1fd184eaa310
equal deleted inserted replaced
49469:00c301c8d569 49470:ee564db2649b
    47   {
    47   {
    48     val NULL = Value("0")
    48     val NULL = Value("0")
    49     val OK = Value("1")
    49     val OK = Value("1")
    50     val ERROR = Value("2")
    50     val ERROR = Value("2")
    51     val FAIL = Value("3")
    51     val FAIL = Value("3")
       
    52     val INTERRUPT = Value("4")
    52   }
    53   }
    53 
    54 
    54   def method(name: String, arg: String): (Tag.Value, String) =
    55   def method(name: String, arg: String): (Tag.Value, String) =
    55     Exn.capture { get_method(name) } match {
    56     Exn.capture { get_method(name) } match {
    56       case Exn.Res(f) =>
    57       case Exn.Res(f) =>
    57         Exn.capture { f(arg) } match {
    58         Exn.capture { f(arg) } match {
    58           case Exn.Res(null) => (Tag.NULL, "")
    59           case Exn.Res(null) => (Tag.NULL, "")
    59           case Exn.Res(res) => (Tag.OK, res)
    60           case Exn.Res(res) => (Tag.OK, res)
       
    61           case Exn.Exn(_: InterruptedException) => (Tag.INTERRUPT, "")
    60           case Exn.Exn(e) => (Tag.ERROR, Exn.message(e))
    62           case Exn.Exn(e) => (Tag.ERROR, Exn.message(e))
    61         }
    63         }
    62       case Exn.Exn(e) => (Tag.FAIL, Exn.message(e))
    64       case Exn.Exn(e) => (Tag.FAIL, Exn.message(e))
    63     }
    65     }
    64 }
    66 }