You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macro with repeating arguments fails with ambiguous parse #5902
I'd like to remove those extra parens. It seems like [ $($field:ident),* ] should be unambiguous, but rustc doesn't like it.
The actual error is error: Local ambiguity: multiple parsing options: built-in NTs ident ('field') or 1 other options. Also, it seems like it should tell me the other options so I have some clue what is going wrong.
(We discussed this in the nomination meeting today when we hit #3232 and decided to accept "some bug" for the well-definedness of the macro parser, and leave #3232 on the problem of its implementation)
Activity
catamorphism commentedon Jul 16, 2013
Nominating for milestone 1, well-defined (part of figuring out what macros actually parse)
graydon commentedon Jul 18, 2013
Related to #3232 which has to do with the implementation of parsing being able to stop / reset / restart.
But I want to have some bug on file for well-definedness that says which grammar-class of macros we support. The current macro tutorial at http://static.rust-lang.org/doc/tutorial-macros.html has a little discussion of it, but is not entirely clear. I believe the class is "1-token predictive grammars" which is the non-backtracking subset of LL(1), quite limited. It's fine if that's our limitation -- it's still much more than in other languages -- but we ought to say so.
(We discussed this in the nomination meeting today when we hit #3232 and decided to accept "some bug" for the well-definedness of the macro parser, and leave #3232 on the problem of its implementation)
huonw commentedon Sep 23, 2013
Triage: still an issue. Specifically, the following fails
FWIW, the example in the issue is one of many working versions, e.g.
$ctor:ident $(, $field:ident: $field_init:expr)*also works (called like:).
Merge rust-lang#6333