Enum Ast
pub enum Ast
An abstract syntax tree for a single regular expression.
An Ast's fmt::Display implementation uses constant stack space and heap
space proportional to the size of the Ast.
This type defines its own destructor that uses constant stack space and
heap space proportional to the size of the Ast.
Variants
-
Empty(Box<Span>) An empty regex that matches everything.
-
Flags(Box<SetFlags>) A set of flags, e.g.,
(?is).-
Literal(Box<Literal>) A single character literal, which includes escape sequences.
-
Dot(Box<Span>) The "any character" class.
-
Assertion(Box<Assertion>) A single zero-width assertion.
-
ClassUnicode(Box<ClassUnicode>) A single Unicode character class, e.g.,
\pLor\p{Greek}.-
ClassPerl(Box<ClassPerl>) A single perl character class, e.g.,
\dor\W.-
ClassBracketed(Box<ClassBracketed>) A single bracketed character class set, which may contain zero or more character ranges and/or zero or more nested classes. e.g.,
[a-zA-Z\pL].-
Repetition(Box<Repetition>) A repetition operator applied to an arbitrary regular expression.
-
Group(Box<Group>) A grouped regular expression.
-
Alternation(Box<Alternation>) An alternation of regular expressions.
-
Concat(Box<Concat>) A concatenation of regular expressions.
Implementations
impl Ast
fn empty(span: Span) -> AstCreate an "empty" AST item.
fn flags(e: SetFlags) -> AstCreate a "flags" AST item.
fn literal(e: Literal) -> AstCreate a "literal" AST item.
fn dot(span: Span) -> AstCreate a "dot" AST item.
fn assertion(e: Assertion) -> AstCreate a "assertion" AST item.
fn class_unicode(e: ClassUnicode) -> AstCreate a "Unicode class" AST item.
fn class_perl(e: ClassPerl) -> AstCreate a "Perl class" AST item.
fn class_bracketed(e: ClassBracketed) -> AstCreate a "bracketed class" AST item.
fn repetition(e: Repetition) -> AstCreate a "repetition" AST item.
fn group(e: Group) -> AstCreate a "group" AST item.
fn alternation(e: Alternation) -> AstCreate a "alternation" AST item.
fn concat(e: Concat) -> AstCreate a "concat" AST item.
fn span(&self) -> &SpanReturn the span of this abstract syntax tree.
fn is_empty(&self) -> boolReturn true if and only if this Ast is empty.
Trait Implementations
impl Clone for Ast
fn clone(&self) -> Self
impl Debug for Ast
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Ast
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Drop for Ast
fn drop(&mut self)
impl Eq for Ast
impl PartialEq for Ast
fn eq(&self, other: &Self) -> bool