Struct pest::pratt_parser::PrattParserMap
source · pub struct PrattParserMap<'pratt, 'i, R, F, T>where
R: RuleType,
F: FnMut(Pair<'i, R>) -> T,{ /* private fields */ }
Expand description
Product of calling map_primary
on PrattParser
, defines how expressions should
be mapped.
Implementations§
source§impl<'pratt, 'i, R, F, T> PrattParserMap<'pratt, 'i, R, F, T>where
R: RuleType + 'pratt,
F: FnMut(Pair<'i, R>) -> T,
impl<'pratt, 'i, R, F, T> PrattParserMap<'pratt, 'i, R, F, T>where
R: RuleType + 'pratt,
F: FnMut(Pair<'i, R>) -> T,
sourcepub fn map_prefix<X>(self, prefix: X) -> Selfwhere
X: FnMut(Pair<'i, R>, T) -> T + 'i,
pub fn map_prefix<X>(self, prefix: X) -> Selfwhere
X: FnMut(Pair<'i, R>, T) -> T + 'i,
Maps prefix operators with closure prefix
.
sourcepub fn map_postfix<X>(self, postfix: X) -> Selfwhere
X: FnMut(T, Pair<'i, R>) -> T + 'i,
pub fn map_postfix<X>(self, postfix: X) -> Selfwhere
X: FnMut(T, Pair<'i, R>) -> T + 'i,
Maps postfix operators with closure postfix
.
sourcepub fn map_infix<X>(self, infix: X) -> Selfwhere
X: FnMut(T, Pair<'i, R>, T) -> T + 'i,
pub fn map_infix<X>(self, infix: X) -> Selfwhere
X: FnMut(T, Pair<'i, R>, T) -> T + 'i,
Maps infix operators with a closure infix
.
sourcepub fn parse<P: Iterator<Item = Pair<'i, R>>>(&mut self, pairs: P) -> T
pub fn parse<P: Iterator<Item = Pair<'i, R>>>(&mut self, pairs: P) -> T
The last method to call on the provided pairs to execute the Pratt
parser (previously defined using map_primary
, map_prefix
, map_postfix
,
and map_infix
methods).