Code Map
module volta.token.lexer;
//! Tokenizes a source file.
fn lex(source: Source) TokenWriter { }
Tokenizes a source file.
Side-effects: Will advance the source loc, on success this will be EOF.
Throws: CompilerError on errors.
Returns:
A TokenWriter
filled with tokens.
Advance and return true if matched. Adds an error and returns false otherwise.
Side-effects: If @src.current and @c matches, advances source to next character.
Call match for every character in a given string. Returns false if any match fails, true otherwise.
Side-effects: Same as calling match repeatedly.
Returns true if something has been matched, false otherwise. No errors generated.
Add a LexFailed error with the given string.
Add an Expected error with the given string.
Calls lexExpected with tw.source.loc.
Return which TokenType to try and lex next.
Consume characters from the source from the characters array until you can't. Returns: the number of characters consumed, not counting underscores.
Lex an integer literal and add the resulting token to tw. If it detects the number is floating point, it will call lexReal directly.
Lex a floating literal and add the resulting token to tw.