Enum nom_operator::expr::Expr [] [src]

pub enum Expr<Atom, Operator> {
    Atom(Atom),
    UnExpr {
        item: Box<Expr<Atom, Operator>>,
        op: Operator,
    },
    BinExpr {
        left: Box<Expr<Atom, Operator>>,
        op: Operator,
        right: Box<Expr<Atom, Operator>>,
    },
    TreExpr {
        left: Box<Expr<Atom, Operator>>,
        lop: Operator,
        middle: Box<Expr<Atom, Operator>>,
        rop: Operator,
        right: Box<Expr<Atom, Operator>>,
    },
}

A parsed expression

Variants

An atom is whatever the return type of the atom parser returns

UnExpr is a unary expression for example -10

Fields of UnExpr

Item is the sub expression that the operator applies to. It is not called lhs because it can be either postfix or prefix

Operator token

BinExpr is a binary expression for example 10 * 10

Fields of BinExpr

Left hand side sub expression

Operator token

Right hand side sub expression

TreExpr is a trenary expression such as true ? 2 : 3

Fields of TreExpr

Left side sub expression

First operator token

Middle sub expression

Right operator token

Right side sub expression

Trait Implementations

impl<Atom: PartialEq, Operator: PartialEq> PartialEq for Expr<Atom, Operator>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<Atom, Operator> Debug for Expr<Atom, Operator> where
    Atom: Debug,
    Operator: Debug
[src]

Formats the value using the given formatter.