unknown
2014-04-21 13:03:30 UTC
In tag OTP-17.0 there is a bug in syntax_tools
Example:
2> erl_syntax:revert_forms( [{tree,map_field_assoc,{attr,16,[],none},{map_field_assoc,{atom,17,key},{var,18,'Value'}}}]).
[{map_field_assoc,16,{atom,17,key},{atom,17,key}}]
As you can see, the key field is duplicated, replacing the value field.
I have made a patch fixing this bug. It can be extracted with
git clone https://github.com/rolkar/otp.git
The fix is found in the branch fixing-revert-bug
https://github.com/rolkar/otp/tree/fixing-revert-bug
The patch contains two commits. The first adds a test case that fails.
The second fixes the problem in the code.
Example:
2> erl_syntax:revert_forms( [{tree,map_field_assoc,{attr,16,[],none},{map_field_assoc,{atom,17,key},{var,18,'Value'}}}]).
[{map_field_assoc,16,{atom,17,key},{atom,17,key}}]
As you can see, the key field is duplicated, replacing the value field.
I have made a patch fixing this bug. It can be extracted with
git clone https://github.com/rolkar/otp.git
The fix is found in the branch fixing-revert-bug
https://github.com/rolkar/otp/tree/fixing-revert-bug
The patch contains two commits. The first adds a test case that fails.
The second fixes the problem in the code.
--
Roland Karlsson <roland.karlsson>
Roland Karlsson <roland.karlsson>