Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/parser.rs')
-rw-r--r--crates/parser/src/parser.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/parser/src/parser.rs b/crates/parser/src/parser.rs
index 7d3eb5de25..f6b3783d1c 100644
--- a/crates/parser/src/parser.rs
+++ b/crates/parser/src/parser.rs
@@ -131,6 +131,14 @@ impl<'t> Parser<'t> {
true
}
+ pub(crate) fn eat_contextual_kw(&mut self, kind: SyntaxKind) -> bool {
+ if !self.at_contextual_kw(kind) {
+ return false;
+ }
+ self.bump_remap(kind);
+ true
+ }
+
fn at_composite2(&self, n: usize, k1: SyntaxKind, k2: SyntaxKind) -> bool {
self.inp.kind(self.pos + n) == k1
&& self.inp.kind(self.pos + n + 1) == k2