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
The grammar definition was ambigious to whether a lone Set Comprehension
was a Set Comprehension at all, instead parsing it as a Body. An example
is:
`{k | a = [1, 2, 3]; a[k]}`
The parser would interpret this as a Body with the expressions
`[1, 2, 3] = k | a` and `a[k]`, which is not the intended result. To
resolve this, the parser now prioritizes `NonWhitespaceBody`s over
`BraceEnclosedBody`s in order to parse Set Comprehensions passed to
the REPL or as queries properly.
Fixesopen-policy-agent#377
Co-Authored-By: Torin Sandall <torinsandall@gmail.com>
The grammar definition was ambigious to whether a lone Set Comprehension
was a Set Comprehension at all, instead parsing it as a Body. An example
is:
`{k | a = [1, 2, 3]; a[k]}`
The parser would interpret this as a Body with the expressions
`[1, 2, 3] = k | a` and `a[k]`, which is not the intended result. To
resolve this, the parser now prioritizes `NonWhitespaceBody`s over
`BraceEnclosedBody`s in order to parse Set Comprehensions passed to
the REPL or as queries properly.
Fixes#377
Co-Authored-By: Torin Sandall <torinsandall@gmail.com>
It seems the safety check for set comprehensions is not working as expected.
Whereas the following is OK:
The text was updated successfully, but these errors were encountered: