erl_parse vs erl_syntax difference

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

erl_parse vs erl_syntax difference

Karlo Kuna
for example if we parse form (i'm omitting scan pass here)
"-type a() :: tuple()."  we get {ok,{attribute,1,type,{a,{type,1,tuple,any},[]}}}

interesting part here is:
      {type,1,tuple,any}
as far as i can see there no method how to construct valid tuple or map type annotations using erl_syntax. Specifically  if one construct type annotation for tuple and use erl_syntax:revert/1 one gets: 
      {type,1,tuple,any_size}

any_size =/= any

is this a bug??


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

Re: erl_parse vs erl_syntax difference

Hans Bolinder-2
[Karlo Kuna:]
> for example if we parse form (i'm omitting scan pass here)
> "-type a() :: tuple()."  we get {ok,{attribute,1,type,{a,{type,1,tuple,any},[]}}}
>
> interesting part here is:
>      {type,1,tuple,any}
>
> as far as i can see there no method how to construct valid tuple or
> map type annotations using erl_syntax. Specifically if one construct
> type annotation for tuple and use erl_syntax:revert/1 one gets:
>
>       {type,1,tuple,any_size}
>
> any_size =/= any
>
> is this a bug??

Thanks for pointing it out. A fix, see commit 1b91284, will be
included in Erlang/OTP 21.1.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson


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

Re: erl_parse vs erl_syntax difference

Karlo Kuna
this is great news
thanks for quick fix 

On Fri, Sep 14, 2018 at 9:58 AM Hans Bolinder <[hidden email]> wrote:
[Karlo Kuna:]
> for example if we parse form (i'm omitting scan pass here)
> "-type a() :: tuple()."  we get {ok,{attribute,1,type,{a,{type,1,tuple,any},[]}}}
>
> interesting part here is:
>      {type,1,tuple,any}
>
> as far as i can see there no method how to construct valid tuple or
> map type annotations using erl_syntax. Specifically if one construct
> type annotation for tuple and use erl_syntax:revert/1 one gets:
>
>       {type,1,tuple,any_size}
>
> any_size =/= any
>
> is this a bug??

Thanks for pointing it out. A fix, see commit 1b91284, will be
included in Erlang/OTP 21.1.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson


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

Re: erl_parse vs erl_syntax difference

Frank Muller
In reply to this post by Hans Bolinder-2
Hi Hans

When Erlang 21.1 will be release ?

/Frank

[Karlo Kuna:]
> for example if we parse form (i'm omitting scan pass here)
> "-type a() :: tuple()."  we get {ok,{attribute,1,type,{a,{type,1,tuple,any},[]}}}
>
> interesting part here is:
>      {type,1,tuple,any}
>
> as far as i can see there no method how to construct valid tuple or
> map type annotations using erl_syntax. Specifically if one construct
> type annotation for tuple and use erl_syntax:revert/1 one gets:
>
>       {type,1,tuple,any_size}
>
> any_size =/= any
>
> is this a bug??

Thanks for pointing it out. A fix, see commit 1b91284, will be
included in Erlang/OTP 21.1.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson

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

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

Re: erl_parse vs erl_syntax difference

Hans Bolinder-2
Hi,

> When Erlang 21.1 will be release ?

2018-09-26.

BR


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