Permalink
Browse files

core: remove some more parametrized module references. Issue #513

  • Loading branch information...
1 parent 891d046 commit 99325a1030b98753815edbea1c860f09f5d68f9d @mworrell mworrell committed Mar 14, 2013
@@ -121,8 +121,8 @@ find_value(Key, {GBSize, GBData}, _Context) when is_integer(GBSize) ->
_ -> undefined
end;
-%% Other cases: context, dict or parametrized module lookup.
-find_value(Key, Tuple, Context) when is_tuple(Tuple) ->
+%% Other cases: context or dict module lookup.
+find_value(Key, Tuple, _Context) when is_tuple(Tuple) ->
Module = element(1, Tuple),
case Module of
context ->
@@ -132,19 +132,8 @@ find_value(Key, Tuple, Context) when is_tuple(Tuple) ->
{ok, Val} -> Val;
_ -> undefined
end;
- Module ->
- Exports = Module:module_info(exports),
- case proplists:get_value(Key, Exports) of
- 0 -> Tuple:Key();
- 1 -> Tuple:Key(Context);
- _ ->
- case proplists:get_value(get, Exports) of
- 1 -> Tuple:get(Key);
- 2 -> Tuple:get(Key, Context);
- _ ->
- undefined
- end
- end
+ _ ->
+ undefined
end;
%% When the current value lookup is a function, the context can be passed to F
@@ -1,5 +0,0 @@
--module(erlydtl_example_variable_storage, [SomeVar]).
--compile(export_all).
-
-some_var() ->
- SomeVar.
@@ -100,8 +100,6 @@ tests() ->
<<"{{ var1.attr }}">>, [{var1, dict:store(attr, "Othello", dict:new())}], <<"Othello">>},
{"Render variable with attribute in gb_tree",
<<"{{ var1.attr }}">>, [{var1, gb_trees:insert(attr, "Othello", gb_trees:empty())}], <<"Othello">>},
-% {"Render variable in parameterized module",
-% <<"{{ var1.some_var }}">>, [{var1, erlydtl_example_variable_storage:new("foo")}], <<"foo">>},
{"Nested attributes",
<<"{{ person.city.state.country }}">>, [{person, [{city, [{state, [{country, "Italy"}]}]}]}],
<<"Italy">>}

0 comments on commit 99325a1

Please sign in to comment.