mbeckerle commented on a change in pull request #257: Daffodil 2165 type calc
double functions
URL: https://github.com/apache/incubator-daffodil/pull/257#discussion_r299623228
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/dpath/DPathRuntime.scala
##########
@@ -95,7 +99,7 @@ class CompiledDPath(val ops: RecipeOp*) extends Serializable
{
// in a way that is not consistent with a constant expression. Such as
trying to do
// anything with the infoset other than saving and restoring current
position in the infoset.
// Ditto trying to read a variable.
- case _: InfosetException | _: VariableException | _:
java.lang.IllegalStateException =>
+ case _: InfosetException | _: VariableException | _:
NoSuchElementException | _: java.lang.IllegalStateException =>
Review comment:
NoSuchElementException is a Daffodil exception isn't it? (Maybe we should
rename it if that's ambiguous.) It is heavily used by Unparsing as the
indicator that an expression which is forward referencing, is not ready to be
evaluated yet and should be retried in the future.
At parse time the same exception is used to indicate an expression with a
path step for which the corresponding element isn't in the infoset (yet at
least - it has to be possible or the expression wouldn't compile, but for
whatever reason the parse path didn't put it there when the expression was
evaluated at runtime.)
When doing constant folding, if you touch the infoset at all, you get
NoSuchElementException, or so I thought, and that indicates, well, that you
were touching the infoset so the expression is non-constant. (Or close enough
anyway.)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services