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
When transcribing, $e is replaced with 1 + 1 (20.4.2:3),
The final expansion is 2 * 1 + 1.
Well, that's not what currently happens (playground link). rustc -Zunpretty=expanded even adds parenthesis around the 1 + 1.
My understanding as that exprmetavariables that match an arithmetic expression should have a higher precedence than the rest of the macro substitution. As far as I can tell, this is not mentioned in Ferrocene.
Side note: I don't have much experience in how Ferrocene specs are structured, so I may have used the wrong word/missed something important. Sorry for that.
The text was updated successfully, but these errors were encountered:
Good catch we are not specifying none groups (aka invisible delimiters) at all currently which is in general a somewhat undesigned space in rust still rust-lang/rust#67062. We should be specifying the grouping behavior for expressions at least though.
Let's consider the following code:
Let's break down its expansion according to the current Ferrocene specs:
$e
matches the expression1 + 1
(20.4.1.2:6),$e
is replaced with1 + 1
(20.4.2:3),2 * 1 + 1
.Well, that's not what currently happens (playground link).
rustc -Zunpretty=expanded
even adds parenthesis around the1 + 1
.My understanding as that
expr
metavariables that match an arithmetic expression should have a higher precedence than the rest of the macro substitution. As far as I can tell, this is not mentioned in Ferrocene.Side note: I don't have much experience in how Ferrocene specs are structured, so I may have used the wrong word/missed something important. Sorry for that.
The text was updated successfully, but these errors were encountered: