Struct sqruff_lib::core::parser::lexer::StringLexer
source · pub struct StringLexer<SegmentArgs: 'static + Clone> { /* private fields */ }
Expand description
This singleton matcher matches strings exactly.
This is the simplest usable matcher, but it also defines some of the
mechanisms for more complicated matchers, which may simply override the
_match
function rather than the public match
function. This acts as
the base class for matchers.
Implementations§
source§impl<SegmentArgs: Clone + Debug> StringLexer<SegmentArgs>
impl<SegmentArgs: Clone + Debug> StringLexer<SegmentArgs>
Trait Implementations§
source§impl<SegmentArgs: Clone + 'static + Clone> Clone for StringLexer<SegmentArgs>
impl<SegmentArgs: Clone + 'static + Clone> Clone for StringLexer<SegmentArgs>
source§fn clone(&self) -> StringLexer<SegmentArgs>
fn clone(&self) -> StringLexer<SegmentArgs>
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<SegmentArgs: Clone + Debug> Matcher for StringLexer<SegmentArgs>
impl<SegmentArgs: Clone + Debug> Matcher for StringLexer<SegmentArgs>
source§fn match_(&self, forward_string: String) -> Result<LexMatch, ValueError>
fn match_(&self, forward_string: String) -> Result<LexMatch, ValueError>
Given a string, match what we can and return the rest.
source§fn get_sub_divider(&self) -> Option<Box<dyn Matcher>>
fn get_sub_divider(&self) -> Option<Box<dyn Matcher>>
Access methods that need to be implemented by the subclass.
Get the sub-divider for this matcher.
fn get_trim_post_subdivide(&self) -> Option<Box<dyn Matcher>>
fn construct_segment( &self, raw: String, pos_marker: PositionMarker ) -> Box<dyn Segment>
fn _subdivide(&self, matched: LexedElement) -> Vec<LexedElement>
source§fn _trim_match(&self, matched_str: &str) -> Vec<LexedElement>
fn _trim_match(&self, matched_str: &str) -> Vec<LexedElement>
Given a string, trim if we are allowed to.
Auto Trait Implementations§
impl<SegmentArgs> !RefUnwindSafe for StringLexer<SegmentArgs>
impl<SegmentArgs> !Send for StringLexer<SegmentArgs>
impl<SegmentArgs> !Sync for StringLexer<SegmentArgs>
impl<SegmentArgs> Unpin for StringLexer<SegmentArgs>where
SegmentArgs: Unpin,
impl<SegmentArgs> !UnwindSafe for StringLexer<SegmentArgs>
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