diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-06-08 22:14:32 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-06-08 22:14:32 +0200 |
commit | b1d06a4d1470cfe57aab58bfad7c41aa09e86f05 (patch) | |
tree | aa4a62ad9e200f1e1e78e893425bd64a77877c15 | |
parent | 8a046d898aec4bc7c1a84e9a11fae6ce8b80ad7a (diff) |
Fix unsafe use of var
-rw-r--r-- | src/rebar_erlc_compiler.erl | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index dc700e1..30db023 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -202,22 +202,23 @@ inspect(Source, IncludePath) -> inspect_epp(Epp, Source, Module, Includes) -> case epp:parse_erl_form(Epp) of {ok, {attribute, _, module, ModInfo}} -> - case ModInfo of - %% Typical module name, single atom - ActualModule when is_atom(ActualModule) -> - ActualModuleStr = atom_to_list(ActualModule); - %% Packag-ized module name, list of atoms - ActualModule when is_list(ActualModule) -> - ActualModuleStr = string:join([atom_to_list(P) || - P <- ActualModule], "."); - %% Parameterized module name, single atom - {ActualModule, _} when is_atom(ActualModule) -> - ActualModuleStr = atom_to_list(ActualModule); - %% Parameterized and packagized module name, list of atoms - {ActualModule, _} when is_list(ActualModule) -> - ActualModuleStr = string:join([atom_to_list(P) || - P <- ActualModule], ".") - end, + ActualModuleStr = + case ModInfo of + %% Typical module name, single atom + ActualModule when is_atom(ActualModule) -> + atom_to_list(ActualModule); + %% Packag-ized module name, list of atoms + ActualModule when is_list(ActualModule) -> + string:join([atom_to_list(P) || + P <- ActualModule], "."); + %% Parameterized module name, single atom + {ActualModule, _} when is_atom(ActualModule) -> + atom_to_list(ActualModule); + %% Parameterized and packagized module name, list of atoms + {ActualModule, _} when is_list(ActualModule) -> + string:join([atom_to_list(P) || + P <- ActualModule], ".") + end, inspect_epp(Epp, Source, ActualModuleStr, Includes); {ok, {attribute, 1, file, {Module, 1}}} -> inspect_epp(Epp, Source, Module, Includes); |