Permalink
Browse files

Allow context lookups with string keys as well as atoms.

  • Loading branch information...
1 parent e1ad4d5 commit d9937dc6d8ca6658d64b4fae95f9d1bff6e79879 @archaelus archaelus committed Jan 23, 2009
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/erlydtl/erlydtl_runtime.erl
View
5 src/erlydtl/erlydtl_runtime.erl
@@ -3,7 +3,10 @@
-compile(export_all).
find_value(Key, L) when is_list(L) ->
- proplists:get_value(Key, L);
+ case proplists:get_value(Key, L) of
+ undefined -> proplists:get_value(atom_to_list(Key), L);
+ V -> V
+ end;
find_value(Key, {GBSize, GBData}) when is_integer(GBSize) ->
case gb_trees:lookup(Key, {GBSize, GBData}) of
{value, Val} ->

0 comments on commit d9937dc

Please sign in to comment.