File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -961,7 +961,8 @@ transcribe_expression (Parser<MacroInvocLexer> &parser)
961
961
auto &lexer = parser.get_token_source ();
962
962
auto start = lexer.get_offs ();
963
963
964
- auto expr = parser.parse_expr ();
964
+ auto attrs = parser.parse_outer_attributes ();
965
+ auto expr = parser.parse_expr (std::move (attrs));
965
966
if (expr == nullptr )
966
967
return AST::Fragment::create_error ();
967
968
Original file line number Diff line number Diff line change @@ -212,6 +212,11 @@ template <typename ManagedTokenSource> class Parser
212
212
std::unique_ptr<AST::MacroInvocation>
213
213
parse_macro_invocation (AST::AttrVec outer_attrs);
214
214
215
+ /*
216
+ * This has to be public for parsing expressions with outer attributes
217
+ */
218
+ AST::AttrVec parse_outer_attributes ();
219
+
215
220
private:
216
221
void skip_after_semicolon ();
217
222
void skip_after_end ();
@@ -228,7 +233,6 @@ template <typename ManagedTokenSource> class Parser
228
233
229
234
// AST-related stuff - maybe move or something?
230
235
AST::Attribute parse_inner_attribute ();
231
- AST::AttrVec parse_outer_attributes ();
232
236
AST::Attribute parse_outer_attribute ();
233
237
std::unique_ptr<AST::AttrInput> parse_attr_input ();
234
238
std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, location_t >
Original file line number Diff line number Diff line change
1
+ macro_rules! foo {
2
+ ( ) => { #[ cfg( all( ) ) ] 12 }
3
+ }
4
+
5
+ fn main ( ) -> i32 {
6
+ foo ! ( )
7
+ }
You can’t perform that action at this time.
0 commit comments