anchor.diff:      Init.
   
   
  -%% Returns the parsed binary based on Input and the Unparsed part.
  -%% Used when parsing scheme.
  --spec calculate_parsed_scheme(binary(), binary()) -> binary().
  -calculate_parsed_scheme(Input, Unparsed) ->
  -    {First, _} = split_binary(Input, byte_size(Input) - byte_size(Unparsed) - 1),
  -    First.
  -
  -
   %% Returns the size of a binary exluding the first element.
   %% Used in calls to split_binary().
   -spec byte_size_exl_head(binary()) -> number().
   byte_size_exl_head(<<>>) -> 0;
   byte_size_exl_head(Binary) -> byte_size(Binary) + 1.
  -
  -
  -%% Returns size of 'Rest' for proper calculation of splitting position.
  -%% Solves the following special case:
  -%%
  -%%    #{host := <<>>, path := <<"/">>} = uri_string:parse(<<"///">>).
  -%%
  -%% While keeping the following true:
  -%%
  -%%     #{host := <<"hostname">>} = uri_string:parse(<<"//hostname">>).
  -%%     #{host := <<>>, path := <<"/hostname">>} = uri_string:parse(<<"///hostname">>).
  -%%
  --spec byte_size_exl_single_slash(uri_string()) -> number().
  -byte_size_exl_single_slash(<<$/>>) -> 0;
  -byte_size_exl_single_slash(Rest) -> byte_size(Rest).
   
   
   %%-------------------------------------------------------------------------
  
positive.code: parse_ipv4_bin(?STRING_REST($:, Rest), Acc, URI) ->
      _ = validate_ipv4_address(lists:reverse(Acc)),
      {T, URI1} = parse_port(Rest, URI),
      H = calculate_parsed_port(Rest, T),
      Port = binary_to_integer(H),
      {Rest, URI1#{port => Port}};
  parse_ipv4_bin(?STRING_REST($/, Rest), Acc, URI) ->
  
negative.code:     {Rest, URI1#{path => decode_path(?STRING_REST($/, Path))}};
  parse_reg_name(?STRING_REST($?, Rest), URI) ->
      {T, URI1} = parse_query(Rest, URI),  % path-empty ?query
      Query = calculate_parsed_query_fragment(Rest, T),
      {Rest, URI1#{query => decode_query(Query)}};
  parse_reg_name(?STRING_REST($#, Rest), URI) ->
      {T, URI1} = parse_fragment(Rest, URI),  % path-empty
      Fragment = calculate_parsed_query_fragment(Rest, T),
      {Rest, URI1#{fragment => decode_fragment(Fragment)}};
  parse_reg_name(?STRING_REST(Char, Rest), URI) ->
      case is_reg_name(Char) of
  