ConversionSpan
Defined in: src/losses.ts:79 (opens in a new tab)
Where one source token was read in the input and where its output was
written, as ranges of UTF-16 code units (the unit of String.length,
slice() and editor selections), start included and end excluded.
Spans are in order: their starts and their ends never decrease. Input
spans cover the input without gaps; a token read from part of a character
that the previous token also draws on (a stray mark of a precomposed
letter) has that character’s span, inside the previous token’s and ending
with it. Output spans cover the output; several tokens written as one share
a span (a Greek numeral written as a decimal number, a whitespace run
collapsed to one space, the two letters of a modern digraph), and a token
the output has nothing for has an empty span where the output of the next
token starts. See the positions contract in docs/conversion-analysis.md.
Properties
Section titled “Properties”inputEnd
Section titled “inputEnd”inputEnd:
number
Defined in: src/losses.ts:83 (opens in a new tab)
Offset after its last code unit in the input.
inputStart
Section titled “inputStart”inputStart:
number
Defined in: src/losses.ts:81 (opens in a new tab)
Offset of the token’s first code unit in the input as supplied.
outputEnd
Section titled “outputEnd”outputEnd:
number
Defined in: src/losses.ts:87 (opens in a new tab)
Offset after the last code unit of the token’s output.
outputStart
Section titled “outputStart”outputStart:
number
Defined in: src/losses.ts:85 (opens in a new tab)
Offset of the first code unit of the token’s output.