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
If we use array comprehension to return the result without any processing, a syntax error will occur. It"s simply a parser bug.
print! [ x | x <- [1, 2] ]
[1, 2]
Error[#0761]: File <stdin>, line 1, 1 │ print! [ x | x <- [1, 2] ] · -- SyntaxError: expected: VBar, got: Inclusion
The following code works.
lc = [i * 2 | i <- 1..4] assert lc == [2, 4, 6, 8] lc2 = [i + 1 | i <- 1..5 | i <= 3] assert lc2 == [2, 3, 4] lc3 = [i <- 1..10 | i <= 5] assert lc3 == [1, 2, 3, 4, 5]
0.6.32
None
The text was updated successfully, but these errors were encountered:
fix(parser): fix comprehension syntax(erg-lang#495)
ef67f00
6834fbc
Successfully merging a pull request may close this issue.
Describe the bug?
If we use array comprehension to return the result without any processing, a syntax error will occur.
It"s simply a parser bug.
Reproducible code
Expected result
Actual result
Additional context
The following code works.
Erg version
0.6.32
Python version
None
OS
None
The text was updated successfully, but these errors were encountered: