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
158
158
159
159
@ doc false
160
160
def handle_begin ( state ) do
161
+ check_state! ( state )
161
162
% { state | binary: [ ] , dynamic: [ ] }
162
163
end
163
164
@@ -168,6 +169,7 @@ defmodule EEx.Engine do
168
169
169
170
@ doc false
170
171
def handle_body ( state ) do
172
+ check_state! ( state )
171
173
% { binary: binary , dynamic: dynamic } = state
172
174
binary = { :<<>> , [ ] , Enum . reverse ( binary ) }
173
175
dynamic = [ binary | dynamic ]
@@ -207,4 +209,11 @@ defmodule EEx.Engine do
207
209
raise EEx.SyntaxError ,
208
210
"unsupported EEx syntax <%#{ marker } %> (the syntax is valid but not supported by the current EEx engine)"
209
211
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
210
219
end
You can’t perform that action at this time.
0 commit comments