   end
 
   defp tokenize('<%%' ++ t, line, opts, buffer, acc) do
-   tokenize t, line, opts, [?%, ?< | buffer], acc
+    tokenize(t, line, opts, [?%, ?< | buffer], acc)
   end
 
   defp tokenize('<%#' ++ t, line, opts, buffer, acc) do
     case expr(t, line, []) do
-      {:error, _, _} = error -> error
+      {:error, _, _} = error ->
+        error
+
       {:ok, _, new_line, rest} ->
         {rest, new_line, buffer} = trim_if_needed(rest, new_line, opts, buffer, acc)
-        tokenize rest, new_line, opts, buffer, acc
+        tokenize(rest, new_line, opts, buffer, acc)
     end
   end
 

    {marker, t} = retrieve_marker(t)

    case expr(t, line, []) do
      {:error, _, _} = error -> error
      {:ok, expr, new_line, rest} ->
        token = token_name(expr)
        {rest, new_line, buffer} = trim_if_needed(rest, new_line, opts, buffer, acc)
        acc   = tokenize_text(buffer, acc)
        final = {token, line, marker, Enum.reverse(expr)}
        tokenize rest, new_line, opts, [], [final | acc]
    end
  end

  defp tokenize('\n' ++ t, line, opts, buffer, acc) do
    tokenize t, line + 1, opts, [?\n | buffer], acc
  end

  defp tokenize([h | t], line, opts, buffer, acc) do
    tokenize t, line, opts, [h | buffer], acc
  end

  defp tokenize([], _line, _opts, buffer, acc) do

  # including the line break following it if there is one.
  defp trim_if_needed(rest, line, opts, buffer, acc) do
    original = {rest, line, buffer}

    if opts[:trim] do
      case {trim_left(buffer, acc), trim_right(rest, line)} do
        {{true, new_buffer}, {true, new_rest, new_line}} ->
          {new_rest, new_line, new_buffer}

        _ ->
          original
      end
