> @@
> binary operator bop = {+,-,>>,<<};
> expression e, e1, e2;
> @@
Awesome! This makes the patch so much more concise.
>
> e =
> - (
> e1 bop e2
> - )
>
> Although, your version is probably more readable, because "bop" doesn't
> really look like a binary operator.
>
> Did you try, eg
>
> e =
> - (e1 + e2)
> + e1 + e2
>
> ? This is not a good solution, but it could be good to think about why.
I tried this after reading this mail :). I think it's not a good solution because
of the false positives that it will give. Also for the cases where there's no
space around '+' will be replaced as well which is not the intended use case
for the patch. And all the cases where we have shifted the operands to avoid
the 80 character limit, will all be moved on the same line.