aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/attributes.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-05-15 13:45:58 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-05-15 13:45:58 +0100
commitec7d2f64ade9ffa35a64e82ac53e65ad5cbe9efd (patch)
treeb8693ce808a9ca2e7eaae5013644a1082fc7bb17 /crates/ra_parser/src/grammar/attributes.rs
parent64ab5ab10d32e7e8ec085af818d3d94211aea39b (diff)
parent993abedd77cf23ce2281b6c8e60cab49ab4fa97e (diff)
Merge #1278
1278: Apply T! macro where posible r=matklad a=pasa apply T! macro implemented in #1248 Co-authored-by: Sergey Parilin <[email protected]>
Diffstat (limited to 'crates/ra_parser/src/grammar/attributes.rs')
-rw-r--r--crates/ra_parser/src/grammar/attributes.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_parser/src/grammar/attributes.rs b/crates/ra_parser/src/grammar/attributes.rs
index cd30e8a45..20d58445f 100644
--- a/crates/ra_parser/src/grammar/attributes.rs
+++ b/crates/ra_parser/src/grammar/attributes.rs
@@ -1,28 +1,28 @@
1use super::*; 1use super::*;
2 2
3pub(super) fn inner_attributes(p: &mut Parser) { 3pub(super) fn inner_attributes(p: &mut Parser) {
4 while p.current() == POUND && p.nth(1) == EXCL { 4 while p.current() == T![#] && p.nth(1) == T![!] {
5 attribute(p, true) 5 attribute(p, true)
6 } 6 }
7} 7}
8 8
9pub(super) fn outer_attributes(p: &mut Parser) { 9pub(super) fn outer_attributes(p: &mut Parser) {
10 while p.at(POUND) { 10 while p.at(T![#]) {
11 attribute(p, false) 11 attribute(p, false)
12 } 12 }
13} 13}
14 14
15fn attribute(p: &mut Parser, inner: bool) { 15fn attribute(p: &mut Parser, inner: bool) {
16 let attr = p.start(); 16 let attr = p.start();
17 assert!(p.at(POUND)); 17 assert!(p.at(T![#]));
18 p.bump(); 18 p.bump();
19 19
20 if inner { 20 if inner {
21 assert!(p.at(EXCL)); 21 assert!(p.at(T![!]));
22 p.bump(); 22 p.bump();
23 } 23 }
24 24
25 if p.at(L_BRACK) { 25 if p.at(T!['[']) {
26 items::token_tree(p); 26 items::token_tree(p);
27 } else { 27 } else {
28 p.error("expected `[`"); 28 p.error("expected `[`");