erg-lang / erg

A statically typed language compatible with Python
http://erg-lang.org
Apache License 2.0
2.61k stars 53 forks source link

Comprehension compile failed #513

Open nanakura opened 1 month ago

nanakura commented 1 month ago

Describe the bug?

I tried compiling an example from The Erg Book but failed

Reproducible code

assert [(i, j) | i <- 0..2; j <- 0..2; (i + j) % 2 == 0] == [(0, 0), (0, 2), (1, 1), (2, 0), (2, 2)]

Expected result

compile success

Actual result

🚫 Error[#0809]: File test.er, line 3, 

3 │ assert [(i, j) | i <- 0..2; j <- 0..2; (i + j) % 2 == 0] == [(0, 0), (0, 2), (1, 1), (2, 0), (2, 2)]   
  ·                                        -

SyntaxError: invalid syntax

and image

Additional context

No response

Erg version

0.6.36

Python version

Python3.11

OS

Windows 11