Replies: 4 comments 5 replies
-
Hey @smydo,
What does validity mean for you in this context? Chevrotain parsers won't necessarily throw on invalid input (one that doesn't match the expected grammar), but save the error on the
The parser isn't necessarily greedy (the lookahead will fail on the |
Beta Was this translation helpful? Give feedback.
-
I must be doing somthing fundamentally wrong, I've included the parser code an lexer tokens files. I call the parser function like this: parserFunction(<expressiontext.); |
Beta Was this translation helpful? Give feedback.
-
Sorry again @msujew that was madness to think you'd engage with 2 files , try this apex app, you'll be able to see everything I mean: |
Beta Was this translation helpful? Give feedback.
-
Hi All
Hopefully someone can help me understand where my Rule definition is going wrong. I have the following sql based single condition rule definition (simplified for this discussion):
I expect this to allow for n number of chained values seperated by an arithmetic operator (ValueSeperator) which must be followed by a relational operator combined with another chain of n numbered values i.e. for this to be valid:
a + b +c = d + e +f
This does prove to be valid but I would also expect that the following will NOT be valid:
a + b a a a = 5
but it is! I expect that the AT_LEAST_ONE_SEP would find fault with the multiple 'a's that have no arithmetic operator seperating them. Checking the parser instance object in debug confirms that these 'a's are held as seperate 'ValueWithoutIn' identifier tokens within the singleCondition (each with the 'lhs label): I didn't think the parser would be 'greedy' and take multiple ValueWithoutIn tokens despite them being in the AT_LEAST_ONE_SEP construct. What am I missing here?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions