Skip to content

Commit

Permalink
Applied patch by Hunter Morris
Browse files Browse the repository at this point in the history
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
Filippo Pacini committed Mar 29, 2008
1 parent ee44167 commit ce7ff03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sgte_parse.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

%%--------------------------------------------------------------------
Expand Down

0 comments on commit ce7ff03

Please sign in to comment.