     }
   end
 
-  @doc """
-  Returns an empty string as the new buffer.
-  """
+  @doc false
   def handle_begin(state) do
     %{state | binary: [], dynamic: []}
   end
 
-  @doc """
-  End of the new buffer.
-  """
+  @doc false
   def handle_end(quoted) do
     handle_body(quoted)
   end
 
-  @doc """
-  The default implementation simply returns the given expression.
-  """
+  @doc false
   def handle_body(state) do
     %{binary: binary, dynamic: dynamic} = state
     binary = {:<<>>, [], Enum.reverse(binary)}

  This can be added to any custom engine by invoking
  `handle_assign/1` with `Macro.prewalk/2`:

      def handle_expr(buffer, token, expr) do
        expr = Macro.prewalk(expr, &EEx.Engine.handle_assign/1)
        EEx.Engine.handle_expr(buffer, token, expr)
      end

  """

  @moduledoc ~S"""
  Basic EEx engine that ships with Elixir.

  An engine needs to implement all callbacks below.

  An engine may also `use EEx.Engine` to get the default behaviour
  but this is not advised. In such cases, if any of the callbacks
  are overridden, they must call `super()` to delegate to the
  underlying `EEx.Engine`.
  """

  @type state :: term

  @doc """
  Called at the beginning of every template.

  It must return the initial state.
  """
  @callback init(opts :: keyword) :: state

  @doc """
  Called at the end of every template.

  It must return Elixir's quoted expressions for the template.
  """
  @callback handle_body(state) :: Macro.t()

  @doc """
  Called for the text/static parts of a template.

  It must return the updated state.
  """
  @callback handle_text(state, text :: String.t()) :: state

  @doc """
  Called for the dynamic/code parts of a template.

  The marker is what follows exactly after `<%`. For example,
  `<% foo %>` has an empty marker, but `<%= foo %>` has `"="`
  as marker. The allowed markers so far are:

    * `""`
    * `"="`
    * `"/"`
    * `"|"`

  Markers `"/"` and `"|"` are only for use in custom EEx engines
  and are not implemented by default. Using them without an
  appropriate implementation raises `EEx.SyntaxError`.

  It must return the updated state.
  """
  @callback handle_expr(state, marker :: String.t(), expr :: Macro.t()) :: state

  @doc """
  Invoked at the beginning of every nesting.

  It must return a new state that is used only inside the nesting.
  Once the nesting terminates, the current `state` is resumed.
  """
  @callback handle_begin(state) :: state

  @doc """
  Invokes at the end of a nesting.

  It must return Elixir's quoted expressions for the nesting.
  """
  @callback handle_end(state) :: Macro.t()

  @doc false
