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

[Tokenizer] Newline token not returned after comments #617

Closed
akshanshbhatt opened this issue Jun 16, 2022 · 0 comments · Fixed by #619
Closed

[Tokenizer] Newline token not returned after comments #617

akshanshbhatt opened this issue Jun 16, 2022 · 0 comments · Fixed by #619

Comments

@akshanshbhatt
Copy link
Collaborator

def main(): #comment
    #comment
    pass

Ideally, the tokenizer should return newline tokens after both the TK_EOLCOMMENT and TK_COMMENT but is not returned in either of the two cases.

❯ lpy --show-tokens examples/expr2.py
(KEYWORD "def") 0:2
(TOKEN "identifier" main) 4:7
(TOKEN "(") 8:8
(TOKEN ")") 9:9
(TOKEN ":") 10:10
(TOKEN "eolcomment") 12:20
(TOKEN "comment") 25:33
(TOKEN "indent") 34:37
(KEYWORD "pass") 38:41
(EOF) 42:42
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