anchor.diff:  ensure_read(#{forms := [Form]}) ->
     Form;
   ensure_read(State) ->
  -  ensure_read(dispatch(State)).
  -
  -%% @doc Read all forms.
  --spec read_all(state()) -> [any()].
  -read_all(Src) ->
  -  read_all(Src, #{}).
  -
  --spec read_all(state(), opts()) -> [any()].
  -read_all(Src, Opts) ->
  -  read_all(Src, Opts, clj_env:default()).
  -
  --spec read_all(state(), opts(), clj_env:env()) -> [any()].
  -read_all(Src, Opts, Env) ->
  -  State = new_state(Src, Env, Opts, true),
  -  #{forms := Forms} = dispatch(State),
  -  lists:reverse(Forms).
  -
  --spec dispatch(state()) -> state().
  -dispatch(#{src := <<>>} = State) ->
  +  ensure_read(read_one(State, true)).
  +
  +%% @private
  +-spec do_read_all(state()) -> state().
  +do_read_all(#{src := <<>>} = State) ->
     State;
  -dispatch(#{all := true} = State) ->
  -  dispatch(read_one(State, false));
  -dispatch(State) ->
  -  read_one(State, false).
  +do_read_all(State) ->
  +  do_read_all(read_one(State, false)).
   
   -spec read_one(state()) -> state().
   read_one(State) ->
  
positive.code:     end,
    Char =
      case Token of
        <<>> -> clj_utils:throw(<<"EOF">>, location(State));
        Ch when size(Ch) == 1 -> Ch;
        <<"newline">> -> $\n;
        <<"space">> -> $ ;
  
negative.code: %%      or throws if there is no form to read.
  -spec read(binary(), opts(), clj_env:env()) -> any().
  read(Src, Opts, Env) ->
    State = new_state(Src, Env, Opts),
    ensure_read(State).
  
  %% @doc Read all forms.
  -spec read_all(state()) -> [any()].
  read_all(Src) ->
    read_all(Src, #{}).
  
  -spec read_all(state(), opts()) -> [any()].
  read_all(Src, Opts) ->
    read_all(Src, Opts, clj_env:default()).
  
  -spec read_all(state(), opts(), clj_env:env()) -> [any()].
  read_all(Src, Opts, Env) ->
    State = new_state(Src, Env, Opts),
    #{forms := Forms} = do_read_all(State),
    lists:reverse(Forms).
  
  %%------------------------------------------------------------------------------
  %% Internal functions
  %%------------------------------------------------------------------------------
  
  %% @private
  -spec new_state(binary(), any(), opts()) -> state().
  new_state(Src, Env, Opts) ->
    #{ src           => Src
     , opts          => Opts
     , forms         => []
     , pending_forms => []
     , env           => Env
     , loc           => {1, 1}
     , bindings      => clj_scope:new()
     }.
  
  %% @doc Makes sure a single form is read unless we reach
  %%      the enf of file. It handles the case were an ignore
  %%      reader is used.
  %% @private
  -spec ensure_read(state()) -> any().
  ensure_read(#{src := <<>>, forms := []} = State) ->
  