[−][src]Struct rslint_parser::LosslessTreeSink
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]
text: &'a str,
tokens: &'a [Token],
token_start: usize
) -> Self
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]
fn token(&mut self, kind: SyntaxKind)
[src]
fn start_node(&mut self, kind: SyntaxKind)
[src]
fn finish_node(&mut self)
[src]
fn error(&mut self, error: ParserError)
[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]
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, 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>,