Constructor Summary
Public Constructor | ||
public |
Constructs a token |
Member Summary
Public Members | ||
public |
The string position where this match ends |
|
public |
Any RegExp groups that accrued during the match |
|
public |
The parent Lexer |
|
public |
The string that the lexer consumed to create this token |
|
public |
The string position where this match started |
|
public |
type: T The token type |
Method Summary
Public Methods | ||
public |
|
|
public |
Returns the bounds of this token, each in |
Public Constructors
public constructor(type: T, match: string, groups: string[], start: number, end: number, lexer: Lexer<T>) source
Constructs a token
Params:
Name | Type | Attribute | Description |
type | T | The token type |
|
match | string | The string that the lexer consumed to create this token |
|
groups | string[] | Any RegExp groups that accrued during the match |
|
start | number | The string position where this match started |
|
end | number | The string position where this match ends |
|
lexer | Lexer<T> | The parent Lexer |
Public Members
Public Methods
public strpos(): TokenPosition source
Returns the bounds of this token, each in {line, column}
format