merl behaves differently (incorrectly?) in OTP 21

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

merl behaves differently (incorrectly?) in OTP 21

John Doe

minimal code for reproducing the issue

-module(a).
-export([test/0]).
-include_lib("syntax_tools/include/merl.hrl").

test() -> 
        Str = "a_string",
        ?Q("_@Str@ -> 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}]}}



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: merl behaves differently (incorrectly?) in OTP 21

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

In 19:

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

in 21:

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


2018-08-17 23:46 GMT+03:00 John Doe <[hidden email]>:

minimal code for reproducing the issue

-module(a).
-export([test/0]).
-include_lib("syntax_tools/include/merl.hrl").

test() -> 
        Str = "a_string",
        ?Q("_@Str@ -> 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}]}}




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: merl behaves differently (incorrectly?) in OTP 21

John Doe
In reply to this post by John Doe
erl_syntax:try_expr_handlers({'try',0,[{atom,0,true}],[],[{clause,7,[{tuple,7,[{atom,7,'throw'},{var,7,'_@Str@'},{var,7,'_'}]}],[],[{integer,7,1}]}],[]}).

In 19:

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

in 21:

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



2018-08-17 23:46 GMT+03:00 John Doe <[hidden email]>:

minimal code for reproducing the issue

-module(a).
-export([test/0]).
-include_lib("syntax_tools/include/merl.hrl").

test() -> 
        Str = "a_string",
        ?Q("_@Str@ -> 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}]}}




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions