stevedlawrence commented on code in PR #987:
URL: https://github.com/apache/daffodil/pull/987#discussion_r1904316887


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/Grammar.scala:
##########
@@ -89,10 +90,19 @@ class SeqComp private (context: SchemaComponent, children: 
Seq[Gram])
       _.isInstanceOf[NadaParser]
     }
 
+  lazy val assertExpressionChildren = parserChildren.filter {
+    _.isInstanceOf[AssertExpressionEvaluationParser]

Review Comment:
   Reading the spec some more, it says:
   
   > an attempt to evaluate a discriminator MUST be made even if preceding 
statements or the parse of the schema component ended in a Processing Error. 
   
   I *think* this implies asserts should not be evaluated if the preceding 
statements fails? Which kindof makes sense since an assert only causes 
backtracking and does not discriminate points of uncertainty?
   
   So it feels like the logic needs to differentiate between asserts and 
discriminators? Both should be evaluated at the end, but only discriminators 
should be evaluated if the prior parses succeed?
   
   Another question, are discriminators always evaluated before asserts? Or are 
they evaluated depending on the order defined in the DFDL schema? For example, 
if you have:
   
   ```xml
   <xs:appinfo source="http://www.ogf.org/dfdl/";>
     <dfdl:assert test="..." />
     <dfdl:discriminator test="..." />
     <dfdl:assert test="..." />
   </xs:appinfo>
   ```
   
   Should that evaluate the first assert, then the discriminiator, then second 
assert. I don't know if the spec clarifies that or if it's implied, but I think 
we always evaluate asserts before discrims regardless of how they are defined 
in the schema?



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