fix: Expand eager macros to delimited comma separated expression list

This commit is contained in:
Lukas Wirth 2023-07-30 17:03:51 +02:00
parent 712b53865f
commit 7c765d9f9e
10 changed files with 83 additions and 6 deletions

View file

@ -172,7 +172,7 @@ impl SourceFile {
}
impl ast::TokenTree {
pub fn reparse_as_expr(self) -> Parse<ast::Expr> {
pub fn reparse_as_comma_separated_expr(self) -> Parse<ast::MacroEagerInput> {
let tokens = self.syntax().descendants_with_tokens().filter_map(NodeOrToken::into_token);
let mut parser_input = parser::Input::default();
@ -203,7 +203,7 @@ impl ast::TokenTree {
}
}
let parser_output = parser::TopEntryPoint::Expr.parse(&parser_input);
let parser_output = parser::TopEntryPoint::MacroEagerInput.parse(&parser_input);
let mut tokens =
self.syntax().descendants_with_tokens().filter_map(NodeOrToken::into_token);