This site describes solve-engine 2.44.0, the version npm installs.
ParsedLine
Defined in: packages/engine/src/types/ParsingResult.ts:57
One line of a parsed document.
A line carries either a whole-line expression or a set of inline solves,
never both. isEmpty covers the third case: prose, a heading, or a blank.
Properties
Section titled “Properties”endPosition
Section titled “endPosition”endPosition: number;Defined in: packages/engine/src/types/ParsingResult.ts:65
Character offset just past the line end within the whole document.
error: string | null;Defined in: packages/engine/src/types/ParsingResult.ts:77
Message when the whole-line expression failed.
errorCode?
Section titled “errorCode?”errorCode?: string | null;Defined in: packages/engine/src/types/ParsingResult.ts:85
The code of the failure in error (NO_PREFIX_PARSELET,
UNDEFINED_VARIABLE), the same code the expression throws on its own:
what a host branches on. Null when error is. A failure the line returned
as a value keeps its code on the value in result. Absent from a line
built by something other than the engine’s document passes.
errorSpan?
Section titled “errorSpan?”errorSpan?: SourceSpan | null;Defined in: packages/engine/src/types/ParsingResult.ts:92
Where in the line the failure in error is: character offsets into
the line’s text, the one-based line number, and the one-based
column, for an editor to underline. Null when the engine has no position
for it (an undefined variable is raised with none), and when error is.
expression
Section titled “expression”expression: string | null;Defined in: packages/engine/src/types/ParsingResult.ts:73
The whole-line expression, or null when the line has inline solves or nothing.
hasInlineSolves
Section titled “hasInlineSolves”hasInlineSolves: boolean;Defined in: packages/engine/src/types/ParsingResult.ts:69
Whether the line holds backtick-delimited expressions.
inlineSolves
Section titled “inlineSolves”inlineSolves: InlineSolvePosition[];Defined in: packages/engine/src/types/ParsingResult.ts:71
Each embedded expression and its position. Empty for a whole-line expression.
isEmpty
Section titled “isEmpty”isEmpty: boolean;Defined in: packages/engine/src/types/ParsingResult.ts:67
Whether the line holds nothing to evaluate.
lineNumber
Section titled “lineNumber”lineNumber: number;Defined in: packages/engine/src/types/ParsingResult.ts:59
One-based line number.
result
Section titled “result”result: Value | null;Defined in: packages/engine/src/types/ParsingResult.ts:75
The whole-line result, or null when there is none or it failed.
startPosition
Section titled “startPosition”startPosition: number;Defined in: packages/engine/src/types/ParsingResult.ts:63
Character offset of the line start within the whole document.
text: string;Defined in: packages/engine/src/types/ParsingResult.ts:61
The raw line text as it appeared.