[erlang-questions] merl behaves differently (incorrectly?) in OTP 21

John Doe donpedrothird@REDACTED
Fri Aug 17 23:22:13 CEST 2018


erl_syntax:try_expr_handlers({'try',0,[{atom,0,true}],[],[{clause,7,[{tuple,7,[{atom,7,'throw'},{var,7,'_@REDACTED@'},{var,7,'_'}]}],[],[{integer,7,1}]}],[]}).

In 19:

[{clause,7,[{var,7,'_@REDACTED@'}],[],[{integer,7,1}]}]

in 21:

[{clause,7,
         [{tree,class_qualifier,
                {attr,0,[],none},
                {class_qualifier,{atom,7,throw},
                                 {var,7,'_@REDACTED@'},
                                 {var,7,'_'}}}],
         [],
         [{integer,7,1}]}]




2018-08-17 23:46 GMT+03:00 John Doe <donpedrothird@REDACTED>:

> minimal code for reproducing the issue
>
> -module(a).
> -export([test/0]).
> -include_lib("syntax_tools/include/merl.hrl").
> test() ->
>         Str = "a_string",
>         ?Q("_@REDACTED@ -> 1").
>
> Result in OTP 19:
>
> {tree,clause,
>       {attr,7,[],none},
>       {clause,[{tree,string,{attr,0,[],none},"a_string"}],
>               none,
>               [{integer,7,1}]}}
>
> in OTP 21
>
> {tree,clause,
>       {attr,7,[],none},
>       {clause,[{tree,class_qualifier,
>                      {attr,0,[],none},
>                      {class_qualifier,{atom,7,throw},
>                                       {tree,string,{attr,0,[],none},"a_string"},
>                                       {var,7,'_'}}}],
>               none,
>               [{integer,7,1}]}}
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180818/8a15f8a9/attachment.htm>


More information about the erlang-questions mailing list