aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src/grammar/params.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/parser/src/grammar/params.rs')
-rw-r--r--crates/parser/src/grammar/params.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/parser/src/grammar/params.rs b/crates/parser/src/grammar/params.rs
index a665ffc13..3ee4e4fca 100644
--- a/crates/parser/src/grammar/params.rs
+++ b/crates/parser/src/grammar/params.rs
@@ -169,15 +169,20 @@ fn opt_self_param(p: &mut Parser) {
169 let la1 = p.nth(1); 169 let la1 = p.nth(1);
170 let la2 = p.nth(2); 170 let la2 = p.nth(2);
171 let la3 = p.nth(3); 171 let la3 = p.nth(3);
172 let n_toks = match (p.current(), la1, la2, la3) { 172 let mut n_toks = match (p.current(), la1, la2, la3) {
173 (T![&], T![self], _, _) => 2, 173 (T![&], T![self], _, _) => 2,
174 (T![&], T![mut], T![self], _) => 3, 174 (T![&], T![mut], T![self], _) => 3,
175 (T![&], LIFETIME, T![self], _) => 3, 175 (T![&], LIFETIME_IDENT, T![self], _) => 3,
176 (T![&], LIFETIME, T![mut], T![self]) => 4, 176 (T![&], LIFETIME_IDENT, T![mut], T![self]) => 4,
177 _ => return, 177 _ => return,
178 }; 178 };
179 m = p.start(); 179 m = p.start();
180 for _ in 0..n_toks { 180 p.bump_any();
181 if p.at(LIFETIME_IDENT) {
182 lifetime(p);
183 n_toks -= 1;
184 }
185 for _ in 1..n_toks {
181 p.bump_any(); 186 p.bump_any();
182 } 187 }
183 } 188 }