src/Pure/Thy/sessions.scala
changeset 67024 72d37a2e9cca
parent 67023 e27e05d6f2a7
child 67025 961285f581e6
equal deleted inserted replaced
67023:e27e05d6f2a7 67024:72d37a2e9cca
   173         case Nil => this
   173         case Nil => this
   174         case errs => error(cat_lines(errs))
   174         case errs => error(cat_lines(errs))
   175       }
   175       }
   176   }
   176   }
   177 
   177 
   178   def deps(sessions: T,
   178   def deps(sessions_structure: T,
   179       global_theories: Map[String, String],
   179       global_theories: Map[String, String],
   180       progress: Progress = No_Progress,
   180       progress: Progress = No_Progress,
   181       inlined_files: Boolean = false,
   181       inlined_files: Boolean = false,
   182       verbose: Boolean = false,
   182       verbose: Boolean = false,
   183       list_files: Boolean = false,
   183       list_files: Boolean = false,
   201         }
   201         }
   202       }
   202       }
   203     }
   203     }
   204 
   204 
   205     val session_bases =
   205     val session_bases =
   206       (Map.empty[String, Base] /: sessions.imports_topological_order)({
   206       (Map.empty[String, Base] /: sessions_structure.imports_topological_order)({
   207         case (session_bases, session_name) =>
   207         case (session_bases, session_name) =>
   208           if (progress.stopped) throw Exn.Interrupt()
   208           if (progress.stopped) throw Exn.Interrupt()
   209 
   209 
   210           val info = sessions(session_name)
   210           val info = sessions_structure(session_name)
   211           try {
   211           try {
   212             val parent_base: Sessions.Base =
   212             val parent_base: Sessions.Base =
   213               info.parent match {
   213               info.parent match {
   214                 case None => Base.bootstrap(global_theories)
   214                 case None => Base.bootstrap(global_theories)
   215                 case Some(parent) => session_bases(parent)
   215                 case Some(parent) => session_bases(parent)
   271                   Graph_Display.Node(name.theory_base_name, "theory." + name.theory)
   271                   Graph_Display.Node(name.theory_base_name, "theory." + name.theory)
   272                 else session_node(qualifier)
   272                 else session_node(qualifier)
   273               }
   273               }
   274 
   274 
   275               val imports_subgraph =
   275               val imports_subgraph =
   276                 sessions.imports_graph.restrict(sessions.imports_graph.all_preds(info.deps).toSet)
   276                 sessions_structure.imports_graph.
       
   277                   restrict(sessions_structure.imports_graph.all_preds(info.deps).toSet)
   277 
   278 
   278               val graph0 =
   279               val graph0 =
   279                 (Graph_Display.empty_graph /: imports_subgraph.topological_order)(
   280                 (Graph_Display.empty_graph /: imports_subgraph.topological_order)(
   280                   { case (g, session) =>
   281                   { case (g, session) =>
   281                       val a = session_node(session)
   282                       val a = session_node(session)
   327 
   328 
   328   /* base info */
   329   /* base info */
   329 
   330 
   330   sealed case class Base_Info(
   331   sealed case class Base_Info(
   331     session: String,
   332     session: String,
   332     sessions: T,
   333     sessions_structure: T,
   333     errors: List[String],
   334     errors: List[String],
   334     base: Base,
   335     base: Base,
   335     infos: List[Info])
   336     infos: List[Info])
   336   {
   337   {
   337     def check_base: Base = if (errors.isEmpty) base else error(cat_lines(errors))
   338     def check_base: Base = if (errors.isEmpty) base else error(cat_lines(errors))