Skip to content

Failure to tokenize multi-line comments #1

@silverhairs

Description

@silverhairs

Out to reproduce:

  1. Start the REPL
  2. Input a multi-lines comment such as /* example comment */
  3. Press enter
> /* this is a multi-lines comment*/        
&{Type:ASTERISK Literal:<nil> Lexeme:* Line:1}
&{Type:SLASH Literal:<nil> Lexeme:/ Line:1}
&{Type:EOF Literal:<nil> Lexeme: Line:1}
&{Type:EOF Literal:<nil> Lexeme: Line:1}
&{Type:EOF Literal:<nil> Lexeme: Line:1}
&{Type:EOF Literal:<nil> Lexeme: Line:1}
> /* this is a multi-lines comment */
&{Type:ASTERISK Literal:<nil> Lexeme:* Line:1}
&{Type:SLASH Literal:<nil> Lexeme:/ Line:1}
&{Type:EOF Literal:<nil> Lexeme: Line:1}
&{Type:EOF Literal:<nil> Lexeme: Line:1}
&{Type:EOF Literal:<nil> Lexeme: Line:1}
&{Type:EOF Literal:<nil> Lexeme: Line:1}
> 

As seen in the output above, the lexer completely ignores all the lexemes that come before the closing */.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingglox

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions