From de02d2891ec7f7b295e33887d49de954f677387a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 14 Aug 2018 11:46:46 +0300 Subject: full range expr --- crates/libsyntax2/src/grammar/expressions/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/libsyntax2/src') diff --git a/crates/libsyntax2/src/grammar/expressions/mod.rs b/crates/libsyntax2/src/grammar/expressions/mod.rs index e56f3d30e..feef5f1d6 100644 --- a/crates/libsyntax2/src/grammar/expressions/mod.rs +++ b/crates/libsyntax2/src/grammar/expressions/mod.rs @@ -174,10 +174,14 @@ fn lhs(p: &mut Parser, r: Restrictions) -> Option { p.bump(); PREFIX_EXPR } + // test full_range_expr + // fn foo() { xs[..]; } DOTDOT => { m = p.start(); p.bump(); - expr_bp(p, r, 2); + if EXPR_FIRST.contains(p.current()) { + expr_bp(p, r, 2); + } return Some(m.complete(p, RANGE_EXPR)); } _ => { -- cgit v1.2.3