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