Skip to content

Parse value EITHER as <float> OR as <integer with percentage sign> - grammar or validator? #1800

Answered by msujew
shutterfreak asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @shutterfreak,

usually those restrictions shouldn't be enforced by the parser, as they usually lead to obscure lexer/parser error that aren't helpful for most users to identify the error. Like you said, this should be something ideally done via the validator. Aside from that, here is your fixed grammar that correctly makes use of the predicate.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shutterfreak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants