Open eproxus opened 3 months ago
This is somewhat expected - erlfmt generally expects macro definitions and arguments to be valid Erlang AST, with some extensions - this is not true of a stand-alone A:8
expression.
It might be possible to extend the grammar to accept this as a stand-alone expression, but I'm not sure. This is primarily because parsing of :
is already one of the most complex parts of the parser - given it has completely different precedence in all 3 places: when used as a remote call marker, in binaries, and in catch clauses.
@michalmuskala Thanks for explaining. Feel free to close this as "won't fix" if it is not on the roadmap 😊
When formatting a module containing a macro with an argument that is put inside a binary, a compilation error is generated:
Running
rebar3 fmt
on this file generates the following error:Erlang / Rebar 3 itself can compile the file just fine:
erlfmt
version:1.3.0
and latestmain
Erlang/OTP:27.0.1
Rebar 3:3.23.0