summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShunichi Shinohara <shino@accense.com>2012-02-09 00:33:12 +0900
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-02-10 10:26:16 +0100
commitebb23450719ef519f066546582c8415719086bb9 (patch)
treec51677d2afc73f4fd7eeec0109470b8ddbf68293
parent1c1a32b8bae3130671eec3298f6ae07bf41d734d (diff)
Treat callback attributes same as behaviour_info
Automatically include modules with callback attributes in erl_first_files.
-rw-r--r--src/rebar_erlc_compiler.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index edb8156..c7c0e65 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -141,6 +141,8 @@ doterl_compile(Config, OutDir, MoreSources) ->
[[F | A], B, C];
behaviour ->
[A, [F | B], C];
+ callback ->
+ [A, [F | B], C];
_ ->
[A, B, [F | C]]
end
@@ -334,6 +336,7 @@ delete_dir(Dir, Subdirs) ->
file:del_dir(Dir).
-spec compile_priority(File::file:filename()) -> 'normal' | 'behaviour' |
+ 'callback' |
'parse_transform'.
compile_priority(File) ->
case epp_dodger:parse_file(File) of
@@ -356,6 +359,9 @@ compile_priority(File) ->
{attribute, {tree, atom, _, export},
[{tree, list, _, {list, List, none}}]}}, Acc) ->
lists:foldl(F2, Acc, List);
+ ({tree, attribute, _,
+ {attribute, {tree, atom, _, callback},_}}, _Acc) ->
+ callback;
(_, Acc) ->
Acc
end,