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

Thomas Arts thomas.arts@REDACTED
Wed Aug 22 08:29:04 CEST 2007


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



More information about the erlang-questions mailing list