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

Failure to tokenize multi-line comments #1

Open
silverhairs opened this issue Jun 18, 2023 · 0 comments
Open

Failure to tokenize multi-line comments #1

silverhairs opened this issue Jun 18, 2023 · 0 comments
Labels
bug Something isn't working glox

Comments

@silverhairs
Copy link
Owner

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 */.

@silverhairs silverhairs added bug Something isn't working glox labels Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working glox
Projects
None yet
Development

No branches or pull requests

1 participant