aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar/expressions/atom.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-08 08:38:53 +0100
committerAleksey Kladov <[email protected]>2018-09-08 08:38:53 +0100
commit749907d330e5487eb7997479e2aba4ac2c2e3494 (patch)
tree0668eeb5ba9cbc8e1eb1b6e6ae3de70cf6aaa2a9 /crates/libsyntax2/src/grammar/expressions/atom.rs
parentfebbc9acdd0166530499b9b129ee703fcbfbe978 (diff)
simplify
Diffstat (limited to 'crates/libsyntax2/src/grammar/expressions/atom.rs')
-rw-r--r--crates/libsyntax2/src/grammar/expressions/atom.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/libsyntax2/src/grammar/expressions/atom.rs b/crates/libsyntax2/src/grammar/expressions/atom.rs
index 1488e12a4..fdb4718ba 100644
--- a/crates/libsyntax2/src/grammar/expressions/atom.rs
+++ b/crates/libsyntax2/src/grammar/expressions/atom.rs
@@ -18,7 +18,7 @@ pub(crate) const LITERAL_FIRST: TokenSet =
18 STRING, RAW_STRING, BYTE_STRING, RAW_BYTE_STRING]; 18 STRING, RAW_STRING, BYTE_STRING, RAW_BYTE_STRING];
19 19
20pub(crate) fn literal(p: &mut Parser) -> Option<CompletedMarker> { 20pub(crate) fn literal(p: &mut Parser) -> Option<CompletedMarker> {
21 if !LITERAL_FIRST.contains(p.current()) { 21 if !p.at_ts(LITERAL_FIRST) {
22 return None; 22 return None;
23 } 23 }
24 let m = p.start(); 24 let m = p.start();
@@ -108,7 +108,7 @@ fn tuple_expr(p: &mut Parser) -> CompletedMarker {
108 let mut saw_expr = false; 108 let mut saw_expr = false;
109 while !p.at(EOF) && !p.at(R_PAREN) { 109 while !p.at(EOF) && !p.at(R_PAREN) {
110 saw_expr = true; 110 saw_expr = true;
111 if !EXPR_FIRST.contains(p.current()) { 111 if !p.at_ts(EXPR_FIRST) {
112 p.error("expected expression"); 112 p.error("expected expression");
113 break; 113 break;
114 } 114 }
@@ -147,7 +147,7 @@ fn array_expr(p: &mut Parser) -> CompletedMarker {
147 if p.at(R_BRACK) { 147 if p.at(R_BRACK) {
148 break; 148 break;
149 } 149 }
150 if !EXPR_FIRST.contains(p.current()) { 150 if !p.at_ts(EXPR_FIRST) {
151 p.error("expected expression"); 151 p.error("expected expression");
152 break; 152 break;
153 } 153 }
@@ -360,7 +360,7 @@ fn return_expr(p: &mut Parser) -> CompletedMarker {
360 assert!(p.at(RETURN_KW)); 360 assert!(p.at(RETURN_KW));
361 let m = p.start(); 361 let m = p.start();
362 p.bump(); 362 p.bump();
363 if EXPR_FIRST.contains(p.current()) { 363 if p.at_ts(EXPR_FIRST) {
364 expr(p); 364 expr(p);
365 } 365 }
366 m.complete(p, RETURN_EXPR) 366 m.complete(p, RETURN_EXPR)
@@ -395,7 +395,7 @@ fn break_expr(p: &mut Parser) -> CompletedMarker {
395 let m = p.start(); 395 let m = p.start();
396 p.bump(); 396 p.bump();
397 p.eat(LIFETIME); 397 p.eat(LIFETIME);
398 if EXPR_FIRST.contains(p.current()) { 398 if p.at_ts(EXPR_FIRST) {
399 expr(p); 399 expr(p);
400 } 400 }
401 m.complete(p, BREAK_EXPR) 401 m.complete(p, BREAK_EXPR)