src/Pure/Thy/sessions.scala
changeset 66717 67dbf5cdc056
parent 66716 8737b866bd1c
child 66718 514c4907ff0b
     1.1 --- a/src/Pure/Thy/sessions.scala	Fri Sep 29 17:41:39 2017 +0200
     1.2 +++ b/src/Pure/Thy/sessions.scala	Fri Sep 29 20:49:42 2017 +0200
     1.3 @@ -114,7 +114,7 @@
     1.4    sealed case class Base(
     1.5      pos: Position.T = Position.none,
     1.6      global_theories: Map[String, String] = Map.empty,
     1.7 -    loaded_theories: Set[String] = Set.empty,
     1.8 +    loaded_theories: Graph[String, Outer_Syntax] = Graph.string,
     1.9      known: Known = Known.empty,
    1.10      keywords: Thy_Header.Keywords = Nil,
    1.11      syntax: Outer_Syntax = Outer_Syntax.empty,
    1.12 @@ -126,9 +126,14 @@
    1.13      def platform_path: Base = copy(known = known.platform_path)
    1.14      def standard_path: Base = copy(known = known.standard_path)
    1.15  
    1.16 -    def loaded_theory(name: String): Boolean = loaded_theories.contains(name)
    1.17 +    def loaded_theory(name: String): Boolean = loaded_theories.defined(name)
    1.18      def loaded_theory(name: Document.Node.Name): Boolean = loaded_theory(name.theory)
    1.19  
    1.20 +    def loaded_theory_syntax(name: String): Option[Outer_Syntax] =
    1.21 +      if (loaded_theory(name)) Some(loaded_theories.get_node(name)) else None
    1.22 +    def loaded_theory_syntax(name: Document.Node.Name): Option[Outer_Syntax] =
    1.23 +      loaded_theory_syntax(name.theory)
    1.24 +
    1.25      def known_theory(name: String): Option[Document.Node.Name] =
    1.26        known.theories.get(name)
    1.27