<div dir="ltr"><div>Hello Viktor,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 7 Dec 2020 at 14:25, Viktor Söderqvist <<a href="mailto:viktor@zuiderkwast.se">viktor@zuiderkwast.se</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi! Generated examples of all of Erlang's AST is in the generated <br>
README.md of this repo:<br>
<a href="https://github.com/zuiderkwast/erlang_abstract_format" rel="noreferrer" target="_blank">https://github.com/zuiderkwast/erlang_abstract_format</a></blockquote><div><br></div><div>Thanks! That's a reference document I'll definitely bookmark.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
Some examples:<br>
<br>
-spec my_function() -> ok.<br>
<br>
{attribute,54,spec,<br>
{{my_function,0},<br>
[{type,54,'fun',[{type,54,product,[]},{atom,54,ok}]}]}}<br>
<br>
-spec my_function(A :: atom()) -> B when B :: boolean().<br>
<br>
{attribute,55,spec,<br>
{{my_function,1},<br>
[{type,55,bounded_fun,<br>
[{type,55,'fun',<br>
[{type,55,product,<br>
[{ann_type,55,[{var,55,'A'},{type,55,atom,[]}]}]},<br>
{var,55,'B'}]},<br>
[{type,55,constraint,<br>
[{atom,55,is_subtype},<br>
[{var,55,'B'},{type,55,boolean,[]}]]}]]}]}}<br>
<br>
If some syntactic element is missing, please let me know.<br>
<br>
BRs,<br>
Viktor<br>
<br>
On 2020-12-05 21:24, Guilherme Andrade wrote:<br>
> All is well so far, but now I want to generate type specs and function <br>
> specs with which to annotate the generated code - and I can't for the <br>
> life of me figure out how to do it within `erl_syntax`.<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Guilherme<br></div></div></div></div></div></div></div>