pub struct TriviaPreservingParser { /* private fields */ }Expand description
Parser that preserves trivia.
A parser that attaches comments and whitespace to AST nodes for formatting.
Implementations§
Source§impl TriviaPreservingParser
impl TriviaPreservingParser
Sourcepub fn new(source: String) -> TriviaPreservingParser
pub fn new(source: String) -> TriviaPreservingParser
Create a new trivia-preserving parser
Sourcepub fn parse(self) -> NodeWithTrivia
pub fn parse(self) -> NodeWithTrivia
Parse and return AST with trivia preserved.
Returns a node with leading and trailing trivia attached.
Auto Trait Implementations§
impl Freeze for TriviaPreservingParser
impl RefUnwindSafe for TriviaPreservingParser
impl Send for TriviaPreservingParser
impl Sync for TriviaPreservingParser
impl Unpin for TriviaPreservingParser
impl UnsafeUnpin for TriviaPreservingParser
impl UnwindSafe for TriviaPreservingParser
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