Struct nom_operator::operator::Operator [] [src]

pub struct Operator<O> {
    pub op: O,
    pub associativity: Associativity,
    pub size: OperatorSize,
    pub precedence: usize,
    pub parser: Box<Fn(&[u8]) -> IResult<&[u8], &[u8]>>,
}

An Operator wrapper with extra info for parsing

Fields

The underlying operator enum

The associativity of the operator

Size of the operator, Unary, Binary, etc...

The precedence of the operator If * has precedence 10 and - has precedence 9 the following expression 1 * 2 - 3 would parse as (1 * 2) - 3

The nom parser function

Methods

impl<O> Operator<O>
[src]

Creates a new operator

Trait Implementations

impl<O: Debug> Debug for Operator<O>
[src]

Formats the value using the given formatter.

impl<O: PartialEq> PartialEq for Operator<O>
[src]

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

This method tests for !=.