8000 [Parser] Tuples are not parsed in the `for-loop` (new parser) · Issue #779 · lcompilers/lpython · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 8000
[Parser] Tuples are not parsed in the for-loop (new parser) #779
Closed
@akshanshbhatt

Description

@akshanshbhatt
cat examples/expr2.py
for f in (a, b, c, d):
    passlpy --show-ast examples/expr2.py --tree  # Old Parser-Module
  |-body=|-For
  |   |-target=Name
  |   | |-id=f
  |   |-expr_contextType=Store
  |   |-iter=Tuple
  |   | |-elts=|   | | |-Name
  |   | | | |-id=a
  |   | | |-expr_contextType=Load
  |   | | |-Name
  |   | | | |-id=b
  |   | | |-expr_contextType=Load
  |   | | |-Name
  |   | | | |-id=c
  |   | | |-expr_contextType=Load
  |   | |-Name
  |   | |   |-id=d
  |   | |-expr_contextType=Load
  |   |-expr_contextType=Load
  |   |-body=|   |-Pass
  |   |-orelse=|-type_comment=()
  └-type_ignores=↧

❯ lpy --show-ast --new-parser examples/expr2.py --tree  # New Parser
syntax error: Token ',' is unexpected here
 --> examples/expr2.py:1:12
  |
1 | for f in (a, b, c, d):
  |            ^


Note: if any of the above error or warning messages are not clear or are lacking
context please report it to us (we consider that a bug that needs to be fixed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ParserIssues or improvements related to parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0