l0_lexer namespace

Classes

class Lexer
Tokenizes L0 source code.
class Token
A single token produced by the lexer.
class TokenKind
Enumeration of all supported token types in L0.

Functions

auto _is_ascii_ident_start(str c) -> bool
Return whether c can start an ASCII Dea identifier.
auto _is_ascii_ident_part(str c) -> bool
Return whether c can continue an ASCII Dea identifier.
auto _logical_predecessor_ends_expression(Token token, bool previous) -> bool
Return whether the parser-visible predecessor ends an expression.
auto is_reserved_keyword(str word) -> bool
Check if a word is a reserved L0 keyword.

Variables

dict KEYWORDS
_EXPR_ENDING_TOKENS
str OCT_CHARS
str HEX_CHARS

Function documentation

bool l0_lexer::_is_ascii_ident_start(str c) protected

Return whether c can start an ASCII Dea identifier.

bool l0_lexer::_is_ascii_ident_part(str c) protected

Return whether c can continue an ASCII Dea identifier.

bool l0_lexer::_logical_predecessor_ends_expression(Token token, bool previous) protected

Return whether the parser-visible predecessor ends an expression.

bool l0_lexer::is_reserved_keyword(str word)

Check if a word is a reserved L0 keyword.

Parameters
word The word to check.
Returns True if the word is a keyword, False otherwise.

Variable documentation