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

Type Comment is not recognized by the new parser #920

Closed
Thirumalai-Shaktivel opened this issue Aug 5, 2022 · 0 comments · Fixed by #933
Closed

Type Comment is not recognized by the new parser #920

Thirumalai-Shaktivel opened this issue Aug 5, 2022 · 0 comments · Fixed by #933
Labels
Parser Issues or improvements related to parser

Comments

@Thirumalai-Shaktivel
Copy link
Collaborator

Thirumalai-Shaktivel commented Aug 5, 2022

Examples:

import pytest  # type: ignore

def ndarray_func(x):
    # type: (np.ndarray) -> np.ndarray
    return x

Error:

$ lpython --show-ast examples/expr2.py --tree --new-parser
syntax error: Token '# type: ignore' (of type 'type_comment') is unexpected here
 --> examples/expr2.py:3:16
  |
3 | import pytest  # type: ignore
  |                ^^^^^^^^^^^^^^ 


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).
@Thirumalai-Shaktivel Thirumalai-Shaktivel added the Parser Issues or improvements related to parser label Aug 5, 2022
@redbopo redbopo mentioned this issue Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parser Issues or improvements related to parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant