File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -98,16 +98,16 @@ defmodule EEx.Engine do
9898 """
9999 def handle_expr ( buffer , "=" , expr ) do
100100 quote do
101- tmp = unquote ( buffer )
102- tmp <> String.Chars . to_string ( unquote ( expr ) )
101+ tmp1 = unquote ( buffer )
102+ tmp1 <> String.Chars . to_string ( unquote ( expr ) )
103103 end
104104 end
105105
106106 def handle_expr ( buffer , "" , expr ) do
107107 quote do
108- tmp = unquote ( buffer )
108+ tmp2 = unquote ( buffer )
109109 unquote ( expr )
110- tmp
110+ tmp2
111111 end
112112 end
113113end
Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ Number <%= x %>
252252 assert_eval expected , string
253253 end
254254
255- test "do not consider already finished functions " do
255+ test "properly handle functions on the left side of clauses " do
256256 expected = """
257257foo
258258
287287 assert_eval "\n \n Good\n \n " , string
288288 end
289289
290+ test "evaluates expressions with buffers" do
291+ string = """
292+ <%= 123 %>
293+ <% if true do %>
294+ <%= 456 %>
295+ <% end %>
296+ <%= 789 %>
297+ """
298+
299+ assert_eval "123\n \n 789\n " , string
300+ end
301+
290302 test "for comprehensions" do
291303 string = """
292304 <%= for _name <- packages || [] do %>
You can’t perform that action at this time.
0 commit comments