Hi Jason,<div><br></div><div>The lack of support for types in erl_syntax is something that has bothered me as well and I think that I ran into the same issue with the erlang parser when I was trying to do some work there. If this is indeed the case, there should definitely be a way to make the representation of types in the abstract syntax better and uniform (for the records case).</div><div><br></div><div>Keep in mind however that at least two tools (Dialyzer and EDoc) have been designed to use the current representation, so any change will need to be compatible with those. I can definitely help with the Dialyzer front.</div><div><br></div><div>Regards,</div><div>Stavros</div><div><br>On Thursday, March 1, 2012 3:06:24 PM UTC+1, Jason Rogers wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">I've noticed a lack of support for types and specs in erl_syntax or<br>erl_prettypr.<p>If you try:</p><p>{ok,{_,[{abstract_code,{_,AC}}<wbr>]}} = beam_lib:chunks(Beam,[<wbr>abstract_code]).<br>io:fwrite("~s~n", [erl_prettypr:format(erl_<wbr>syntax:form_list(AC))]).</p><p>on a beam file with type or spec declarations, the resulting code will<br>not compile.</p><p>Any idea if official support is forthcoming?</p><p>I tried to modify both libraries to provide some minimal support for<br>my own use, but ran into an issue with typed records. A typed record<br>shows up in the syntax tree twice: as a un-typed record and as a typed<br>record. And the typed version, which includes all the information<br>contained in the un-typed declaration, appears after the un-typed<br>declaration.</p><p>So if you write code to process the typed version, you will end up<br>with source code that has both a typed and an un-typed declaration.</p><p>Is there anyway to get to a single record declaration?</p><p>Thanks,<br>Jason<br>______________________________<wbr>_________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p></blockquote></div><br>On Thursday, March 1, 2012 3:06:24 PM UTC+1, Jason Rogers wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">I've noticed a lack of support for types and specs in erl_syntax or<br>erl_prettypr.<p>If you try:</p><p>{ok,{_,[{abstract_code,{_,AC}}<wbr>]}} = beam_lib:chunks(Beam,[<wbr>abstract_code]).<br>io:fwrite("~s~n", [erl_prettypr:format(erl_<wbr>syntax:form_list(AC))]).</p><p>on a beam file with type or spec declarations, the resulting code will<br>not compile.</p><p>Any idea if official support is forthcoming?</p><p>I tried to modify both libraries to provide some minimal support for<br>my own use, but ran into an issue with typed records. A typed record<br>shows up in the syntax tree twice: as a un-typed record and as a typed<br>record. And the typed version, which includes all the information<br>contained in the un-typed declaration, appears after the un-typed<br>declaration.</p><p>So if you write code to process the typed version, you will end up<br>with source code that has both a typed and an un-typed declaration.</p><p>Is there anyway to get to a single record declaration?</p><p>Thanks,<br>Jason<br>______________________________<wbr>_________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p></blockquote>