mbeckerle commented on a change in pull request #259: Incremental progress on
schema compilation space/speed issue.
URL: https://github.com/apache/incubator-daffodil/pull/259#discussion_r301240753
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/SchemaComponent.scala
##########
@@ -148,17 +174,30 @@ trait SchemaComponent
et
}
+ /**
+ * The terms that can enclose this.
+ *
+ * Even if this is already a term, this walks outward to find
+ * those enclosing this.
+ */
final lazy val enclosingTerms: Seq[Term] = {
+ // if (this.shortSchemaComponentDesignator == "e=ex:a:ct:s:e2={}c:ct:s")
+ // println("found it")
val ec = enclosingComponents.map { _.encloser }
- val et = ec.flatMap { sc =>
+ val res = ec.flatMap { sc =>
sc match {
case t: Term => Seq(t)
- case ct: ComplexTypeBase => ct.enclosingTerms
- case gedf: GlobalElementDeclFactory => gedf.enclosingComponents.map {
_.encloser }.flatMap { _.enclosingTerms }
- case _ => Assert.invariantFailed("Should only be Term or ComplexType")
+ case sd: SchemaDocument => Nil
+ case other => other.enclosingComponents.map { _.encloser }.flatMap {
+ case t: Term => Seq(t)
+ case x => x.enclosingTerms
+ }
}
}
- et
+ // System.err.println("enclosingTerms: Component " +
this.shortSchemaComponentDesignator + (
Review comment:
remove
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services