<div dir="ltr"><div>Hello list,</div><div><br></div><div>I've been working on a code-generating tool, leveraging `erl_syntax`[1] to build an AST containing arbitrary Erlang functions; I then use `erl_pp`[2] to generate the corresponding Erlang code and write the result onto a source code file.</div><div><br></div><div>All is well so far, but now I want to generate type specs and function specs with which to annotate the generated code - and I can't for the life of me figure out how to do it within `erl_syntax`.<br><br>All of the different attempts I've made end up either crashing within `erl_syntax` or `erl_pp`, or at best result in INVALID-FORM literals within the generated code.</div><div><br></div><div>Would any of you be able to point me in the right direction?</div><div><br></div><div>Thanks in advance!<br></div><div><br></div><div>[1]: <a href="http://erlang.org/doc/man/erl_syntax.html">http://erlang.org/doc/man/erl_syntax.html</a></div><div>[2]: <a href="https://erlang.org/doc/man/erl_pp.html">https://erlang.org/doc/man/erl_pp.html</a></div><div><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Guilherme<br></div></div></div></div></div></div></div></div>