fix: correct loop condition in comment parsing

The loop was checking 'for i.Done()' instead of 'for !i.Done()',
which prevented the comment content from being consumed.
This caused the tokenizer to treat comment text as code.
This commit is contained in:
2026-01-12 20:59:34 -05:00
parent b588754552
commit 53f4081f6f

View File

@@ -79,7 +79,7 @@ func getToken(i *iterator.Iterator[rune]) (*Token, error) {
return NewHardBreak(index), nil return NewHardBreak(index), nil
case letter == '#': case letter == '#':
// Skip everything until the next newline or EOF. // Skip everything until the next newline or EOF.
for i.Done() { for !i.Done() {
r, err := i.Next() r, err := i.Next()
if err != nil { if err != nil {
return nil, trace.Wrap(err, "error while parsing comment") return nil, trace.Wrap(err, "error while parsing comment")