Docs.rs
  • ezno-parser-0.0.1
    • ezno-parser 0.0.1
    • Docs.rs crate page
    • MIT
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • kaleidawave
    • Dependencies
      • derive-debug-extras ^0.2.2 normal
      • derive-enum-from-into ^0.1.1 normal
      • derive-finite-automaton ^0.1.0 normal
      • derive-partial-eq-extras ^0.1.2 normal
      • enum-variants-strings ^0.2 normal
      • enum_variant_type ^0.3.1 normal
      • iterator-endiate ^0.1.0 normal
      • self-rust-tokenize ^0.3.3 normal
      • source-map ^0.11.2 normal
      • temporary-annex ^0.1.0 normal
      • tokenizer-lib ^1.5.0 normal
      • ezno-parser-visitable-derive ^0.0.1 normal
      • match_deref ^0.1.1 dev
    • Versions
    • 17.96% of the crate is documented
  • Go to latest version
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation
logo

logo

Operator

Required Methods

  • associativity_direction
  • is_associative
  • precedence
  • to_str

Provided Methods

  • precedence_and_associativity_direction

Implementors

In ezno_parser::operators

?
Change settings

Trait ezno_parser::operators::Operator

source ·
pub trait Operator: for<'a> TryFrom<&'a TSXToken> {
    // Required methods
    fn to_str(&self) -> &'static str;
    fn precedence(&self) -> u8;
    fn associativity_direction(&self) -> AssociativityDirection;
    fn is_associative(&self) -> bool;

    // Provided method
    fn precedence_and_associativity_direction(
        &self
    ) -> (u8, AssociativityDirection) { ... }
}

Required Methods§

source

fn to_str(&self) -> &'static str

String representation of operator

source

fn precedence(&self) -> u8

Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table

source

fn associativity_direction(&self) -> AssociativityDirection

Returns the associativity of the operator. Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table

source

fn is_associative(&self) -> bool

Is associative with self https://en.wikipedia.org/wiki/Associative_property

Provided Methods§

source

fn precedence_and_associativity_direction(&self) -> (u8, AssociativityDirection)

Implementors§

source§

impl Operator for BinaryAssignmentOperator

source§

impl Operator for BinaryOperator

source§

impl Operator for UnaryOperator

source§

impl Operator for UnaryPrefixAssignmentOperator

source§

impl Operator for UnaryPostfixAssignmentOperator