aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parser/grammar/mod.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/parser/grammar/mod.rs b/src/parser/grammar/mod.rs
index b8847fb68..53ef28181 100644
--- a/src/parser/grammar/mod.rs
+++ b/src/parser/grammar/mod.rs
@@ -126,15 +126,19 @@ fn fn_value_parameters(p: &mut Parser) {
126 // impl S { 126 // impl S {
127 // fn a(self) {} 127 // fn a(self) {}
128 // fn b(&self,) {} 128 // fn b(&self,) {}
129 // fn c(&mut self, x: i32) {} 129 // fn c(&'a self,) {}
130 // fn d(&'a mut self, x: i32) {}
130 // } 131 // }
131 fn self_param(p: &mut Parser) { 132 fn self_param(p: &mut Parser) {
132 let la1 = p.nth(1); 133 let la1 = p.nth(1);
133 let la2 = p.nth(2); 134 let la2 = p.nth(2);
134 let n_toks = match (p.current(), la1, la2) { 135 let la3 = p.nth(3);
135 (SELF_KW, _, _) => 1, 136 let n_toks = match (p.current(), la1, la2, la3) {
136 (AMPERSAND, SELF_KW, _) => 2, 137 (SELF_KW, _, _, _) => 1,
137 (AMPERSAND, MUT_KW, SELF_KW) => 3, 138 (AMPERSAND, SELF_KW, _, _) => 2,
139 (AMPERSAND, MUT_KW, SELF_KW, _) => 3,
140 (AMPERSAND, LIFETIME, SELF_KW, _) => 3,
141 (AMPERSAND, LIFETIME, MUT_KW, SELF_KW) => 4,
138 _ => return, 142 _ => return,
139 }; 143 };
140 let m = p.start(); 144 let m = p.start();