pub struct MojoParser<'config> { /* private fields */ }Expand description
Mojo syntax parser
Implementations§
Source§impl<'config> MojoParser<'config>
impl<'config> MojoParser<'config>
Sourcepub fn new(config: &'config MojoLanguage) -> Self
pub fn new(config: &'config MojoLanguage) -> Self
Creates a new Mojo parser with the given language configuration.
Trait Implementations§
Source§impl<'config> Parser<MojoLanguage> for MojoParser<'config>
impl<'config> Parser<MojoLanguage> for MojoParser<'config>
Source§fn parse<'a, S: Source + ?Sized>(
&self,
source: &'a S,
edits: &[TextEdit],
cache: &'a mut impl ParseCache<MojoLanguage>,
) -> ParseOutput<'a, MojoLanguage>
fn parse<'a, S: Source + ?Sized>( &self, source: &'a S, edits: &[TextEdit], cache: &'a mut impl ParseCache<MojoLanguage>, ) -> ParseOutput<'a, MojoLanguage>
The core parsing entry point for converting tokens into a syntax tree. Read more
Source§impl<'config> Pratt<MojoLanguage> for MojoParser<'config>
impl<'config> Pratt<MojoLanguage> for MojoParser<'config>
Source§fn primary<'a, S: Source + ?Sized>(
&self,
state: &mut ParserState<'a, MojoLanguage, S>,
) -> &'a GreenNode<'a, MojoLanguage>
fn primary<'a, S: Source + ?Sized>( &self, state: &mut ParserState<'a, MojoLanguage, S>, ) -> &'a GreenNode<'a, MojoLanguage>
Parses a primary expression (e.g., literals, identifiers, group).
Source§fn prefix<'a, S: Source + ?Sized>(
&self,
state: &mut ParserState<'a, MojoLanguage, S>,
) -> &'a GreenNode<'a, MojoLanguage>
fn prefix<'a, S: Source + ?Sized>( &self, state: &mut ParserState<'a, MojoLanguage, S>, ) -> &'a GreenNode<'a, MojoLanguage>
Handles prefix operators and primary expressions. Read more
Source§fn infix<'a, S: Source + ?Sized>(
&self,
state: &mut ParserState<'a, MojoLanguage, S>,
left: &'a GreenNode<'a, MojoLanguage>,
min_precedence: u8,
) -> Option<&'a GreenNode<'a, MojoLanguage>>
fn infix<'a, S: Source + ?Sized>( &self, state: &mut ParserState<'a, MojoLanguage, S>, left: &'a GreenNode<'a, MojoLanguage>, min_precedence: u8, ) -> Option<&'a GreenNode<'a, MojoLanguage>>
Handles infix and postfix operators. Read more
Auto Trait Implementations§
impl<'config> Freeze for MojoParser<'config>
impl<'config> RefUnwindSafe for MojoParser<'config>
impl<'config> Send for MojoParser<'config>
impl<'config> Sync for MojoParser<'config>
impl<'config> Unpin for MojoParser<'config>
impl<'config> UnsafeUnpin for MojoParser<'config>
impl<'config> UnwindSafe for MojoParser<'config>
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