equal
deleted
inserted
replaced
148 } |
148 } |
149 |
149 |
150 def global_theory(theory: String): Boolean = |
150 def global_theory(theory: String): Boolean = |
151 sessions_structure.global_theories.isDefinedAt(theory) |
151 sessions_structure.global_theories.isDefinedAt(theory) |
152 |
152 |
|
153 def literal_theory(theory: String): Boolean = |
|
154 Long_Name.is_qualified(theory) || global_theory(theory) |
|
155 |
153 def theory_name(qualifier: String, theory: String): String = |
156 def theory_name(qualifier: String, theory: String): String = |
154 if (Long_Name.is_qualified(theory) || global_theory(theory)) theory |
157 if (literal_theory(theory)) theory |
155 else Long_Name.qualify(qualifier, theory) |
158 else Long_Name.qualify(qualifier, theory) |
156 |
159 |
157 def find_theory_node(theory: String): Option[Document.Node.Name] = { |
160 def find_theory_node(theory: String): Option[Document.Node.Name] = { |
158 val thy_file = Path.basic(Long_Name.base_name(theory)).thy |
161 val thy_file = Path.basic(Long_Name.base_name(theory)).thy |
159 val session = sessions_structure.theory_qualifier(theory) |
162 val session = sessions_structure.theory_qualifier(theory) |
171 if (session_base.loaded_theory(theory)) loaded_theory_node(theory) |
174 if (session_base.loaded_theory(theory)) loaded_theory_node(theory) |
172 else { |
175 else { |
173 find_theory_node(theory) match { |
176 find_theory_node(theory) match { |
174 case Some(node_name) => node_name |
177 case Some(node_name) => node_name |
175 case None => |
178 case None => |
176 if (Thy_Header.is_base_name(s) && Long_Name.is_qualified(s)) loaded_theory_node(theory) |
179 if (Thy_Header.is_base_name(s) && literal_theory(s)) loaded_theory_node(theory) |
177 else file_node(Path.explode(s).thy, dir = dir, theory = theory) |
180 else file_node(Path.explode(s).thy, dir = dir, theory = theory) |
178 } |
181 } |
179 } |
182 } |
180 } |
183 } |
181 |
184 |