While using rebar3_format (that uses katana-code for its formatter), I've seen a bug that it's removing the single quotes from macros that have dashes in the name.
Breaking the code.
1> ktn_dodger:parse_file("apps/dccaserver/src/test_format.erl").
{ok,[{tree,attribute,
{attr,1,[],none},
{attribute,{tree,atom,{attr,1,[],none},module},
[{tree,atom,{attr,1,[],none},test_format}]}},
{tree,attribute,
{attr,3,[],none},
{attribute,{atom,3,include_lib},
[{string,3,"rfc4006_cc_Gy.hrl"}]}},
{tree,attribute,
{attr,5,[],none},
{attribute,{tree,atom,{attr,5,[],none},define},
[{var,5,'WORK'},{tree,text,{attr,5,[],none},"abc"}]}},
{tree,attribute,
{attr,6,[],none},
{attribute,{tree,atom,{attr,6,[],none},define},
[{var,6,'CCR_INITIAL'},
{tree,text,
{attr,6,[],none},
"?CC - REQUEST - TYPE_INITIAL_REQUEST"}]}},
{tree,attribute,
{attr,7,[],none},
{attribute,{tree,atom,{attr,7,[],none},define},
[{var,7,'CCR_UPDATE'},
{tree,text,{attr,7,[],none},"?WORK"}]}}]}
As seen, ktn_dodger separated the word in the dashes but it's quoted(the attr 6).
The code should not be separated and single quotes removed.
Bug Description
While using rebar3_format (that uses katana-code for its formatter), I've seen a bug that it's removing the single quotes from macros that have dashes in the name.
For ref: https://github.com/AdRoll/rebar3_format/issues/311
To Reproduce
So code like:
becomes
Breaking the code.
I created a small test file as:
parsing it manually with
ktn_dodgergave me:As seen, ktn_dodger separated the word in the dashes but it's quoted(the attr 6).
Expected Behavior
The code should not be separated and single quotes removed.
rebar3LogsIf applicable, run
rebar3withDIAGNOSTIC=1and attach all the logs to your report.Additional Context