Constructors

Constructs a new tokenizer based on the given rules and flags.

Constructs a new tokenizer based on the given rules and flags.

Arguments

rulesObject

Required. The highlighting rules

flagString

Required. Any additional regular expression flags to pass (like "i" for case insensitive)

Methods

Returns an object containing two properties: tokens, which contains all the tokens; and state, the current state.

Returns an object containing two properties: tokens, which contains all the tokens; and state, the current state.

Arguments

lineObject

Required.

startStateObject

Required.