Permalink
Browse files

Applied patch by Hunter Morris

Fixes a bug where:
$if foo.bar$
foo
$end if$
   
is parsed differently than:
   
$if foo.bar$
foo
$else$
bar
$end if$

In the first one the nested attribute was mistakenly parsed as {attribute, 'foo.bar'} instead of {attribute,[foo,bar]}.
  • Loading branch information...
1 parent ee44167 commit ce7ff0305736fbe8fbcef9b25fb3d8e8f49e0330 @filippo committed Mar 29, 2008
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/sgte_parse.erl
View
@@ -338,7 +338,9 @@ parse_ift({Test, Then}) ->
case parse(Then) of
{error, Reason} -> {error, Reason};
{ok, CThen} ->
- {ift, {{attribute, list_to_atom(string:strip(Test))}, CThen}}
+ TestTok = [list_to_atom(T) ||
+ T <- string:tokens(string:strip(Test), ".")],
+ {ift, {{attribute, TestTok}, CThen}}
end.
%%--------------------------------------------------------------------

0 comments on commit ce7ff03

Please sign in to comment.