Struct glsl_lang_pp::parser::ParserRun
source · pub struct ParserRun<'i, 'cache> {
builder: GreenNodeBuilder<'cache>,
errors: Vec<Located<ErrorKind>>,
peeked: Option<Option<TextToken>>,
trivia_buffer: VecDeque<TextToken>,
source: &'i str,
input: Lexer<'i>,
}
Fields§
§builder: GreenNodeBuilder<'cache>
§errors: Vec<Located<ErrorKind>>
§peeked: Option<Option<TextToken>>
§trivia_buffer: VecDeque<TextToken>
§source: &'i str
§input: Lexer<'i>
Implementations§
source§impl<'i, 'cache> ParserRun<'i, 'cache>
impl<'i, 'cache> ParserRun<'i, 'cache>
fn new(source: &'i str) -> Self
fn parse_ast(self) -> Ast
fn parse_one( self, f: impl FnOnce(&mut Self), ) -> Option<SyntaxNode<PreprocessorLang>>
fn checkpoint(&mut self) -> Checkpoint
fn start_node(&mut self, kind: SyntaxKind)
fn start_node_at(&mut self, checkpoint: Checkpoint, kind: SyntaxKind)
fn finish_node(&mut self)
source§impl<'i, 'cache> ParserRun<'i, 'cache>
impl<'i, 'cache> ParserRun<'i, 'cache>
fn skip(&mut self, what: impl Fn(&Token) -> bool)
fn skip_trivia(&mut self)
fn peek(&mut self) -> Option<TextToken>
fn raw(&self, token: TextToken) -> &'i str
fn text(&self, token: TextToken) -> Unescaped<'_>
fn eat_trivia(&mut self)
fn buffer_trivia(&mut self)
fn push_error(&mut self, error_kind: ErrorKind, range: TextRange)
fn expect_one(&mut self, expected: Token) -> ExpectAny
fn expect_any(&mut self, expected: &[Token], dont_bump: &[Token]) -> ExpectAny
fn bump(&mut self)
Auto Trait Implementations§
impl<'i, 'cache> Freeze for ParserRun<'i, 'cache>
impl<'i, 'cache> RefUnwindSafe for ParserRun<'i, 'cache>
impl<'i, 'cache> Send for ParserRun<'i, 'cache>
impl<'i, 'cache> Sync for ParserRun<'i, 'cache>
impl<'i, 'cache> Unpin for ParserRun<'i, 'cache>
impl<'i, 'cache> !UnwindSafe for ParserRun<'i, 'cache>
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more