Struct i_slint_compiler::parser::DefaultParser
source · [−]pub struct DefaultParser<'a> { /* private fields */ }
Implementations
sourceimpl<'a> DefaultParser<'a>
impl<'a> DefaultParser<'a>
sourcepub fn new(source: &str, diags: &'a mut BuildDiagnostics) -> Self
pub fn new(source: &str, diags: &'a mut BuildDiagnostics) -> Self
Constructor that create a parser from the source code
sourcepub fn consume_ws(&mut self)
pub fn consume_ws(&mut self)
Consume all the whitespace
Trait Implementations
sourceimpl Parser for DefaultParser<'_>
impl Parser for DefaultParser<'_>
sourcefn start_node_impl(
&mut self,
kind: SyntaxKind,
checkpoint: Option<Self::Checkpoint>,
_: NodeToken
)
fn start_node_impl(
&mut self,
kind: SyntaxKind,
checkpoint: Option<Self::Checkpoint>,
_: NodeToken
)
Can only be called by Self::start_node
sourcefn finish_node_impl(&mut self, _: NodeToken)
fn finish_node_impl(&mut self, _: NodeToken)
Can only be called by Node::drop
type Checkpoint = Checkpoint
fn checkpoint(&mut self) -> Self::Checkpoint
sourcefn start_node(&mut self, kind: SyntaxKind) -> Node<'_, Self>
fn start_node(&mut self, kind: SyntaxKind) -> Node<'_, Self>
Enter a new node. The node is going to be finished when The return value of this function is dropped Read more
fn start_node_at(
&mut self,
checkpoint: Self::Checkpoint,
kind: SyntaxKind
) -> Node<'_, Self>
sourcefn expect(&mut self, kind: SyntaxKind) -> bool
fn expect(&mut self, kind: SyntaxKind) -> bool
Consume the token if it has the right kind, otherwise report a syntax error. Returns true if the token was consumed. Read more
sourcefn test(&mut self, kind: SyntaxKind) -> bool
fn test(&mut self, kind: SyntaxKind) -> bool
If the token if of this type, consume it and return true, otherwise return false
sourcefn until(&mut self, kind: SyntaxKind)
fn until(&mut self, kind: SyntaxKind)
consume everything until reaching a token of this kind
Auto Trait Implementations
impl<'a> RefUnwindSafe for DefaultParser<'a>
impl<'a> !Send for DefaultParser<'a>
impl<'a> !Sync for DefaultParser<'a>
impl<'a> Unpin for DefaultParser<'a>
impl<'a> !UnwindSafe for DefaultParser<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more