list type in syntax tools

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

list type in syntax tools

Karlo Kuna
hello everyone, 

i'm trying to make list type in sytnax tools however i am running to some issues
i need to make something that reverts to {type,1,list,[]} 

so for example how would one represent following via syntax tools? 

       -type l() :: list().

type_application and user_type_application for list with no element does not revert to 
{type, _, list []}

thak you

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

Re: list type in syntax tools

Karlo Kuna
is there any reason why something like list_type/0 and list_type/1 (like map_type) are missing from syntax tools? 

On Wed, Oct 24, 2018 at 8:57 PM Karlo Kuna <[hidden email]> wrote:
hello everyone, 

i'm trying to make list type in sytnax tools however i am running to some issues
i need to make something that reverts to {type,1,list,[]} 

so for example how would one represent following via syntax tools? 

       -type l() :: list().

type_application and user_type_application for list with no element does not revert to 
{type, _, list []}

thak you

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

Re: list type in syntax tools

Karlo Kuna
i have found workaround: 

erl_syntax:type_application(erl_syntax:abstract(list), []).

which yields to: 
{tree,type_application,
      {attr,0,[],none},
      {type_application,{tree,atom,{attr,0,[],none},list},[]}}

and then reverts to {type,0,list,[]}

but i'm still wandering why are list_type funtions missing

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