diff options
author | Dave Smith <dizzyd@dizzyd.com> | 2010-02-13 10:18:18 -0700 |
---|---|---|
committer | Dave Smith <dizzyd@dizzyd.com> | 2010-02-13 10:18:18 -0700 |
commit | 0f7b47ce7b2e946a0ff98fb96e0b82cfc55fd7bb (patch) | |
tree | 9d3ffbea766de7205e66a7d4b28e1d51aa9a70ce /src/rebar_erlc_compiler.erl | |
parent | d486dff6e8c05ec87bd18c0ae1d3d050d9703ce2 (diff) | |
parent | 96c1ceba6007551812add22d585f46256d78e106 (diff) |
Merging w/ mainline
Diffstat (limited to 'src/rebar_erlc_compiler.erl')
-rw-r--r-- | src/rebar_erlc_compiler.erl | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index 51b7f17..c41b96d 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -106,13 +106,20 @@ inspect(Source, IncludePath) -> -spec inspect_epp(Epp::pid(), Module::string(), Includes::[string()]) -> {string(), [string()]}. inspect_epp(Epp, Module, Includes) -> case epp:parse_erl_form(Epp) of - {ok, {attribute, _, module, ActualModule}} -> - %% If the module name includes package info, we get a list of atoms... - case is_list(ActualModule) of - true -> + {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], "."); - false -> - ActualModuleStr = atom_to_list(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, inspect_epp(Epp, ActualModuleStr, Includes); {ok, {attribute, 1, file, {Module, 1}}} -> |