StandardRegexLexer
class StandardRegexLexer(val source: CharSequence, patterns: List<TokenRegexPattern>, fillTokenType: (TokenData) -> Token? = null) : RegexLexer
A standard RegexLexer implementation that does not perform any manipulation on the final output and has an optional fixed fill token.
Parameters
source
the content to be tokenized
patterns
the patterns to search for, in descending order of priority
fillTokenType
type of token to assign to uncaptured groups in order to fill the gaps. A token will not be created if null
and empty gaps will be present in the output
Constructors
Link copied to clipboard
constructor(source: CharSequence, patterns: List<TokenRegexPattern>, fillTokenType: (TokenData) -> Token? = null)
Properties
Link copied to clipboard
Index of the latest scanned character within source.
Link copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
fun updatePatterns(newPatterns: (List<TokenRegexPattern>) -> List<TokenRegexPattern>): StandardRegexLexer
Creates a copy of this lexer with different patterns.