Skip to main content

Module pest_conv

Module pest_conv 

Source
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_empty base (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, and x.len sugar uniformly).
conv_predicate ๐Ÿ”’
conv_primary ๐Ÿ”’
conv_size_of_call ๐Ÿ”’
Convert size_of::<T>() / align_of::<T>() (optionally std::mem:: / core::mem:: prefixed) into SizeOf / 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 a NumericPredicate.
relop_from_str ๐Ÿ”’