[erlang-patches] bug fix patch for revert map_field_assoc in syntax_tools

Roland Karlsson roland.karlsson@REDACTED
Mon Apr 21 15:03:30 CEST 2014


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.


-- 
Roland Karlsson <roland.karlsson@REDACTED>




More information about the erlang-patches mailing list