tuxji commented on a change in pull request #748:
URL: https://github.com/apache/daffodil/pull/748#discussion_r801849377



##########
File path: 
daffodil-core/src/main/scala/org/apache/daffodil/grammar/AlignedMixin.scala
##########
@@ -202,9 +202,15 @@ trait AlignedMixin extends GrammarMixin { self: Term =>
       val parentAlignmentApprox =

Review comment:
       GitHub won't let me attach a comment to an earlier line, but if you 
expand your view up, you will see that this section of code is inside a lazy 
value's definition (`priorAlignmentApprox`) and there's a comment at line 133 
referencing another bug, 
[DAFFODIL-2295](https://issues.apache.org/jira/projects/DAFFODIL/issues/DAFFODIL-2295?filter=allopenissues).
  I read the bug and it's unrelated (handling a text separator preceding this 
term), but I thought I would mention that another open issue also exists 
although it has minor priority and I didn't find any other occurrence of "2995" 
such as a test for checking it's fixed.

##########
File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dsom/SchemaComponent.scala
##########
@@ -141,6 +141,17 @@ trait SchemaComponent
     res.distinct
   }
 
+  /**
+   * The lexically enclosing term, if one exists
+   */
+  final lazy val optEnclosingLexicalTerm: Option[Term] = {
+    optLexicalParent match {
+      case Some(t: Term) => Some(t)
+      case Some(sc: SchemaComponent) => sc.optEnclosingLexicalTerm
+      case _ => None

Review comment:
       I don't see any problem with this function even though it calls itself 
recursively on SchemaComponent (eventually it must hit either a Term or a Root 
and terminate).  I'm simply curious how schemas are represented in memory.  A 
schema always has an optically enclosing Root, right, then the Root has 
lexically enclosed children with children of their own, and are the first level 
children a mix of different types (SchemaComponent, Term, and what other types 
fall into the _ case?) or all one type (GlobalDecl)?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to