pub enum NonFinalNode {
Show 15 variants
Escape,
HexEscape0,
HexEscape1(u8),
OpenClass0,
OpenClassNeg,
OpenClass(bool, Vec<ClassItem>),
OpenByteRange(u8),
ByteRange(u8, u8),
OpenGroup,
OpenExtendedGroup,
OpenNonCapturingGroup,
OpenAlt(Vec<FinalNode>),
RepeatMin(String),
RepeatMax(String, String),
RepeatToken(String, usize, Option<usize>),
}
Expand description
AST nodes used internally during parsing.
Variants§
Escape
HexEscape0
HexEscape1(u8)
OpenClass0
OpenClassNeg
OpenClass(bool, Vec<ClassItem>)
OpenByteRange(u8)
ByteRange(u8, u8)
OpenGroup
OpenExtendedGroup
OpenNonCapturingGroup
OpenAlt(Vec<FinalNode>)
RepeatMin(String)
RepeatMax(String, String)
RepeatToken(String, usize, Option<usize>)
Implementations§
Source§impl NonFinalNode
impl NonFinalNode
Sourcepub fn reason(&self) -> String
pub fn reason(&self) -> String
Parsing can fail when a NonFinalNode
is not converted into a
FinalNode
. This function returns an explanation to show to the user.
Sourcepub fn unwrap_open_class(self) -> (bool, Vec<ClassItem>)
pub fn unwrap_open_class(self) -> (bool, Vec<ClassItem>)
Returns the contents of this NonFinalNode::OpenClass(..)
.
Panics if this is a different enum variant.
Sourcepub fn unwrap_open_alt(self) -> Vec<FinalNode>
pub fn unwrap_open_alt(self) -> Vec<FinalNode>
Returns the contents of this NonFinalNode::OpenAlt(..)
.
Panics if this is a different enum variant.
Sourcepub fn unwrap_repeat_min(self) -> String
pub fn unwrap_repeat_min(self) -> String
Returns the contents of this NonFinalNode::RepeatMin(..)
.
Panics if this is a different enum variant.
Sourcepub fn unwrap_repeat_max(self) -> (String, String)
pub fn unwrap_repeat_max(self) -> (String, String)
Returns the contents of this NonFinalNode::RepeatMax(..)
.
Panics if this is a different enum variant.
Trait Implementations§
Source§impl Clone for NonFinalNode
impl Clone for NonFinalNode
Source§fn clone(&self) -> NonFinalNode
fn clone(&self) -> NonFinalNode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NonFinalNode
impl Debug for NonFinalNode
Source§impl PartialEq for NonFinalNode
impl PartialEq for NonFinalNode
Source§impl PartialOrd for NonFinalNode
impl PartialOrd for NonFinalNode
impl StructuralPartialEq for NonFinalNode
Auto Trait Implementations§
impl Freeze for NonFinalNode
impl RefUnwindSafe for NonFinalNode
impl Send for NonFinalNode
impl Sync for NonFinalNode
impl Unpin for NonFinalNode
impl UnwindSafe for NonFinalNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more