You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an optional parser parses nothing, it's range becomes 0..0, because of the fallback here. This error will bubble up, e.g. when the optional is inside an "and" parser.
Example:
val integerExpression by (optional(MINUS) *INT)
If there is no - to parse, the start of the range of the SyntaxTree corresponding to a match of integerExpression will always start at 0, regardless of where the match happens. So if the input where Hello World! 5 (and imagine integerExpression is part of a larger parser that can also parse words), the actual range would be 0..14, while the expected range would be 13..14.
Do you have any pointers how this could be best resolved?
The text was updated successfully, but these errors were encountered:
When an optional parser parses nothing, it's range becomes 0..0, because of the fallback here. This error will bubble up, e.g. when the optional is inside an "and" parser.
Example:
If there is no
-
to parse, the start of the range of theSyntaxTree
corresponding to a match ofintegerExpression
will always start at0
, regardless of where the match happens. So if the input whereHello World! 5
(and imagineintegerExpression
is part of a larger parser that can also parse words), the actual range would be0..14
, while the expected range would be13..14
.Do you have any pointers how this could be best resolved?
The text was updated successfully, but these errors were encountered: