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),
}
Expand description
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)
Tuple Fields
0: Span
An empty regex that matches everything.
Flags(SetFlags)
Tuple Fields
0: SetFlags
A set of flags, e.g., (?is)
.
Literal(Literal)
Tuple Fields
0: Literal
A single character literal, which includes escape sequences.
Dot(Span)
Tuple Fields
0: Span
The “any character” class.
Assertion(Assertion)
Tuple Fields
0: Assertion
A single zero-width assertion.
Class(Class)
Tuple Fields
0: Class
A single character class. This includes all forms of character classes
except for .
. e.g., \d
, \pN
, [a-z]
and [[:alpha:]]
.
Repetition(Repetition)
Tuple Fields
0: Repetition
A repetition operator applied to an arbitrary regular expression.
Group(Group)
Tuple Fields
0: Group
A grouped regular expression.
Alternation(Alternation)
Tuple Fields
0: Alternation
An alternation of regular expressions.
Concat(Concat)
Tuple Fields
0: Concat
A concatenation of regular expressions.
Implementations
Trait Implementations
Print 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
.
A custom Drop
impl is used for Ast
such that it uses constant stack
space but heap space proportional to the depth of the Ast
.
Auto Trait Implementations
impl RefUnwindSafe for Ast
impl UnwindSafe for Ast
Blanket Implementations
Mutably borrows from an owned value. Read more