Out to reproduce:
- Start the REPL
- Input a multi-lines comment such as
/* example comment */
- 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 */.
Out to reproduce:
/* example comment */As seen in the output above, the lexer completely ignores all the lexemes that come before the closing
*/.