Expand description
Semantic converter: pest Pairs<Rule> โ ContractExpr / NumericPredicate.
This is the phase-2 counterpart to pest_grammar.rs: it turns the parse
tree produced by the pest grammar into the contract AST (types.rs).
Places (fields, projections) are bridged through the place.rs / resolve.rs
helpers via a syn round-trip, since resolving a field name to a Ty still
needs the rustc type context. The arithmetic / call / if / constant layers
are converted directly from the pest tree.
Functionsยง
- conv_
additive ๐ - conv_
arg_ ๐expr - conv_
base ๐ - Convert a
not_is_emptybase (self/return/Arg_N/ ident) into a place expression. - conv_
bit_ ๐and - conv_
bit_ ๐or - conv_
bit_ ๐xor - conv_
call ๐ - conv_
const_ ๐path - conv_
expr ๐ - conv_if ๐
- conv_
left_ ๐assoc - conv_
multiplicative ๐ - conv_
place_ ๐bridge - Bridge a place through the existing syn-based parser (handles field
projections,
unwrap_some,iter, andx.lensugar uniformly). - conv_
predicate ๐ - conv_
primary ๐ - conv_
size_ ๐of_ call - Convert
size_of::<T>()/align_of::<T>()(optionallystd::mem::/core::mem::prefixed) intoSizeOf/AlignOf. - conv_
unary ๐ - only_
child ๐ - op_
from_ ๐str - parse_
expr_ pest - Parse a numeric expression (no comparison) into a
ContractExpr. - parse_
predicate_ pest - Parse a predicate (comparison /
!x.is_empty()/ bare expr) into aNumericPredicate. - relop_
from_ ๐str