We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider the following:
grammar = r""" start: "ABC" """ print(Lark(grammar, ambiguity="forest").parse("ABC"))
Output: (start, 0, 2, -inf)
(start, 0, 2, -inf)
The end index is 2 which suggests that the substring "AB" was parsed. However, we know that the full string was parsed, so the end index should be 3.
Note that the issue does not occur if we use a rule instead:
grammar = r""" start: abc abc: "ABC" """ print(Lark(grammar, ambiguity="forest").parse("ABC"))
Output: (start, 0, 3, -inf)
(start, 0, 3, -inf)
I will open a PR with a fix.
The text was updated successfully, but these errors were encountered:
Fix SymbolNode.end for completed tokens (Issue lark-parser#1431)
2faac23
Successfully merging a pull request may close this issue.
Consider the following:
Output:
(start, 0, 2, -inf)
The end index is 2 which suggests that the substring "AB" was parsed. However, we know that the full string was parsed, so the end index should be 3.
Note that the issue does not occur if we use a rule instead:
Output:
(start, 0, 3, -inf)
I will open a PR with a fix.
The text was updated successfully, but these errors were encountered: