-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
(spawned off of #1384 (comment) )
I've been leaving links to the above comment in all sorts of places, so I finally decided it was time to open an RFC issue for this idea.
Namely, to add some fragment class, which I'll call pred
for now, that represents "the subset of expressions that do not have {
in their follow set, and thus the presence of a {
as the next token tells the parser that it is definitely done parsing the expression."
In particular, this is the subset of expressions that we use for the test in an if test { then } else { other }
Such an fragment class would be useful for writing macro_rules!
that naturally want a {
to come after them in the input pattern.
We used to superficially "allow" such macros, but they didn't actually work in general; see rust-lang/rust#26739