Repeater patterns can drop leftover tokens within delims instead of failing the rule
Created by: natefaubion
macro sum {
rule { ($num:lit ...) } => {
$num (+) ...
}
}
sum(1 2 3 four)
1 + 2 + 3;
The rule in sum
should fail since there are leftover tokens in the parens, but it is dropping them instead. There appears to be code in matchPatterns
that is supposed to handle this, but it doesn't look like it's working. I went all the way back to v0.3.0 and it was broken there too.