stevedlawrence commented on a change in pull request #158: Daffodil 1080
sequences and separators - preliminary review
URL: https://github.com/apache/incubator-daffodil/pull/158#discussion_r242150852
##########
File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/Term.scala
##########
@@ -434,43 +425,84 @@ trait Term
*/
def isVariableOccurrences: Boolean = false
+ /**
+ * True when a term's immediately enclosing model group is a Sequence.
+ */
+ final lazy val isSequenceChild =
+
immediatelyEnclosingModelGroup.getOrElse(false).isInstanceOf[SequenceTermBase]
Review comment:
If immediately enclosing model group is None, this becomes
false.isInstaneOf[SequenceTermBase], which although I guess is legal and has
the right result, feels odd to me logically. Maybe instead do
```scala
immediatelyEnclosingModelGroup.map(_.isInstanceOf[SequenceTermBase]).getOrElse(false)
```
----------------------------------------------------------------
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