diff options
Diffstat (limited to 'src/parser/grammar/expressions.rs')
-rw-r--r-- | src/parser/grammar/expressions.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/parser/grammar/expressions.rs b/src/parser/grammar/expressions.rs index 881d947ac..ef3a0f76c 100644 --- a/src/parser/grammar/expressions.rs +++ b/src/parser/grammar/expressions.rs | |||
@@ -34,12 +34,11 @@ pub(super) fn expr(p: &mut Parser) { | |||
34 | loop { | 34 | loop { |
35 | lhs = match p.current() { | 35 | lhs = match p.current() { |
36 | L_PAREN => call_expr(p, lhs), | 36 | L_PAREN => call_expr(p, lhs), |
37 | DOT if p.nth(1) == IDENT => | 37 | DOT if p.nth(1) == IDENT => if p.nth(2) == L_PAREN { |
38 | if p.nth(2) == L_PAREN { | 38 | method_call_expr(p, lhs) |
39 | method_call_expr(p, lhs) | 39 | } else { |
40 | } else { | 40 | field_expr(p, lhs) |
41 | field_expr(p, lhs) | 41 | }, |
42 | } | ||
43 | _ => break, | 42 | _ => break, |
44 | } | 43 | } |
45 | } | 44 | } |
@@ -193,11 +192,11 @@ fn struct_lit(p: &mut Parser) { | |||
193 | expr(p); | 192 | expr(p); |
194 | } | 193 | } |
195 | m.complete(p, STRUCT_LIT_FIELD); | 194 | m.complete(p, STRUCT_LIT_FIELD); |
196 | }, | 195 | } |
197 | DOTDOT => { | 196 | DOTDOT => { |
198 | p.bump(); | 197 | p.bump(); |
199 | expr(p); | 198 | expr(p); |
200 | }, | 199 | } |
201 | _ => p.err_and_bump("expected identifier"), | 200 | _ => p.err_and_bump("expected identifier"), |
202 | } | 201 | } |
203 | if !p.at(R_CURLY) { | 202 | if !p.at(R_CURLY) { |