From 50a02eb3593591a02677e1b56f24d7ff0459b9d0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 17:06:49 +0200 Subject: Rename ra_parser -> parser --- crates/ra_parser/src/grammar/attributes.rs | 48 ------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 crates/ra_parser/src/grammar/attributes.rs (limited to 'crates/ra_parser/src/grammar/attributes.rs') diff --git a/crates/ra_parser/src/grammar/attributes.rs b/crates/ra_parser/src/grammar/attributes.rs deleted file mode 100644 index f3158ade3..000000000 --- a/crates/ra_parser/src/grammar/attributes.rs +++ /dev/null @@ -1,48 +0,0 @@ -//! FIXME: write short doc here - -use super::*; - -pub(super) fn inner_attributes(p: &mut Parser) { - while p.at(T![#]) && p.nth(1) == T![!] { - attribute(p, true) - } -} - -pub(super) fn outer_attributes(p: &mut Parser) { - while p.at(T![#]) { - attribute(p, false) - } -} - -fn attribute(p: &mut Parser, inner: bool) { - let attr = p.start(); - assert!(p.at(T![#])); - p.bump(T![#]); - - if inner { - assert!(p.at(T![!])); - p.bump(T![!]); - } - - if p.eat(T!['[']) { - paths::use_path(p); - - match p.current() { - T![=] => { - p.bump(T![=]); - if expressions::literal(p).is_none() { - p.error("expected literal"); - } - } - T!['('] | T!['['] | T!['{'] => items::token_tree(p), - _ => {} - } - - if !p.eat(T![']']) { - p.error("expected `]`"); - } - } else { - p.error("expected `[`"); - } - attr.complete(p, ATTR); -} -- cgit v1.2.3