We need to override ~ of Parser so that we can consume/omit whitespace separating sub-expressions.
We need to override ~ of Parser so that we can consume/omit whitespace separating sub-expressions.
Before this fix the following would occur:
Given: { ../../e1 eq 1 }
Was interpreted as: { ../../e1eq1 }
This was incorrect.
String literal must be one regex, not separate combinators combined.
String literal must be one regex, not separate combinators combined.
This is to avoid whitespace collapsing inside string literals. We want whitespace to be ignored outside string literals, but not inside them.
(Changed in version 2.9.0) The p0
call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
A helper method that turns a Parser
into one that will
print debugging information to stdout before and after
being applied.
Parses DPath expressions. Most real analysis is done later. This is just the syntax being legal so that we can build the abstract syntax tree (of ElementBase-derived classes).
Use isEvaluatedAbove for expressions that are evaluated in a parent context around the element where they are expressed (e.g., occursCount)
One goal of this object, and the reason it is yet another separate compiler object, is that it uses Scala's Combinator parsers, which have been known to cause memory leaks. This class is transient. We never save it. So hopefully that discards all the state of the combinator stuff as well.