[erlang-questions] Error in erl_tidy (syntax tools) any fix?

Erik Stenman Erik.Stenman@REDACTED
Wed Aug 22 08:49:00 CEST 2007


Jag fick den bifogade patchen av Richard.
Den löser nog problemet, och kommer med i nästa version av erl_tidy.

/Erik Stenman

Thomas Arts wrote:
> Erlang R11B, erl 5.5.4 under Windows Vista
> syntax-tools-1.5.3
> 
> Save the following program:
> %%---------------------------------------------------------
> -module(test7705).
> 
> -export([header/0]).
> 
> header() ->
>     Bin = <<"test7705">>, <<(size(Bin)), Bin/binary>>.
> 
> %%---------------------------------------------------------
> 
> Erlang (BEAM) emulator version 5.5.4 [async-threads:0]
> 
> Eshell V5.5.4  (abort with ^G)
> 1> c("test7705.erl").
> {ok,test7705}
> 2> test7705:header().
> <<"\btest7705">>
> 3> erl_tidy:file("test7705.erl").
> ok
> 4> c("test7705.erl").
> ./test7705.erl:6: syntax error before: '('
> ./test7705.erl:3: function header/0 undefined
> error
> 5>
> 
> The reason for failure is that the parentheses around size(...) are 
> omitted in pretty printing:
> -module(test7705).
> 
> -export([header/0]).
> 
> header() ->
>     Bin = <<"test7705">>, <<size(Bin), Bin/binary>>.
> 
> 
> The cause of this is in erl_prettypr.erl around line 624. However, it is 
> not obvious how to fix the code in the right way. Any suggestions?
> 
> Thanks
> Thomas
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
> 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070822/691a079a/attachment.ksh>


More information about the erlang-questions mailing list