pub struct RuleCall {
pub name: String,
pub args: Vec<Expr>,
}Expand description
A reference to a production rule, optionally carrying call arguments.
Every successor position in the grammar — bare rule ops, split slots,
Comp / Offset / Roof / Attach cases, occlusion conditionals — is a
RuleCall. Arguments are expressions evaluated in the calling shape’s
context at push time; the callee binds the resulting values to its
declared parameter names (see Interpreter::add_rule_def).
Spire(4) // bare call with one argument
Split(Y) { 3: Base | ~1: Tier(depth + 1) }Fields§
§name: String§args: Vec<Expr>Call arguments; empty for plain references. Skipped in serde when empty so pre-0.3 serialized ops round-trip unchanged.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RuleCall
impl<'de> Deserialize<'de> for RuleCall
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq<&str> for RuleCall
Argument-less calls compare equal to their bare name — keeps assertions
and look-ups terse (assert_eq!(slot.rule, "Floor")). A call with
arguments never equals a bare name.
impl PartialEq<&str> for RuleCall
Argument-less calls compare equal to their bare name — keeps assertions
and look-ups terse (assert_eq!(slot.rule, "Floor")). A call with
arguments never equals a bare name.
impl StructuralPartialEq for RuleCall
Auto Trait Implementations§
impl Freeze for RuleCall
impl RefUnwindSafe for RuleCall
impl Send for RuleCall
impl Sync for RuleCall
impl Unpin for RuleCall
impl UnsafeUnpin for RuleCall
impl UnwindSafe for RuleCall
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more