#[repr(u8)]pub enum Fixity {
Fun = 0,
Prefix = 1,
Infix = 2,
Postfix = 3,
}Expand description
Defines the syntactic position (fixity) of an operator.
Operators in Prolog-like syntax can appear in different structural positions
depending on their form. The Fixity enum captures these roles and is used
to categorize operators within the parser and operator definition tables.
§Variants
- [
Fun]: A functional (non-operator) form, e.g.,f(x, y). - [
Prefix]: A prefix operator appearing before its operand, e.g.,-x. - [
Infix]: An infix operator appearing between two operands, e.g.,x + y. - [
Postfix]: A postfix operator appearing after its operand, e.g.,x!.
Variants§
Fun = 0
Functional (non-operator) position, e.g. f(x).
Prefix = 1
Prefix operator, appearing before its operand, e.g. -x.
Infix = 2
Infix operator, appearing between operands, e.g. x + y.
Postfix = 3
Postfix operator, appearing after its operand, e.g., x!.
Implementations§
Trait Implementations§
Source§impl FromStr for Fixity
Parses a string into a Fixity variant.
impl FromStr for Fixity
Parses a string into a Fixity variant.
Accepts canonical lowercase names: "fun", "prefix", "infix", or "postfix".
Returns a [ParseFixityError] if the input string does not match any known fixity.
Source§impl Index<Fixity> for OperDefTab
impl Index<Fixity> for OperDefTab
Source§impl IndexMut<Fixity> for OperDefTab
impl IndexMut<Fixity> for OperDefTab
Source§impl TryFrom<SmartString<LazyCompact>> for Fixity
impl TryFrom<SmartString<LazyCompact>> for Fixity
impl Copy for Fixity
impl Eq for Fixity
impl StructuralPartialEq for Fixity
Auto Trait Implementations§
impl Freeze for Fixity
impl RefUnwindSafe for Fixity
impl Send for Fixity
impl Sync for Fixity
impl Unpin for Fixity
impl UnwindSafe for Fixity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.