 
   defp wrap_expr(current, line, buffer, chars, state) do
     new_lines = List.duplicate(?\n, line - state.line)
-    key = length(state.dict)
+    key = length(state.quoted)
     placeholder = '__EEX__(' ++ integer_to_list(key) ++ ');'
-    {current ++ placeholder ++ new_lines ++ chars, state.update_dict(&[{key, buffer}|&1])}
+    {current ++ placeholder ++ new_lines ++ chars,
+     %{state | quoted: [{key, buffer}|state.quoted]}}
   end
 
   # Look text ahead on expressions

defrecord EEx.State, engine: EEx.SmartEngine, dict: [], file: "nofile", line: 1, start_line: 1

defmodule EEx.Compiler do
  @moduledoc false


  and the engine together by handling the tokens and invoking
  the engine every time a full expression or text is received.
  """
  def compile(source, opts) do
    file   = opts[:file] || "nofile"
    line   = opts[:line] || 1
    tokens = EEx.Tokenizer.tokenize(source, line)
    state  = %{engine: opts[:engine] || EEx.SmartEngine,
               file: file, line: line, quoted: [], start_line: nil}
    generate_buffer(tokens, "", [], state)
  end

