[erlang-bugs] erl_syntax fails to revert imports

Ulf Wiger ulf@REDACTED
Tue Nov 28 18:57:51 CET 2006


We discovered that erl_syntax doesn't handle packaged module names in
import clauses (actually, it handles it in -import(M), but not
-import(M,[...]).)

The following patch seems to do the trick.

BR,
Ulf W

uwiger$ diff erl_syntax.erl $R11B_2/lib/syntax_tools/src/erl_syntax.erl
2987,3003d2986
<     Revert_list =
<       fun(Mod) ->
<               case is_list_skeleton(List) of
<                   true ->
<                       case is_proper_list(List) of
<                           true ->
<                               Fs = fold_function_names(
<                                      list_elements(List)),
<                               {attribute, Pos, import,
<                                {Mod, Fs}};
<                           false ->
<                               Node
<                       end;
<                   false ->
<                       Node
<               end
<       end,
3006,3011c2989,3000
<           Revert_list(concrete(A));
<       qualified_name ->
<           case revert_module_name(A) of
<               {ok, Ar} ->
<                   Revert_list(Ar);
<               error ->
---
>           case is_list_skeleton(List) of
>               true ->
>                   case is_proper_list(List) of
>                       true ->
>                           Fs = fold_function_names(
>                                  list_elements(List)),
>                           {attribute, Pos, import,
>                            {concrete(A), Fs}};
>                       false ->
>                           Node
>                   end;
>               false ->





More information about the erlang-bugs mailing list