[erlang-questions] prettypr and spec
Tue Sep 25 22:31:00 CEST 2012
Thank you Ulf,
I've looked at this and it reads from .beam files. Same problem as before:
as specified I need to parse string() code.
Do I really have to write my own erlang indenter? That really seems weird.
Isn't there such a thing like a DSL for indenters?
On Tue, Sep 25, 2012 at 1:34 AM, Ulf Wiger <ulf@REDACTED> wrote:
> It appears as if erl_pp:form/1 does a much better job of formatting specs,
> but then, of course, you lose the comments.
> There is also an issue with typed record fields, which seems to affect
> erl_prettypr as well. It simply removes the types from record declarations.
> Take a look at parse_trans_pp:beam/1. It makes no effort to preserve
> (naturally, since it doesn't expect to find any), but handles specs and
> records correctly.
> This module, BTW, is also made to be used as an escript, and I have the
> following convenient alias:
> alias pp='escript /Users/uwiger/git/parse_trans/ebin/parse_trans_pp.beam'
> Not that the last point was particularly relevant to your particular
> problem. :)
> Ulf W
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions