src/Pure/Tools/dump.scala
changeset 70876 91b311e7d040
parent 70875 a62c34770df9
child 71158 1c58a01a372e
equal deleted inserted replaced
70875:a62c34770df9 70876:91b311e7d040
   215 
   215 
   216     private val processed_theories = Synchronized(Set.empty[String])
   216     private val processed_theories = Synchronized(Set.empty[String])
   217 
   217 
   218     def process_theory(theory: String): Boolean =
   218     def process_theory(theory: String): Boolean =
   219       processed_theories.change_result(processed => (!processed(theory), processed + theory))
   219       processed_theories.change_result(processed => (!processed(theory), processed + theory))
       
   220 
       
   221 
       
   222     /* errors */
       
   223 
       
   224     private val errors = Synchronized(List.empty[String])
       
   225 
       
   226     def add_errors(more_errs: List[String])
       
   227     {
       
   228       errors.change(errs => errs ::: more_errs)
       
   229     }
       
   230 
       
   231     def check_errors
       
   232     {
       
   233       val errs = errors.value
       
   234       if (errs.nonEmpty) error(errs.mkString("\n\n"))
       
   235     }
   220   }
   236   }
   221 
   237 
   222   class Session private[Dump](
   238   class Session private[Dump](
   223     val context: Context,
   239     val context: Context,
   224     val logic: String,
   240     val logic: String,
   352           use_theories_result.nodes_pending match {
   368           use_theories_result.nodes_pending match {
   353             case Nil => Nil
   369             case Nil => Nil
   354             case pending => List("Pending theories: " + commas(pending.map(p => p._1.toString)))
   370             case pending => List("Pending theories: " + commas(pending.map(p => p._1.toString)))
   355           }
   371           }
   356 
   372 
   357         val errors = bad_msgs ::: pending_msgs
   373         context.add_errors(bad_msgs ::: pending_msgs)
   358         if (errors.nonEmpty) error(errors.mkString("\n\n"))
       
   359       }
   374       }
   360       finally { session.stop() }
   375       finally { session.stop() }
   361     }
   376     }
   362   }
   377   }
   363 
   378 
   392             Aspect_Args(session.options, context.deps, progress, output_dir,
   407             Aspect_Args(session.options, context.deps, progress, output_dir,
   393               args.snapshot, args.status)
   408               args.snapshot, args.status)
   394           aspects.foreach(_.operation(aspect_args))
   409           aspects.foreach(_.operation(aspect_args))
   395         })
   410         })
   396     }
   411     }
       
   412 
       
   413     context.check_errors
   397   }
   414   }
   398 
   415 
   399 
   416 
   400   /* Isabelle tool wrapper */
   417   /* Isabelle tool wrapper */
   401 
   418