   and the engine together by handling the tokens and invoking
   the engine every time a full expression or text is received.
   """
-  @spec compile(String.t, keyword) :: Macro.t | no_return
+  @spec compile(String.t(), keyword) :: Macro.t() | no_return
   def compile(source, opts) when is_binary(source) and is_list(opts) do
     file = opts[:file] || "nofile"
     line = opts[:line] || 1
     trim = opts[:trim] || false
+
     case EEx.Tokenizer.tokenize(source, line, trim: trim) do
       {:ok, tokens} ->
-        state = %{engine: opts[:engine] || @default_engine,
-                  file: file, line: line, quoted: [], start_line: nil}
+        state = %{
+          engine: opts[:engine] || @default_engine,
+          file: file,
+          line: line,
+          quoted: [],
+          start_line: nil
+        }
+
         init = state.engine.init(opts)
         generate_buffer(tokens, init, [], state)
+
       {:error, line, message} ->
         raise EEx.SyntaxError, line: line, file: file, message: message
     end

  end

  defp insert_quoted(list, quoted) when is_list(list) do
    Enum.map list, &insert_quoted(&1, quoted)
  end

  defp insert_quoted(other, _quoted) do

  # Changes placeholder to real expression

  defp insert_quoted({:__EEX__, _, [key]}, quoted) do
    {^key, value} = List.keyfind(quoted, key, 0)
    value
  end

