pub struct Parser { /* private fields */ }Expand description
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn parse(&mut self) -> ParseResult<Value>
pub fn parse(&mut self) -> ParseResult<Value>
Parse a single S-expression
Returns Ok(Value) on success, Err(ParseError) on failure.
Sourcepub fn peek_token(&mut self) -> ParseResult<&Token>
pub fn peek_token(&mut self) -> ParseResult<&Token>
Peek at the next token without consuming it
Returns Ok(&Token) if successful, Err(ParseError) on tokenizer error.
This is useful for checking if we’re at EOF before attempting to parse.
Sourcepub fn current_position(&self) -> Position
pub fn current_position(&self) -> Position
Get the current position in the source code
Returns the position of the last token consumed by the parser. Useful for error reporting.
Sourcepub fn parse_all(&mut self) -> ParseResult<Vec<Value>>
pub fn parse_all(&mut self) -> ParseResult<Vec<Value>>
Parse all S-expressions in input
Returns a list of all top-level expressions.
Auto Trait Implementations§
impl Freeze for Parser
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