This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.
LexerToken
Defined in: packages/engine/src/lexer/ExpressionLexer.ts:425
A token, as the lexer produces it.
A class rather than an object literal because tokens are created on every keystroke and a shared hidden class keeps that path predictable for the engine running it.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LexerToken( type, typeId, value, text, offset, lineBreaks, line, col, sourceEnd?, fault?, mayNameVariable?): LexerToken;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:426
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
type | string | - |
typeId | number | - |
value | string | - |
text | string | - |
offset | number | - |
lineBreaks | number | - |
line | number | - |
col | number | - |
sourceEnd? | number | See Token.sourceEnd. Set only on normalizer-fused tokens. |
fault? | { code: string; message: string; } | See Token.fault. Set only on a fused token standing for a run the engine refuses to read. |
fault.code? | string | - |
fault.message? | string | - |
mayNameVariable? | boolean | See Token.mayNameVariable. Set only on a rate denominator fused from a slash. |
Returns
Section titled “Returns”LexerToken
Properties
Section titled “Properties”col: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:434
Implementation of
Section titled “Implementation of”fault?
Section titled “fault?”optional fault?: { code: string; message: string;};Defined in: packages/engine/src/lexer/ExpressionLexer.ts:438
See Token.fault. Set only on a fused token standing for a run the engine refuses to read.
readonly code: string;message
Section titled “message”readonly message: string;Implementation of
Section titled “Implementation of”line: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:433
Implementation of
Section titled “Implementation of”lineBreaks
Section titled “lineBreaks”lineBreaks: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:432
Implementation of
Section titled “Implementation of”mayNameVariable?
Section titled “mayNameVariable?”optional mayNameVariable?: boolean;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:440
See Token.mayNameVariable. Set only on a rate denominator fused from a slash.
Implementation of
Section titled “Implementation of”offset
Section titled “offset”offset: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:431
Implementation of
Section titled “Implementation of”sourceEnd?
Section titled “sourceEnd?”optional sourceEnd?: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:436
See Token.sourceEnd. Set only on normalizer-fused tokens.
Implementation of
Section titled “Implementation of”text: string;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:430
Implementation of
Section titled “Implementation of”type: string;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:427
String token type (e.g., “NUMBER”, “PLUS”, “IDENT”). Used by ParseletRegistry string-keyed maps and error messages.
Implementation of
Section titled “Implementation of”typeId
Section titled “typeId”typeId: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:428
Integer token type ID for fast comparison in Parser hot path. Populated by the Lexer via registerTokenType(). Use tokenTypeId(type) to get a type’s ID.
Implementation of
Section titled “Implementation of”value: string;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:429