mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-04 09:30:45 +00:00
Parse do yeet
expressions
This commit is contained in:
parent
3033c3ddbf
commit
4a16afa264
7 changed files with 73 additions and 5 deletions
|
@ -148,11 +148,16 @@ impl<'t> Parser<'t> {
|
|||
kinds.contains(self.current())
|
||||
}
|
||||
|
||||
/// Checks if the current token is contextual keyword with text `t`.
|
||||
/// Checks if the current token is contextual keyword `kw`.
|
||||
pub(crate) fn at_contextual_kw(&self, kw: SyntaxKind) -> bool {
|
||||
self.inp.contextual_kind(self.pos) == kw
|
||||
}
|
||||
|
||||
/// Checks if the nth token is contextual keyword `kw`.
|
||||
pub(crate) fn nth_at_contextual_kw(&self, n: usize, kw: SyntaxKind) -> bool {
|
||||
self.inp.contextual_kind(self.pos + n) == kw
|
||||
}
|
||||
|
||||
/// Starts a new node in the syntax tree. All nodes and tokens
|
||||
/// consumed between the `start` and the corresponding `Marker::complete`
|
||||
/// belong to the same node.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue