pub struct Parser { /* private fields */ }Expand description
Primary library interface to RSX Parser
Allows customization through ParserConfig.
Support recovery after parsing invalid token.
Implementations§
source§impl Parser
impl Parser
sourcepub fn new(config: ParserConfig) -> Parser
pub fn new(config: ParserConfig) -> Parser
Create a new parser with the given ParserConfig.
sourcepub fn parse_simple(&self, v: impl Into<TokenStream>) -> Result<Vec<Node>>
pub fn parse_simple(&self, v: impl Into<TokenStream>) -> Result<Vec<Node>>
Parse the given proc-macro2::TokenStream or
proc-macro::TokenStream into a Node tree.
sourcepub fn parse_recoverable(
&self,
v: impl Into<TokenStream>
) -> ParsingResult<Vec<Node>>
pub fn parse_recoverable( &self, v: impl Into<TokenStream> ) -> ParsingResult<Vec<Node>>
Advance version of parse_simple that returns array of errors in case
of partial parsing.
sourcepub fn parse_syn_stream(
&self,
input: ParseStream<'_>
) -> ParsingResult<Vec<Node>>
pub fn parse_syn_stream( &self, input: ParseStream<'_> ) -> ParsingResult<Vec<Node>>
Parse a given ParseStream.
Auto Trait Implementations§
impl !RefUnwindSafe for Parser
impl !Send for Parser
impl !Sync for Parser
impl Unpin for Parser
impl !UnwindSafe for Parser
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