Skip to main content

Module pratt

Module pratt 

Source
Expand description

Pratt-parser contracts: operator tables for shape-driven syntax.

The kernel defines the operator-table, fixity, and token contracts that parameterize precedence parsing; concrete grammars and codecs that drive them live in library crates.

Structs§

PrattOperator
A single operator entry in a PrattTable: its symbol, fixity, binding powers, and the expression form it produces.
PrattTable
A registry of PrattOperator entries indexed by fixity for precedence parsing.
PrattTableObject
Runtime Object wrapper exposing a named PrattTable to the kernel as a core table value.

Enums§

Fixity
The grammatical position an operator occupies relative to its operands.
PrattResult
The expression form a matched PrattOperator produces.
Token
A lexical token consumed by the precedence parser.

Functions§

parse_symbol
Parses a raw operator string into a Symbol, splitting on the first / or . into a qualified namespace and name when present.
pratt_table_value
Boxes a named operator table into an opaque runtime Value.