Expressions with += are not correctly captured
Created by: benjreinhart
Attempting to capture an expression with +=
, -=
, *=
or /=
does not seem to get correctly captured.
Given the following macro:
macro t {
rule {($body ... $last:expr)} => {
function() {
$body ...
return $last
}
}
}
This works ok:
var f = "string";
var f1 = t(f + "2");
But this does not:
var f = "string";
var f1 = t(f += "2");
var f = 10;
var f1 = t(f -= 2);
var f = 10;
var f1 = t(f *= 2);
var f = 10;
var f1 = t(f /= 2);
In all of those cases, it tries to expand to [lhs] [operator] return [rhs]
.
I realize this example is a bit contrived, but definitely still seems to be a bug.