Skip to main content

Crate cl_parser

Crate cl_parser 

Source
Expand description

Houses the Conlang Parser.

Conlang uses a pair of mutually recursive Pratt Parsers to parse its Expression and Pattern sub-languages.

These parsers are implemented in expr and pat, respectively.

The Parser (or “parser context” if you’re pedantic) keeps track of the last-peeked Token, the Span information, and whether or not the last-consumed Token is allowed to stand in for a semicolon (;) in Conlang’s do expressions.

Re-exports§

pub use error::EOF;

Modules§

error
expr
Conlang’s Expression parser.
inliner
The ModuleInliner reads files described in the module structure of the
parser 🔒
The parser takes a stream of [Token]s from the Lexer, and turns them into [cl_ast::ast] nodes.
pat
Conlang’s Pattern parser.

Structs§

Parser
Handles stateful extraction from a Lexer, with single-[Token] lookahead.

Enums§

ParseError
All the ways a Parser can fail

Traits§

PResultExt
Parse
Parse an expression from a Parser’s token stream at a given precedence level

Functions§

no_eof
Opens a scope where ParseError::EOF is unexpected (See PResultExt::no_eof)

Type Aliases§

PResult