Skip to content

[Tokenizer] Newline token not returned after comments #617

Closed
@akshanshbhatt

Description

@akshanshbhatt
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions