From 904a832b7cfc58bcf91ed7a17a5a177f8d36db1c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 31 Jul 2018 22:29:38 +0300 Subject: format --- src/parser/grammar/expressions.rs | 15 +++++++-------- src/parser/grammar/mod.rs | 4 +++- src/parser/grammar/type_args.rs | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src/parser/grammar') 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) { loop { lhs = match p.current() { L_PAREN => call_expr(p, lhs), - DOT if p.nth(1) == IDENT => - if p.nth(2) == L_PAREN { - method_call_expr(p, lhs) - } else { - field_expr(p, lhs) - } + DOT if p.nth(1) == IDENT => if p.nth(2) == L_PAREN { + method_call_expr(p, lhs) + } else { + field_expr(p, lhs) + }, _ => break, } } @@ -193,11 +192,11 @@ fn struct_lit(p: &mut Parser) { expr(p); } m.complete(p, STRUCT_LIT_FIELD); - }, + } DOTDOT => { p.bump(); expr(p); - }, + } _ => p.err_and_bump("expected identifier"), } if !p.at(R_CURLY) { diff --git a/src/parser/grammar/mod.rs b/src/parser/grammar/mod.rs index 53ef28181..69942e7f1 100644 --- a/src/parser/grammar/mod.rs +++ b/src/parser/grammar/mod.rs @@ -142,7 +142,9 @@ fn fn_value_parameters(p: &mut Parser) { _ => return, }; let m = p.start(); - for _ in 0..n_toks { p.bump(); } + for _ in 0..n_toks { + p.bump(); + } m.complete(p, SELF_PARAM); if !p.at(R_PAREN) { p.expect(COMMA); diff --git a/src/parser/grammar/type_args.rs b/src/parser/grammar/type_args.rs index 276c8b4ae..94d76b25a 100644 --- a/src/parser/grammar/type_args.rs +++ b/src/parser/grammar/type_args.rs @@ -33,16 +33,16 @@ fn type_arg(p: &mut Parser) { LIFETIME => { p.bump(); m.complete(p, LIFETIME_ARG); - }, + } IDENT if p.nth(1) == EQ => { name_ref(p); p.bump(); types::type_(p); m.complete(p, ASSOC_TYPE_ARG); - }, + } _ => { types::type_(p); m.complete(p, TYPE_ARG); - }, + } } } -- cgit v1.2.3