rebar3_format
rebar3_format copied to clipboard
Preserve parentheses on macro usage, not just on macro definition
There is a problem with parentheses used in macro calls, not only definitions. The default formatter turns…
-define(MUL(A, B), A * B).
?MUL((1 + 2), (3 + 4)).
…into…
-define(MUL(A, B), A * B).
?MUL(1 + 2, 3 + 4).
With parens in the call, it's 21, without them it's 11.
Originally posted by @michalmuskala in https://github.com/AdRoll/rebar3_format/issues/74#issuecomment-730388246
This will probably help: http://erlang.org/doc/man/erl_syntax.html#parentheses-1