Fix diagnostic print

This commit is contained in:
nub31
2025-10-20 19:07:08 +02:00
parent b71e10f55b
commit 7697f7b7cc
3 changed files with 116 additions and 104 deletions

View File

@@ -90,23 +90,23 @@ public sealed class Tokenizer
{
try
{
// Skip whitespace and increment line counter if newline
var current = Peek()!.Value;
if (char.IsWhiteSpace(current))
{
if (current is '\n')
{
_line += 1;
_column = 1;
// note(nub31): Next increments the column, so 0 is correct here
_column = 0;
}
Next();
continue;
}
// Skip single line comments but keep newline so next iteration increments the line counter
if (current == '/' && Peek(1) == '/')
{
// note(nub31): Keep newline so next iteration increments the line counter
while (Peek() is not '\n')
{
Next();