8000 `break!` example leads to `dg.SyntaxError` · Issue #49 · pyos/dg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

break! example leads to dg.SyntaxError #49

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

Open
Marrin opened this issue Nov 17, 2020 · 0 comments
Open

break! example leads to dg.SyntaxError #49

Marrin opened this issue Nov 17, 2020 · 0 comments

Comments

@Marrin
Copy link
Marrin commented Nov 17, 2020

break! seems to be broken. Executing the example in the REPL leads to this:

>>> ok = for x in range 10 =>
...   if x == 5 => break!
...   print x # 0..4
... print ok  # False
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/dg/repl.dg", line 99, in runrepl
    iterate (x -> x + '\n' + rdl.input sys.ps2) $ rdl.input sys.ps1
  File "/usr/local/lib/python3.6/dist-packages/dg/repl.dg", line 98, in ((x,assignment))
    map (x -> compilerepl x module.__dict__) $
  File "/usr/local/lib/python3.6/dist-packages/dg/repl.dg", line 71, in compilerepl
    if done      => compileast tree globals, (tree :: Expression and tree.op == '=')
  File "<core:5.compiler.dg>", line 36, in compileast
  File "<core:5.compiler.dg>", line 308, in pushast
  File "<core:5.compiler.dg>", line 412, in pushcall
  File "<core:5.compiler.dg>", line 914, in prefix
  File "<core:5.compiler.dg>", line 326, in pushlast
  File "<core:5.compiler.dg>", line 335, in pushnone
  File "<core:5.compiler.dg>", line 308, in pushast
  File "<core:5.compiler.dg>", line 412, in pushcall
  File "<core:5.compiler.dg>", line 59, in <lambda>
  File "<core:5.compiler.dg>", line 915, in prefix
  File "<core:5.compiler.dg>", line 794, in pushpop
  File "<core:5.compiler.dg>", line 308, in pushast
  File "<core:5.compiler.dg>", line 412, in pushcall
  File "<core:5.compiler.dg>", line 59, in <lambda>
  File "<core:5.compiler.dg>", line 1192, in prefix
  File "<core:5.compiler.dg>", line 812, in loop
  File "<core:5.compiler.dg>", line 1207, in <lambda>
  File "<core:5.compiler.dg>", line 335, in pushnone
  File "<core:5.compiler.dg>", line 308, in pushast
  File "<core:5.compiler.dg>", line 412, in pushcall
  File "<core:5.compiler.dg>", line 914, in prefix
  File "<core:5.compiler.dg>", line 326, in pushlast
  File "<core:5.compiler.dg>", line 335, in pushnone
  File "<core:5.compiler.dg>", line 308, in pushast
  File "<core:5.compiler.dg>", line 412, in pushcall
  File "<core:5.compiler.dg>", line 913, in prefix
  File "<core:5.compiler.dg>", line 412, in pushcall
  File "<core:5.compiler.dg>", line 125, in <lambda>
  File "<core:5.compiler.dg>", line 1259, in prefix
  File "<core:5.compiler.dg>", line 1262, in jumps
  File "<core:5.compiler.dg>", line 311, in pushast
  File "<input>", line 2
    if x == 5 => break!
                 ^
dg.SyntaxError: pushed 0 items onto the stack

Python version is Python 3.6.9 and I've used the -b option to create a bundle for that to get rid of the warning I got at startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0