Prettier errors
This commit is contained in:
parent
e389e46852
commit
3d1cd89067
6 changed files with 313 additions and 48 deletions
|
|
@ -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(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue