[−][src]Struct rslint_parser::CompletedMarker
A structure signifying a completed node
Implementations
impl CompletedMarker
[src]
pub fn new(start_pos: u32, finish_pos: u32, kind: SyntaxKind) -> Self
[src]
pub fn change_kind(&mut self, p: &mut Parser<'_>, new_kind: SyntaxKind)
[src]
Change the kind of node this marker represents
pub fn offset_range(&self, p: &Parser<'_>, range: TextRange) -> TextRange
[src]
pub fn range(&self, p: &Parser<'_>) -> TextRange
[src]
Get the range of the marker
pub fn text<'a>(&self, p: &'a Parser<'_>) -> &'a str
[src]
Get the underlying text of a marker
pub fn precede(self, p: &mut Parser<'_>) -> Marker
[src]
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);
pub fn undo_completion(self, p: &mut Parser<'_>) -> Marker
[src]
Undo this completion and turns into a Marker
pub fn kind(&self) -> SyntaxKind
[src]
Trait Implementations
impl Clone for CompletedMarker
[src]
fn clone(&self) -> CompletedMarker
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CompletedMarker
[src]
impl Debug for CompletedMarker
[src]
impl Eq for CompletedMarker
[src]
impl Hash for CompletedMarker
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<CompletedMarker> for CompletedMarker
[src]
fn eq(&self, other: &CompletedMarker) -> bool
[src]
fn ne(&self, other: &CompletedMarker) -> bool
[src]
impl StructuralEq for CompletedMarker
[src]
impl StructuralPartialEq for CompletedMarker
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erasable for T
unsafe fn unerase(this: NonNull<Erased>) -> NonNull<T>
const ACK_1_1_0: bool
fn erase(this: NonNull<Self>) -> NonNull<Erased>
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,