pub struct ParseBuffer<'a> { /* private fields */ }Expand description
A low-level buffer of tokens which represents a completely lexed file.
A ParseBuffer will immediately lex an entire file and then store all
tokens internally. A ParseBuffer only used to pass to the top-level
parse function.
Implementations§
Source§impl ParseBuffer<'_>
impl ParseBuffer<'_>
Sourcepub fn new(input: &str) -> Result<ParseBuffer<'_>>
pub fn new(input: &str) -> Result<ParseBuffer<'_>>
Creates a new ParseBuffer by lexing the given input completely.
§Errors
Returns an error if input fails to lex.
Sourcepub fn new_with_lexer(lexer: Lexer<'_>) -> Result<ParseBuffer<'_>>
pub fn new_with_lexer(lexer: Lexer<'_>) -> Result<ParseBuffer<'_>>
Creates a new ParseBuffer by lexing the given input completely.
§Errors
Returns an error if input fails to lex.
Sourcepub fn track_instr_spans(&mut self, track: bool) -> &mut Self
pub fn track_instr_spans(&mut self, track: bool) -> &mut Self
Indicates whether the Expression::instr_spans field will be filled
in.
This is useful when enabling DWARF debugging information via
EncodeOptions::dwarf, for example.
Auto Trait Implementations§
impl<'a> !Freeze for ParseBuffer<'a>
impl<'a> !RefUnwindSafe for ParseBuffer<'a>
impl<'a> Send for ParseBuffer<'a>
impl<'a> !Sync for ParseBuffer<'a>
impl<'a> Unpin for ParseBuffer<'a>
impl<'a> !UnwindSafe for ParseBuffer<'a>
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