Line counting is broken in multiline comments
MistrzPiotr opened this issue · comments
To show a very simple example:
- /*
- comment
- */
- let x = 0
Error message is "[Parse Error] Expected ;
on line 2" even tho the error is on line 4
In the tokenizer just continue to increment the line_count every time there's a new line.
else if (peek().value() == '\\') {
consume();
while (peek().has_value()) {
if (peek().value() == '\\') {
break;
}
if (peek().value() == '\n') {
line_count++;
}
consume();
}
if (peek().has_value()) {
consume();
}
}