fix: add lexError function and fix line counting for unterminated block comments
Add a dedicated lexError function that marks compilation as failed and formats error messages consistently with a trailing newline. Move line counting from readRawToken into nextChar so that newlines are tracked during all lexer phases, including block comment scanning. Replace the TODO placeholder in skipBlockComment with a proper lexError call for unterminated block comments, and add test cases for unterminated block and nested block comments.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
IO.write("no")
|
||||
// Something that's not a valid character:
|
||||
^ // expect error
|
||||
Reference in New Issue
Block a user