equal
deleted
inserted
replaced
91 thms.iterator.map(_.no_content) ++ |
91 thms.iterator.map(_.no_content) ++ |
92 classes.iterator.map(_.no_content) ++ |
92 classes.iterator.map(_.no_content) ++ |
93 locales.iterator.map(_.no_content) ++ |
93 locales.iterator.map(_.no_content) ++ |
94 locale_dependencies.iterator.map(_.no_content) ++ |
94 locale_dependencies.iterator.map(_.no_content) ++ |
95 (for { (_, xs) <- others; x <- xs.iterator } yield x.no_content) |
95 (for { (_, xs) <- others; x <- xs.iterator } yield x.no_content) |
|
96 |
|
97 lazy val entity_by_range: Map[Symbol.Range, List[Entity[No_Content]]] = |
|
98 entity_iterator.toList.groupBy(_.range) |
|
99 |
|
100 lazy val entity_by_kname: Map[String, Entity[No_Content]] = |
|
101 entity_iterator.map(entity => (entity.kname, entity)).toMap |
96 |
102 |
97 lazy val entity_kinds: Set[String] = |
103 lazy val entity_kinds: Set[String] = |
98 entity_iterator.map(_.kind).toSet |
104 entity_iterator.map(_.kind).toSet |
99 |
105 |
100 def cache(cache: Term.Cache): Theory = |
106 def cache(cache: Term.Cache): Theory = |
122 else { |
128 else { |
123 provider(Export.THEORY_PREFIX + "parents") |
129 provider(Export.THEORY_PREFIX + "parents") |
124 .map(entry => split_lines(entry.uncompressed.text)) |
130 .map(entry => split_lines(entry.uncompressed.text)) |
125 } |
131 } |
126 } |
132 } |
|
133 |
|
134 def no_theory: Theory = |
|
135 Theory("", Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Map.empty) |
127 |
136 |
128 def read_theory(provider: Export.Provider, session_name: String, theory_name: String, |
137 def read_theory(provider: Export.Provider, session_name: String, theory_name: String, |
129 cache: Term.Cache = Term.Cache.none): Theory = |
138 cache: Term.Cache = Term.Cache.none): Theory = |
130 { |
139 { |
131 val parents = |
140 val parents = |
189 def export_kind(kind: String): String = |
198 def export_kind(kind: String): String = |
190 if (kind == Markup.TYPE_NAME) Kind.TYPE |
199 if (kind == Markup.TYPE_NAME) Kind.TYPE |
191 else if (kind == Markup.CONSTANT) Kind.CONST |
200 else if (kind == Markup.CONSTANT) Kind.CONST |
192 else kind |
201 else kind |
193 |
202 |
|
203 def export_kind_name(kind: String, name: String): String = |
|
204 name + "|" + export_kind(kind) |
|
205 |
194 abstract class Content[T] |
206 abstract class Content[T] |
195 { |
207 { |
196 def cache(cache: Term.Cache): T |
208 def cache(cache: Term.Cache): T |
197 } |
209 } |
198 sealed case class No_Content() extends Content[No_Content] |
210 sealed case class No_Content() extends Content[No_Content] |
206 pos: Position.T, |
218 pos: Position.T, |
207 id: Option[Long], |
219 id: Option[Long], |
208 serial: Long, |
220 serial: Long, |
209 content: Option[A]) |
221 content: Option[A]) |
210 { |
222 { |
|
223 val kname: String = export_kind_name(kind, name) |
|
224 val range: Symbol.Range = Position.Range.unapply(pos).getOrElse(Text.Range.offside) |
|
225 |
211 def export_kind: String = Export_Theory.export_kind(kind) |
226 def export_kind: String = Export_Theory.export_kind(kind) |
212 override def toString: String = export_kind + " " + quote(name) |
227 override def toString: String = export_kind + " " + quote(name) |
213 |
228 |
214 def the_content: A = |
229 def the_content: A = |
215 if (content.isDefined) content.get else error("No content for " + toString) |
230 if (content.isDefined) content.get else error("No content for " + toString) |