-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recursive macro --- macro doesn't exist #14946
Comments
Note that standard recursive macros work fine, e.g., macro_rules! rec_works(
() => (0);
($a:expr) => ($a);
($a:expr, $($rest:tt),*) => (
$a + rec_works!($($rest),*)
);
) And Maybe the bug here is that expanding macros within other macros is using an older environment that doesn't include the name |
It's even worse than that. |
I think this might be a dupe of #12404. |
@huonw Does fixing (Sorry I missed that issue. I searched for 'recursive macro' instead of 'nested macro'!) |
@BurntSushi both |
@sfackler Right. I'm referring to the recursive aspect. Wasn't sure if that would make a difference. (I just don't know enough about how macros are expanded to know. Pure guesswork on my part.) |
- Made custom syntax extensions capable of expanding custom macros by moving `SyntaxEnv` into `ExtCtx` - Added convenience method on `ExtCtx` for getting a macro expander. - Made a few things private to force only a single way to use them (through `ExtCtx`) - Removed some ancient commented-out code Closes #14946
I believe this should output the string
abc
:But I get this error:
Rust version:
The text was updated successfully, but these errors were encountered: