Constructs a Lexer object.
A destructor is present on this object, but not explicitly documented in the source.
Decodes the next UTF-8 sequence.
Callback function to TokenSerializer.deserialize().
Returns the end pointer excluding the sentinel string.
Forwards error parameters.
Creates an error report and appends it to a list.
Returns the file path for error messages.
Returns the error line number.
Sets the value of the token.
Sets the value of the special token.
Returns the first token of the source text. This can be the EOF token. Structure: [NullToken, HEAD, Newline, FirstToken, ..., NullToken]
Loads the tokens from a dlx file.
Acquires the current buffer.
Returns the HEAD token.
Returns true if p points inside the source text.
Returns true if p points to the last character of a Newline.
Returns the EOF token.
Returns the current line number.
Looks up a Float in the table.
Looks up a newline value.
Looks up a StringValue. Copies str if it's not a slice from the src text.
Forwards to tables.lookupString().
Returns the next free token from the array. NB: The bytes are not zeroed out.
Allocates memory for T.
Advance t one token forward.
The main method which recognizes the characters that make up a token.
Scans the whole source text until EOF is encountered.
Scans a block comment.
Scans a character literal.
Scans a delimited string literal.
Scans an escape sequence.
Scans an escape string literal.
Scans a floating point number literal.
Scans a hexadecimal floating point number literal. $(BNF /HexFloat := "0" [xX] (HexDigits? "." HexDigits | HexDigits) HexExponent /HexExponent := [pP] [+-]? DecDigits /HexDigits := [a-fA-F\d] [a-fA-F\d_]* /)
Scans a hexadecimal string literal.
Scans a nested comment.
Scans a normal string literal.
Scans a number literal.
Scans a raw string literal.
The "shebang" may optionally appear once at the beginning of a file. $(BNF Shebang := "#!" AnyChar* EndOfLine)
Scans a special token sequence.
Scans a token string literal.
An alternative scan method. Profiling shows it's a bit slower.
Takes over buffer if its capacity is greater than the current one.
Returns the source text string.
Returns the list of tokens excluding special beginning and end tokens.
Generates case statements for token strings.
Returns a zero-terminated copy of the string where all underscores are removed.
Encodes the character d and appends it to str.
Searches for an invalid UTF-8 sequence in str.
Formats the bytes between start and end (excluding end.)
Scans the postfix character of a string literal.
Returns true if the current character to be decoded is a Unicode alpha character.
line as a uint.
q" as a ushort.
q{ as a ushort.
r" as a ushort.
#! as a ushort.
x" as a ushort.
Groups line information.
Allocates memory for non-token structs.
A buffer for string values.
For diagnostics.
Points one character past the end of the source text.
List of errors.
Holds the original file path and the modified one (by #line.)/// Info set by "#line".
> 0 if inside q{ }
Current line.
Points to the current character in the source text.
The source text.
Used to look up token values.
Array of Tokens.
The Lexer analyzes the characters of a source text and produces an array of tokens.