anchor.diff:  %% Function: parse_attr/1
   %% @end
   parse_attr(Query) ->
  +    %% Produces a list such as ["attr1", attr2[1], attr3]
       Attrs = re:split(Query, "\\.", [{return, list}]),
  -    lists:map(fun list_to_atom/1, Attrs).
  +    Fun = fun(X, Acc) ->
  +		  %% Produces a list such as ["attr1"] or ["attr2", "1]"]
  +		  case re:split(X, "\\[", [{return, list}]) of
  +		      [Attr] ->
  +			  %% The erlson library works on atoms
  +			  [list_to_atom(Attr)| Acc];
  +		      [Attr, IndexNoLeftBracket] ->
  +			  [Index, _] = re:split(IndexNoLeftBracket, "\\]", [{return, list}]),
  +			  %% The erlson library works on atoms and integers and the integers
  +			  %% cannot be 0, but the syntax specifies 0 as the first index,
  +			  %% so we add 1 to the index after conversion
  +			  [list_to_atom(Attr), (list_to_integer(Index)+1) | Acc] 
  +		  end
  +	  end,
  +    lists:foldr(Fun, [], Attrs).
   
   %% @doc
   %% @hidden
  
positive.code: %% @end
  replace_field_internal(Json, Query, Value) ->
      Attrs = parse_attr(Query),
      try erlson:store(Attrs, Value, Json) of
  	Result ->
  	    to_string(erlson:to_json(Result))
      catch
  	_:_ ->
  	    Json
      end.
  
  %% @doc
  %% @hidden
  %% Function: rm_field_internal/2
  %% @end
  rm_field_internal(Json, Query) ->
      Attrs = parse_attr(Query),
      NewJson = erlson:remove(Attrs, Json),
      to_string(erlson:to_json(NewJson)).
  
negative.code: %% API functions - Exports
  %% ====================================================================
  -export([add_field/3,
  	 add_value_in_list/2,
  	 decode/1, 
  	 encode/1, 
  