[erlang-questions] Problem parsing Erlang code

Joel Reymont joelr1@REDACTED
Tue Nov 20 18:41:52 CET 2007


On Nov 20, 2007, at 5:33 PM, Joel Reymont wrote:

> Now, suppose I wanted to pretty print the code with the semicolon at  
> the end.
>
> How would I do that?


By creating the AST with two function clauses!

{ok,{function,1,
               show,
               2,
               [{clause,1,[{integer,1,1},{integer,1,2}],[],[{integer, 
1,1}]},
                {clause,1,[{integer,1,3},{integer,1,4}],[],[{integer, 
1,2}]}]}}


	Thanks, Joel

--
http://wagerlabs.com








More information about the erlang-questions mailing list