Enum regex_syntax::ast::Ast [−][src]
pub enum Ast {
Empty(Span),
Flags(SetFlags),
Literal(Literal),
Dot(Span),
Assertion(Assertion),
Class(Class),
Repetition(Repetition),
Group(Group),
Alternation(Alternation),
Concat(Concat),
}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(Span)An empty regex that matches everything.
Flags(SetFlags)A set of flags, e.g., (?is).
Literal(Literal)A single character literal, which includes escape sequences.
Dot(Span)The "any character" class.
Assertion(Assertion)A single zero-width assertion.
Class(Class)A single character class. This includes all forms of character classes
except for .. e.g., \d, \pN, [a-z] and [[:alpha:]].
Repetition(Repetition)A repetition operator applied to an arbitrary regular expression.
Group(Group)A grouped regular expression.
Alternation(Alternation)An alternation of regular expressions.
Concat(Concat)A concatenation of regular expressions.
Methods
impl Ast[src]
impl Astpub fn span(&self) -> &Span[src]
pub fn span(&self) -> &SpanReturn the span of this abstract syntax tree.
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolReturn true if and only if this Ast is empty.
Trait Implementations
impl Clone for Ast[src]
impl Clone for Astfn clone(&self) -> Ast[src]
fn clone(&self) -> AstReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Ast[src]
impl Debug for Astfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Eq for Ast[src]
impl Eq for Astimpl PartialEq for Ast[src]
impl PartialEq for Astfn eq(&self, other: &Ast) -> bool[src]
fn eq(&self, other: &Ast) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Ast) -> bool[src]
fn ne(&self, other: &Ast) -> boolThis method tests for !=.
impl Display for Ast[src]
impl Display for AstPrint a display representation of this Ast.
This does not preserve any of the original whitespace formatting that may have originally been present in the concrete syntax from which this Ast was generated.
This implementation uses constant stack space and heap space proportional
to the size of the Ast.
fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Drop for Ast[src]
impl Drop for AstA custom Drop impl is used for Ast such that it uses constant stack
space but heap space proportional to the depth of the Ast.