From 08de1b4fa57ca78ad13026950b3eb024b7d2abf3 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 18 Dec 2020 18:58:42 +0100 Subject: Implement `RawAttr::filter` --- crates/parser/src/grammar.rs | 4 ++++ crates/parser/src/lib.rs | 3 +++ 2 files changed, 7 insertions(+) (limited to 'crates/parser') diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index 23039eba4..1a078f6b4 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs @@ -133,6 +133,10 @@ pub(crate) mod fragments { m.complete(p, MACRO_STMTS); } + + pub(crate) fn attr(p: &mut Parser) { + attributes::outer_attrs(p) + } } pub(crate) fn reparser( diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index 41e62116f..ab8e4c70e 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -99,6 +99,8 @@ pub enum FragmentKind { // FIXME: use separate fragment kinds for macro inputs and outputs? Items, Statements, + + Attr, } pub fn parse_fragment( @@ -118,6 +120,7 @@ pub fn parse_fragment( FragmentKind::Statement => grammar::fragments::stmt, FragmentKind::Items => grammar::fragments::macro_items, FragmentKind::Statements => grammar::fragments::macro_stmts, + FragmentKind::Attr => grammar::fragments::attr, }; parse_from_tokens(token_source, tree_sink, parser) } -- cgit v1.2.3