Browse Source

Treat callback attributes same as behaviour_info

Automatically include modules with callback attributes in
erl_first_files.
pull/3/head
Shunichi Shinohara 13 years ago
committed by Tuncer Ayaz
parent
commit
ebb2345071
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/rebar_erlc_compiler.erl

+ 6
- 0
src/rebar_erlc_compiler.erl View File

@ -141,6 +141,8 @@ doterl_compile(Config, OutDir, MoreSources) ->
[[F | A], B, C]; [[F | A], B, C];
behaviour -> behaviour ->
[A, [F | B], C]; [A, [F | B], C];
callback ->
[A, [F | B], C];
_ -> _ ->
[A, B, [F | C]] [A, B, [F | C]]
end end
@ -334,6 +336,7 @@ delete_dir(Dir, Subdirs) ->
file:del_dir(Dir). file:del_dir(Dir).
-spec compile_priority(File::file:filename()) -> 'normal' | 'behaviour' | -spec compile_priority(File::file:filename()) -> 'normal' | 'behaviour' |
'callback' |
'parse_transform'. 'parse_transform'.
compile_priority(File) -> compile_priority(File) ->
case epp_dodger:parse_file(File) of case epp_dodger:parse_file(File) of
@ -356,6 +359,9 @@ compile_priority(File) ->
{attribute, {tree, atom, _, export}, {attribute, {tree, atom, _, export},
[{tree, list, _, {list, List, none}}]}}, Acc) -> [{tree, list, _, {list, List, none}}]}}, Acc) ->
lists:foldl(F2, Acc, List); lists:foldl(F2, Acc, List);
({tree, attribute, _,
{attribute, {tree, atom, _, callback},_}}, _Acc) ->
callback;
(_, Acc) -> (_, Acc) ->
Acc Acc
end, end,

Loading…
Cancel
Save