Skip to main content

Module lexer

Module lexer 

Source
Expand description

The Cove lexer.

Converts one source file into a flat token stream. Lexing never panics on malformed input: every lexical error is collected as a [Diagnostic] and the lexer recovers by skipping the offending text, so a single call to lex can report every problem in a file at once.

Functionsยง

lex
Lexes file out of sources into a token stream.
lex_recovered
Lexes file and answers both halves of what the lexer found: the tokens it recovered and everything it complained about.