diff options
author | Jonas Schievink <[email protected]> | 2020-12-18 17:58:42 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-12-18 17:58:42 +0000 |
commit | 08de1b4fa57ca78ad13026950b3eb024b7d2abf3 (patch) | |
tree | 99279afbe385ee36fdcd3921a4a89784439705cf /crates/parser | |
parent | 03c177af89efcc238053b59069eda2c1c6772622 (diff) |
Implement `RawAttr::filter`
Diffstat (limited to 'crates/parser')
-rw-r--r-- | crates/parser/src/grammar.rs | 4 | ||||
-rw-r--r-- | crates/parser/src/lib.rs | 3 |
2 files changed, 7 insertions, 0 deletions
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 { | |||
133 | 133 | ||
134 | m.complete(p, MACRO_STMTS); | 134 | m.complete(p, MACRO_STMTS); |
135 | } | 135 | } |
136 | |||
137 | pub(crate) fn attr(p: &mut Parser) { | ||
138 | attributes::outer_attrs(p) | ||
139 | } | ||
136 | } | 140 | } |
137 | 141 | ||
138 | pub(crate) fn reparser( | 142 | 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 { | |||
99 | // FIXME: use separate fragment kinds for macro inputs and outputs? | 99 | // FIXME: use separate fragment kinds for macro inputs and outputs? |
100 | Items, | 100 | Items, |
101 | Statements, | 101 | Statements, |
102 | |||
103 | Attr, | ||
102 | } | 104 | } |
103 | 105 | ||
104 | pub fn parse_fragment( | 106 | pub fn parse_fragment( |
@@ -118,6 +120,7 @@ pub fn parse_fragment( | |||
118 | FragmentKind::Statement => grammar::fragments::stmt, | 120 | FragmentKind::Statement => grammar::fragments::stmt, |
119 | FragmentKind::Items => grammar::fragments::macro_items, | 121 | FragmentKind::Items => grammar::fragments::macro_items, |
120 | FragmentKind::Statements => grammar::fragments::macro_stmts, | 122 | FragmentKind::Statements => grammar::fragments::macro_stmts, |
123 | FragmentKind::Attr => grammar::fragments::attr, | ||
121 | }; | 124 | }; |
122 | parse_from_tokens(token_source, tree_sink, parser) | 125 | parse_from_tokens(token_source, tree_sink, parser) |
123 | } | 126 | } |