Module

lexie/generate_lexer

src/lexie/generate_lexer.pooka

The reader itself: one patient walk over the bytes, and not a regular expression in sight.

Generates lexer.pooka: a hand-written-style lexer over the source's bytes.

Fixed tokens match with bit-array literals, such as <<"==":utf8, after:bits>>, tried longest first. Character classes match one byte against ranges in a guard. Text is sliced out of the source by byte offset, so nothing is copied until a token keeps it. There is no regular expression engine and no runtime library: the generated module needs only the standard library.

API reference

function

source

src/lexie/generate_lexer.pooka:27
source(c: Config) -> String
INFERREDfn(lexie/config.Config) -> String

The generated lexer module.

function

scanner_name

src/lexie/generate_lexer.pooka:753
scanner_name(style: StringStyle) -> String
INFERREDfn(lexie/config.StringStyle) -> String

The scanner for a string style, such as _scan_raw_string.