aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-14 09:46:46 +0100
committerAleksey Kladov <[email protected]>2018-08-14 09:46:46 +0100
commitde02d2891ec7f7b295e33887d49de954f677387a (patch)
tree3c3526196a440d06217ef1e81bce9d9c62d49b59 /crates/libsyntax2/src/grammar
parent2b828c68e8acda628d6e3a36827d1ffd9c9aaec6 (diff)
full range expr
Diffstat (limited to 'crates/libsyntax2/src/grammar')
-rw-r--r--crates/libsyntax2/src/grammar/expressions/mod.rs6
1 files changed, 5 insertions, 1 deletions
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<CompletedMarker> {
174 p.bump(); 174 p.bump();
175 PREFIX_EXPR 175 PREFIX_EXPR
176 } 176 }
177 // test full_range_expr
178 // fn foo() { xs[..]; }
177 DOTDOT => { 179 DOTDOT => {
178 m = p.start(); 180 m = p.start();
179 p.bump(); 181 p.bump();
180 expr_bp(p, r, 2); 182 if EXPR_FIRST.contains(p.current()) {
183 expr_bp(p, r, 2);
184 }
181 return Some(m.complete(p, RANGE_EXPR)); 185 return Some(m.complete(p, RANGE_EXPR));
182 } 186 }
183 _ => { 187 _ => {