fix: reassign offset to 0 before resolveContext

resolveContext should be executed once at streamParse before iterating parseLine, or at each nextLine after reassigning this.line to its next and this.offset to 0.
This commit is contained in:
kotaindah55 2025-02-03 23:17:48 +02:00
parent 82fbbbbcbf
commit 6c8ce72baf

View file

@ -99,6 +99,7 @@ export class ParserState {
return null;
}
this.line = this.doc.line(this.linePos + 1);
this.offset = 0;
this.resolveContext();
if (skipBlankLine) {
if (this.isBlankLine()) {
@ -110,7 +111,6 @@ export class ParserState {
}
}
}
this.offset = 0;
return this.line;
}
isLastLine() {