mbeckerle commented on a change in pull request #88: Daffodil 1919 separators
URL: https://github.com/apache/incubator-daffodil/pull/88#discussion_r208390296
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/ParticleMixin.scala
##########
@@ -117,23 +140,31 @@ trait ParticleMixin extends RequiredOptionalMixin {
self: ElementBase =>
case _ => max.toInt
}
}
+
+ /**
+ * Can have a varying number of occurrences.
+ */
+ final override lazy val isVariableOccurrences = minOccurs != maxOccurs
final lazy val isFixedOccurrences = {
- // TODO optimizations to take scope into consideration. E.g.,
+ // TODO maybe do optimizations to take scope into consideration. E.g.,
// We could be in a context where the value of our occursCount expression
// will always be a constant.
occursCountKind == OccursCountKind.Fixed
}
Review comment:
Some of these predicates are old and stale, that is to say they were created
a long time back, and we have since determined that more complex predicates
that take OCK into account (for example) are needed.
The point of this one is for code that cares about fixed occurrences count
to use this so that it will not be changed if an analysis at some point
determines that the occursCount expression will be constant over the scope. I
don't know that this is worth the complexity. Certainly this should have an
Assert.invariant(!isScalar) because calling this on a scalar is almost
certainly incorrect.
I will revisit this and the one above.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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