LexerToken
Defined in: packages/engine/src/lexer/ExpressionLexer.ts:232
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?): LexerToken;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:233
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. |
Returns
Section titled “Returns”LexerToken
Properties
Section titled “Properties”col: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:241
Implementation of
Section titled “Implementation of”line: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:240
Implementation of
Section titled “Implementation of”lineBreaks
Section titled “lineBreaks”lineBreaks: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:239
Implementation of
Section titled “Implementation of”offset
Section titled “offset”offset: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:238
Implementation of
Section titled “Implementation of”sourceEnd?
Section titled “sourceEnd?”optional sourceEnd?: number;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:243
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:237
Implementation of
Section titled “Implementation of”type: string;Defined in: packages/engine/src/lexer/ExpressionLexer.ts:234
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:235
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:236