Literals
constructor(integerLiteral: Regex? = Regex("""[-+]?[0-9_]+"""), floatingLiteral: Regex? = Regex("""[-+]?[0-9_]*\.[0-9_]+(?:[eE][-+]?[0-9_]+)?"""), singleLineString: Set<String> = setOf("\"", "\'"), escapeSequences: List<Pair<Regex, (String) -> Char>> = emptyList())(source)
creates a configuration of literals for the lexer.
Parameters
integer Literal
a regex that detects an integer literal.
floating Literal
a regex that detects a floating point number literal.
single Line String
a set of strings that denote the start and end enclosing strings. The lexer will throw a LexicalException when a string literal is not terminated in the same line.
escape Sequences
a list of regex that matches an escape sequence. On match, it will return a Char based on the string matched.