-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
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
Backtracking Not Working After "in" Keyword #216
Comments
This is quite confusing in practice. We should try to improve the grammar. |
|
Could you provide examples that show how it is today and how would it preferably be instead? Both for 'in' and 'let', please. |
For a simple let expression like
it is my understanding that if you remove the parentheses around the 2 (in the parser rule and the expression) it is parsed as
i.e. x bound to the boolean value indicating whether 2 is in the set A similar example could be constructed for magic wands:
would be parsed as
without the parentheses. |
|
|
|
|
Without the parentheses, A similar issue occurs for |
|
Although good progress was made in branch krantikiran_issue_216_bactrack_after_in, no solution that is general enough was reached yet, as we cannot limit expressions to proper subsets of expressions, depending on where it occurs, just to avoid ambiguity in the parser. |
|
in
can either be parsed as a set operation or as part of alet
,unfolding
orapplying
expression in Viper. The rule forapplying
is defined asWithout the parentheses,
in
is parsed as a set operation and thein
of theapplying
expression cannot be found. The parser should at that point backtrack and parse the expression correctly. This does not work.A similar issue occurs for
let
expressions. As a work around parentheses are inserted as shown above.The text was updated successfully, but these errors were encountered: