Enum regex_syntax::ast::parse::Primitive [−][src]
enum Primitive { Literal(Literal), Assertion(Assertion), Dot(Span), Perl(ClassPerl), Unicode(ClassUnicode), }
A primitive is an expression with no sub-expressions. This includes literals, assertions and non-set character classes. This representation is used as intermediate state in the parser.
This does not include ASCII character classes, since they can only appear within a set character class.
Variants
Literal(Literal)
Assertion(Assertion)
Dot(Span)
Perl(ClassPerl)
Unicode(ClassUnicode)
Methods
impl Primitive
[src]
impl Primitive
fn span(&self) -> &Span
[src]
fn span(&self) -> &Span
Return the span of this primitive.
fn into_ast(self) -> Ast
[src]
fn into_ast(self) -> Ast
Convert this primitive into a proper AST.
fn into_class_set_item<P: Borrow<Parser>>(
self,
p: &ParserI<P>
) -> Result<ClassSetItem, Error>
[src]
fn into_class_set_item<P: Borrow<Parser>>(
self,
p: &ParserI<P>
) -> Result<ClassSetItem, Error>
Convert this primitive into an item in a character class.
If this primitive is not a legal item (i.e., an assertion or a dot), then return an error.
fn into_class_literal<P: Borrow<Parser>>(
self,
p: &ParserI<P>
) -> Result<Literal, Error>
[src]
fn into_class_literal<P: Borrow<Parser>>(
self,
p: &ParserI<P>
) -> Result<Literal, Error>
Convert this primitive into a literal in a character class. In particular, literals are the only valid items that can appear in ranges.
If this primitive is not a legal item (i.e., a class, assertion or a dot), then return an error.
Trait Implementations
impl Clone for Primitive
[src]
impl Clone for Primitive
fn clone(&self) -> Primitive
[src]
fn clone(&self) -> Primitive
Returns 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 Primitive
[src]
impl Debug for Primitive
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for Primitive
[src]
impl Eq for Primitive
fn assert_receiver_is_total_eq(&self)
[src]
fn assert_receiver_is_total_eq(&self)
impl PartialEq for Primitive
[src]
impl PartialEq for Primitive