You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "mbeckerle (via GitHub)" <gi...@apache.org> on 2023/02/23 21:14:22 UTC

[GitHub] [daffodil] mbeckerle commented on a diff in pull request #967: Consider ChoiceGroupRef's open when determining next elements

mbeckerle commented on code in PR #967:
URL: https://github.com/apache/daffodil/pull/967#discussion_r1116251273


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/runtime1/TermRuntime1Mixin.scala:
##########
@@ -354,8 +355,12 @@ trait TermRuntime1Mixin { self: Term =>
           case (Closed(pnes1), Closed(pnes2)) => {
             thisItself // When everything is closed, we only want thisItself and not the entire list of Closed possibilities
           }
-          case (Open(pnes1), Closed(pnes2)) => {
+          case (Open(pnes1), Closed(pnes2)) if !this.isInstanceOf[ChoiceGroupRef] => {
             // If there are optional elements before a required element, the whole sequence is considered closed
+            //
+            // If this is a ChoiceGroupRef though, it could be one of multiple group references and thus we may
+            // not have the appropriate context to find the expected following element, so we should remain Open

Review Comment:
   This comment says "so we should remain open", but the next line of code is a Closed.
   
   



##########
daffodil-core/src/main/scala/org/apache/daffodil/core/runtime1/TermRuntime1Mixin.scala:
##########
@@ -354,8 +355,12 @@ trait TermRuntime1Mixin { self: Term =>
           case (Closed(pnes1), Closed(pnes2)) => {
             thisItself // When everything is closed, we only want thisItself and not the entire list of Closed possibilities
           }
-          case (Open(pnes1), Closed(pnes2)) => {
+          case (Open(pnes1), Closed(pnes2)) if !this.isInstanceOf[ChoiceGroupRef] => {

Review Comment:
   This seems ok to me here. 



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org