Skip to content
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

[Parser] Error in parsing function definition (new parser) #803

Closed
akshanshbhatt opened this issue Jul 21, 2022 · 0 comments · Fixed by #808
Closed

[Parser] Error in parsing function definition (new parser) #803

akshanshbhatt opened this issue Jul 21, 2022 · 0 comments · Fixed by #808

Comments

@akshanshbhatt
Copy link
Collaborator

$ cat examples/expr2.py
def func(i,):
    pass

$ lpython --show-ast examples/expr2.py --tree  # Old-Module
  |-body=|-FunctionDef
  |   |-name=func
  |   |-args=
  |   | |-posonlyargs=|   | |-args=|   | |-
  |   | |   |-arg=i
  |   | |   |-annotation=()
  |   | |-type_comment=()
  |   | |-vararg=|   | |-kwonlyargs=|   | |-kw_defaults=|   | |-kwarg=|   |-defaults=|   |-body=|   |-Pass
  |   |-decorator_list=|   |-returns=()
  |-type_comment=()
  └-type_ignores=↧

$ lpython --show-ast examples/expr2.py --tree --new-parser  # New
tokenizer error: Parenthesis unexpected
 --> examples/expr2.py:1:12
  |
1 | def func(i,):
  |            ^


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).
akshanshbhatt added a commit to akshanshbhatt/lpython that referenced this issue Jul 22, 2022
Co-authored-by: Thirumalai Shaktivel <Thirumalai-Shaktivel@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

1 participant