Prettier errors

This commit is contained in:
Yura Dupyn 2026-02-07 01:24:12 +01:00
parent e389e46852
commit 3d1cd89067
6 changed files with 313 additions and 48 deletions

View file

@ -70,6 +70,7 @@ export class Cursor {
return this.index;
}
// TODO: unicode-index ~> string-offset, make that into a separate function.
currentOffset(): StringIndex {
return this.text.chars[this.index]?.offset ?? this.text.source.length;
}
@ -79,15 +80,9 @@ export class Cursor {
}
makeSpan(start: SourceLocation): Span {
const startOffset =
this.text.chars[start.index]?.offset ?? this.text.source.length;
const endOffset = this.currentOffset();
return {
start: startOffset,
end: endOffset,
line: start.line,
column: start.column,
start,
end: this.currentLocation(),
};
}