anchor.diff:              error(?PARSE_ERROR)
       end.
   
  +%% @doc Remove the space from the edge.
  +-spec remove_space_from_edge(binary()) -> binary().
  +remove_space_from_edge(Bin) ->
  +    remove_space_from_tail(remove_space_from_head(Bin)).
  +
  +%% @doc Remove the space from the head.
  +-spec remove_space_from_head(binary()) -> binary().
  +remove_space_from_head(<<" ", Rest/binary>>) -> remove_space_from_head(Rest);
  +remove_space_from_head(Bin)                  -> Bin.
  +
  +%% @doc Remove the space from the tail.
  +-spec remove_space_from_tail(binary()) -> binary().
  +remove_space_from_tail(<<>>) -> <<>>;
  +remove_space_from_tail(Bin) ->
  +    PosList = binary:matches(Bin, <<" ">>),
  +    LastPos = remove_space_from_tail_impl(lists:reverse(PosList), byte_size(Bin)),
  +    binary:part(Bin, 0, LastPos).
  +
  +%% @see remove_space_from_tail/1
  +-spec remove_space_from_tail_impl([{non_neg_integer(), pos_integer()}], non_neg_integer()) -> non_neg_integer().
  +remove_space_from_tail_impl([{X, Y} | T], Size) when Size =:= X + Y ->
  +    remove_space_from_tail_impl(T, X);
  +remove_space_from_tail_impl(_, Size) ->
  +    Size.
  +
   %%----------------------------------------------------------------------------------------------------------------------
   %% Unit Tests
   %%----------------------------------------------------------------------------------------------------------------------
  
positive.code:             parse1(State, Rest, [{Mark, Tag, lists:reverse(Result1)} | Result0]);
          _ ->
              error(?PARSE_ERROR)
      end.
  
  %% @doc Update delimiter part of the `parse/1'
  
negative.code: parse(State, Bin) ->
      case parse1(State, Bin, []) of
          {partial, _} -> error(?PARSE_ERROR);
          {_, Tags}    -> lists:reverse(Tags)
      end.
  
  %% @doc Part of the `parse/1'
  %%
  %% ATTENTION: The result is a list that is inverted.
  -spec parse1(state(), Input :: binary(), Result :: [tag()]) -> {state(), [tag()]} | partial().
  parse1(#state{start = Start, stop = Stop} = State, Bin, Result) ->
      case binary:split(Bin, Start) of
          []                       -> {State, Result};
          [B1]                     -> {State, [B1 | Result]};
          [B1, <<"{", B2/binary>>] -> parse2(State, binary:split(B2, <<"}", Stop/binary>>), [B1 | Result]);
          [B1, B2]                 -> parse3(State, binary:split(B2, Stop),                 [B1 | Result])
      end.
  