File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ defmodule EEx.Engine do
158158
159159 @ doc false
160160 def handle_begin ( state ) do
161+ check_state! ( state )
161162 % { state | binary: [ ] , dynamic: [ ] }
162163 end
163164
@@ -168,6 +169,7 @@ defmodule EEx.Engine do
168169
169170 @ doc false
170171 def handle_body ( state ) do
172+ check_state! ( state )
171173 % { binary: binary , dynamic: dynamic } = state
172174 binary = { :<<>> , [ ] , Enum . reverse ( binary ) }
173175 dynamic = [ binary | dynamic ]
@@ -207,4 +209,11 @@ defmodule EEx.Engine do
207209 raise EEx.SyntaxError ,
208210 "unsupported EEx syntax <%#{ marker } %> (the syntax is valid but not supported by the current EEx engine)"
209211 end
212+
213+ defp check_state! ( % { binary: _ , dynamic: _ , vars_count: _ } ) , do: :ok
214+
215+ defp check_state! ( state ) do
216+ raise "unexpected EEx.Engine state: #{ inspect ( state ) } . " <>
217+ "This typically means a bug or an outdated EEx.Engine or tool"
218+ end
210219end
You can’t perform that action at this time.
0 commit comments