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>

source

fn new(source: &'i str) -> Self

source

fn parse_ast(self) -> Ast

source

fn parse_one( self, f: impl FnOnce(&mut Self), ) -> Option<SyntaxNode<PreprocessorLang>>

source

fn checkpoint(&mut self) -> Checkpoint

source

fn start_node(&mut self, kind: SyntaxKind)

source

fn start_node_at(&mut self, checkpoint: Checkpoint, kind: SyntaxKind)

source

fn finish_node(&mut self)

source§

impl<'i, 'cache> ParserRun<'i, 'cache>

source

fn skip(&mut self, what: impl Fn(&Token) -> bool)

source

fn skip_trivia(&mut self)

source

fn peek(&mut self) -> Option<TextToken>

source

fn raw(&self, token: TextToken) -> &'i str

source

fn text(&self, token: TextToken) -> Unescaped<'_>

source

fn eat_trivia(&mut self)

source

fn buffer_trivia(&mut self)

source

fn push_error(&mut self, error_kind: ErrorKind, range: TextRange)

source

fn expect_one(&mut self, expected: Token) -> ExpectAny

source

fn expect_any(&mut self, expected: &[Token], dont_bump: &[Token]) -> ExpectAny

source

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.