aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/parsing/grammar/attributes.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-21 10:27:45 +0000
committerAleksey Kladov <[email protected]>2019-02-21 10:27:45 +0000
commitd334b5a1db9ec6a57f54077d422a3f4b3c8c1178 (patch)
tree9d930fe43452e8188594c612de433a77524e4754 /crates/ra_syntax/src/parsing/grammar/attributes.rs
parent18b0c509f77a8e06141fee6668532cced1ebf5d8 (diff)
move parser to a separate crate
Diffstat (limited to 'crates/ra_syntax/src/parsing/grammar/attributes.rs')
-rw-r--r--crates/ra_syntax/src/parsing/grammar/attributes.rs31
1 files changed, 0 insertions, 31 deletions
diff --git a/crates/ra_syntax/src/parsing/grammar/attributes.rs b/crates/ra_syntax/src/parsing/grammar/attributes.rs
deleted file mode 100644
index cd30e8a45..000000000
--- a/crates/ra_syntax/src/parsing/grammar/attributes.rs
+++ /dev/null
@@ -1,31 +0,0 @@
1use super::*;
2
3pub(super) fn inner_attributes(p: &mut Parser) {
4 while p.current() == POUND && p.nth(1) == EXCL {
5 attribute(p, true)
6 }
7}
8
9pub(super) fn outer_attributes(p: &mut Parser) {
10 while p.at(POUND) {
11 attribute(p, false)
12 }
13}
14
15fn attribute(p: &mut Parser, inner: bool) {
16 let attr = p.start();
17 assert!(p.at(POUND));
18 p.bump();
19
20 if inner {
21 assert!(p.at(EXCL));
22 p.bump();
23 }
24
25 if p.at(L_BRACK) {
26 items::token_tree(p);
27 } else {
28 p.error("expected `[`");
29 }
30 attr.complete(p, ATTR);
31}