Struct biome_json_parser::CompletedMarker
source · pub struct CompletedMarker { /* private fields */ }Expand description
A structure signifying a completed node
Implementations§
source§impl CompletedMarker
impl CompletedMarker
pub fn new(start_pos: u32, finish_pos: u32, offset: TextSize) -> CompletedMarker
sourcepub fn change_kind<P>(&mut self, p: &mut P, new_kind: <P as Parser>::Kind)where
P: Parser,
pub fn change_kind<P>(&mut self, p: &mut P, new_kind: <P as Parser>::Kind)where
P: Parser,
Change the kind of node this marker represents
pub fn change_to_bogus<P>(&mut self, p: &mut P)where
P: Parser,
sourcepub fn text<P, 'a>(&self, p: &'a P) -> &'a strwhere
P: Parser,
pub fn text<P, 'a>(&self, p: &'a P) -> &'a strwhere
P: Parser,
Get the underlying text of a marker
sourcepub fn precede<P>(self, p: &mut P) -> Markerwhere
P: Parser,
pub fn precede<P>(self, p: &mut P) -> Markerwhere
P: Parser,
This method allows to create a new node which starts
before the current one. That is, parser could start
node A, then complete it, and then after parsing the
whole A, decide that it should have started some node
B before starting A. precede allows to do exactly
that. See also docs about forward_parent in Event::Start.
Given completed events [START, FINISH] and its corresponding
CompletedMarker(pos: 0, _).
Append a new START events as [START, FINISH, NEWSTART],
then mark NEWSTART as START’s parent with saving its relative
distance to NEWSTART into forward_parent(=2 in this case);
sourcepub fn undo_completion<P>(self, p: &mut P) -> Markerwhere
P: Parser,
pub fn undo_completion<P>(self, p: &mut P) -> Markerwhere
P: Parser,
Undo this completion and turns into a Marker
pub fn kind<P>(&self, p: &P) -> <P as Parser>::Kindwhere
P: Parser,
Trait Implementations§
source§impl Clone for CompletedMarker
impl Clone for CompletedMarker
source§fn clone(&self) -> CompletedMarker
fn clone(&self) -> CompletedMarker
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 CompletedMarker
impl Debug for CompletedMarker
source§impl From<CompletedMarker> for ParsedSyntax
impl From<CompletedMarker> for ParsedSyntax
source§fn from(marker: CompletedMarker) -> ParsedSyntax
fn from(marker: CompletedMarker) -> ParsedSyntax
Converts to this type from the input type.
source§impl Hash for CompletedMarker
impl Hash for CompletedMarker
source§impl PartialEq for CompletedMarker
impl PartialEq for CompletedMarker
source§fn eq(&self, other: &CompletedMarker) -> bool
fn eq(&self, other: &CompletedMarker) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for CompletedMarker
impl StructuralEq for CompletedMarker
impl StructuralPartialEq for CompletedMarker
Auto Trait Implementations§
impl RefUnwindSafe for CompletedMarker
impl Send for CompletedMarker
impl Sync for CompletedMarker
impl Unpin for CompletedMarker
impl UnwindSafe for CompletedMarker
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