Skip to main content

Module shape

Module shape 

Source
Expand description

The Shape protocol: the one shared engine for matching and binding.

Shape is a first-class kernel protocol used across parsing, checking, binding, dispatch, macro syntax, codec grammar, and overload selection; the kernel defines the protocol and the match/binding contracts, while concrete shapes are implemented by the libraries.

Structs§

MatchScore
A match quality score used to rank shapes during overload selection.
ShapeBindings
Captures produced by a successful match: named values and named exprs.
ShapeDoc
Human-facing description of a Shape: a name plus optional detail lines.
ShapeMatch
The outcome of checking a value or expr against a Shape.
ShapeMatchObject
Object wrapper exposing a ShapeMatch to the runtime as a table.

Enums§

ExprKind
A coarse classifier over Expr variants, used by grammar shapes.
ShapeCallTarget
What a call_shape invocation checks: a runtime value or an expr.

Traits§

Shape
The one shared engine for matching and binding across the runtime.

Functions§

call_shape
Run a shape against a ShapeCallTarget and return the match as a value.
shape_is_subshape_of
Decide whether child is a subshape of parent.
shape_match_value
Wrap a ShapeMatch as an opaque ShapeMatchObject runtime value.