src/Pure/System/process_result.scala
changeset 64408 50bcf976f276
parent 64138 cf0c8c5782af
child 68091 0c7820590236
equal deleted inserted replaced
64407:5c5b9d945625 64408:50bcf976f276
    20   def was_timeout: Process_Result = copy(rc = 1, timeout = true)
    20   def was_timeout: Process_Result = copy(rc = 1, timeout = true)
    21 
    21 
    22   def ok: Boolean = rc == 0
    22   def ok: Boolean = rc == 0
    23   def interrupted: Boolean = rc == Exn.Interrupt.return_code
    23   def interrupted: Boolean = rc == Exn.Interrupt.return_code
    24 
    24 
    25   def check: Process_Result =
    25   def check_rc(pred: Int => Boolean): Process_Result =
    26     if (ok) this
    26     if (pred(rc)) this
    27     else if (interrupted) throw Exn.Interrupt()
    27     else if (interrupted) throw Exn.Interrupt()
    28     else Exn.error(err)
    28     else Exn.error(err)
       
    29 
       
    30   def check: Process_Result = check_rc(_ == 0)
    29 
    31 
    30   def print: Process_Result =
    32   def print: Process_Result =
    31   {
    33   {
    32     Output.warning(err)
    34     Output.warning(err)
    33     Output.writeln(out)
    35     Output.writeln(out)