pub struct Parser { /* private fields */ }Expand description
A syntax parser.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn update(&mut self, new_settings: &Settings)
pub fn update(&mut self, new_settings: &Settings)
Updates the parser with the given Settings,
restarting it from the first line.
Sourcepub fn change_line(&mut self, line: usize)
pub fn change_line(&mut self, line: usize)
Changes the line the parser is currently on.
Sourcepub fn parse_line(&mut self, line: &str) -> CodeIterator<'_>
pub fn parse_line(&mut self, line: &str) -> CodeIterator<'_>
Highlights the given line, returning a CodeIterator.
Sourcepub fn current_line(&self) -> usize
pub fn current_line(&self) -> usize
Returns the line the parser is currently on.
Trait Implementations§
Source§impl Parser for Parser
impl Parser for Parser
Source§type Iterator<'a> = Box<dyn Iterator<Item = (Range<usize>, Code)> + 'a>
type Iterator<'a> = Box<dyn Iterator<Item = (Range<usize>, Code)> + 'a>
The parse iterator type.
Source§fn update(&mut self, new_settings: &Self::Settings)
fn update(&mut self, new_settings: &Self::Settings)
Updates the [
Parser] with some new [Self::Settings].Source§fn change_line(&mut self, line: usize)
fn change_line(&mut self, line: usize)
Notifies the [
Parser] that the line at the given index has changed.Source§fn parse_line(&mut self, line: &str) -> Self::Iterator<'_>
fn parse_line(&mut self, line: &str) -> Self::Iterator<'_>
Parses the given line. Read more
Source§fn current_line(&self) -> usize
fn current_line(&self) -> usize
Returns the current line of the [
Parser]. Read moreAuto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
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