[][src]Struct rslint_parser::LosslessTreeSink

pub struct LosslessTreeSink<'a> { /* fields omitted */ }

Structure for converting events to a syntax tree representation, while preserving whitespace.

LosslessTreeSink also handles attachment of trivia (whitespace) to nodes.

Implementations

impl<'a> LosslessTreeSink<'a>[src]

pub fn new(text: &'a str, tokens: &'a [Token]) -> Self[src]

pub fn with_offset(
    text: &'a str,
    tokens: &'a [Token],
    token_start: usize
) -> Self
[src]

Make a new tree sink but start the sink at a specific token, this is used for making completed markers into AST nodes for rules which need them.

Panics

Panics if the token start does not line up to a token's start index or is out of bounds

pub fn finish(self) -> (GreenNode, Vec<ParserError>)[src]

Trait Implementations

impl<'a> Debug for LosslessTreeSink<'a>[src]

impl<'a> TreeSink for LosslessTreeSink<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for LosslessTreeSink<'a>

impl<'a> Send for LosslessTreeSink<'a>

impl<'a> Sync for LosslessTreeSink<'a>

impl<'a> Unpin for LosslessTreeSink<'a>

impl<'a> !UnwindSafe for LosslessTreeSink<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erasable for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.