Enum pest_meta::parser::ParserExpr
source · pub enum ParserExpr<'i> {
Show 17 variants
Str(String),
Insens(String),
Range(String, String),
Ident(String),
PeekSlice(i32, Option<i32>),
PosPred(Box<ParserNode<'i>>),
NegPred(Box<ParserNode<'i>>),
Seq(Box<ParserNode<'i>>, Box<ParserNode<'i>>),
Choice(Box<ParserNode<'i>>, Box<ParserNode<'i>>),
Opt(Box<ParserNode<'i>>),
Rep(Box<ParserNode<'i>>),
RepOnce(Box<ParserNode<'i>>),
RepExact(Box<ParserNode<'i>>, u32),
RepMin(Box<ParserNode<'i>>, u32),
RepMax(Box<ParserNode<'i>>, u32),
RepMinMax(Box<ParserNode<'i>>, u32, u32),
Push(Box<ParserNode<'i>>),
}
Expand description
All possible parser expressions
Variants§
Str(String)
Matches an exact string, e.g. "a"
Insens(String)
Matches an exact string, case insensitively (ASCII only), e.g. ^"a"
Range(String, String)
Matches one character in the range, e.g. 'a'..'z'
Ident(String)
Matches the rule with the given name, e.g. a
PeekSlice(i32, Option<i32>)
Matches a custom part of the stack, e.g. PEEK[..]
PosPred(Box<ParserNode<'i>>)
Positive lookahead; matches expression without making progress, e.g. &e
NegPred(Box<ParserNode<'i>>)
Negative lookahead; matches if expression doesn’t match, without making progress, e.g. !e
Seq(Box<ParserNode<'i>>, Box<ParserNode<'i>>)
Matches a sequence of two expressions, e.g. e1 ~ e2
Choice(Box<ParserNode<'i>>, Box<ParserNode<'i>>)
Matches either of two expressions, e.g. e1 | e2
Opt(Box<ParserNode<'i>>)
Optionally matches an expression, e.g. e?
Rep(Box<ParserNode<'i>>)
Matches an expression zero or more times, e.g. e*
RepOnce(Box<ParserNode<'i>>)
Matches an expression one or more times, e.g. e+
RepExact(Box<ParserNode<'i>>, u32)
Matches an expression an exact number of times, e.g. e{n}
RepMin(Box<ParserNode<'i>>, u32)
Matches an expression at least a number of times, e.g. e{n,}
RepMax(Box<ParserNode<'i>>, u32)
Matches an expression at most a number of times, e.g. e{,n}
RepMinMax(Box<ParserNode<'i>>, u32, u32)
Matches an expression a number of times within a range, e.g. e{m, n}
Push(Box<ParserNode<'i>>)
Matches an expression and pushes it to the stack, e.g. push(e)
Trait Implementations§
source§impl<'i> Clone for ParserExpr<'i>
impl<'i> Clone for ParserExpr<'i>
source§fn clone(&self) -> ParserExpr<'i>
fn clone(&self) -> ParserExpr<'i>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'i> Debug for ParserExpr<'i>
impl<'i> Debug for ParserExpr<'i>
source§impl<'i> PartialEq<ParserExpr<'i>> for ParserExpr<'i>
impl<'i> PartialEq<ParserExpr<'i>> for ParserExpr<'i>
source§fn eq(&self, other: &ParserExpr<'i>) -> bool
fn eq(&self, other: &ParserExpr<'i>) -> bool
self
and other
values to be equal, and is used
by ==
.