anchor.diff:  %% Internal functions
   %%----------------------------------------------------------------------------
   
  -scan(<<C/utf8, Rest/bytes>>) ->
  +scan(<<C/utf8,Rest/bytes>>) ->
       case C of
  -        $( -> [{'(', 1}|scan(Rest)];
  -        $) -> [{')', 1}|scan(Rest)];
  -        $& -> [{'&', 1}|scan(Rest)];
  -        $| -> [{'|', 1}|scan(Rest)];
  -        $! -> [{'!', 1}|scan(Rest)];
  +        $( -> [{'(',1}|scan(Rest)];
  +        $) -> [{')',1}|scan(Rest)];
  +        $& -> [{'&',1}|scan(Rest)];
  +        $| -> [{'|',1}|scan(Rest)];
  +        $! -> [{'!',1}|scan(Rest)];
           32 -> scan(Rest); % skip spaces
           _  ->
               Regex = [<<"^([^()&|! ]*)(.*)$">>],
  -            Options = [unicode, global, {capture, all_but_first,
  -                                         binary}],
  +            Options = [unicode,global,{capture,all_but_first,binary}],
               case re:run(Rest, Regex, Options) of
  -                {match, [[Str, RestRest]]} ->
  -                    [{string, <<C, Str/bytes>>, 1}|scan(RestRest)];
  +                {match,[[Str,RestRest]]} ->
  +                    [{string,<<C,Str/bytes>>,1}|scan(RestRest)];
                   _ ->
  -                    [{string, <<C>>, 1}|scan(Rest)]
  +                    [{string,<<C>>,1}|scan(Rest)]
               end
       end;
   scan(<<>>) ->
  -    [{'$end', 1}].
  +    [{'$end',1}].
   
  -tree_to_query({and_q, SubTreeL, SubTreeR}, Lang) ->
  +tree_to_query({and_q,SubTreeL,SubTreeR}, Lang) ->
       #and_q{subs = [tree_to_query(SubTreeL, Lang),
                      tree_to_query(SubTreeR, Lang)]};
  -tree_to_query({or_q, SubTreeL, SubTreeR}, Lang) ->
  +tree_to_query({or_q,SubTreeL,SubTreeR}, Lang) ->
       #or_q{subs = [tree_to_query(SubTreeL, Lang),
                     tree_to_query(SubTreeR, Lang)]};
  -tree_to_query({not_q, SubTree}, Lang) ->
  +tree_to_query({not_q,SubTree},Lang) ->
       #not_q{sub = tree_to_query(SubTree, Lang)};
  -tree_to_query({term_q, {string, Keyword, _}}, Lang) ->
  +tree_to_query({term_q,{string,Keyword,_}}, Lang) ->
       [Term|_] = dk_pp:terms(Keyword, Lang),
       #term_q{term = Term}.
   
  
positive.code: 
  %% convert string to query
  from_str(Str, Lang) ->
      {ok, ParseTree} = dk_q_parser:parse(scan(Str)),
      tree_to_query(ParseTree, Lang).
  
  %% rewrite query to DNF
  
negative.code: 
  denest(#and_q{subs = Qs}) ->
      Rs = lists:flatten(lists:map(fun denest/1, Qs)),
      {Ands,Rest} = lists:partition(fun (R) -> is_record(R, and_q) end, Rs),
      #and_q{subs = lists:flatmap(fun subs/1, Ands) ++ Rest};
  denest(#or_q{subs = Qs}) ->
      Rs = lists:map(fun denest/1, Qs),
      {Ors,Rest} = lists:partition(fun (R) -> is_record(R, or_q) end, Rs),
      #or_q{subs = lists:flatmap(fun subs/1, Ors) ++ Rest};
  denest(#not_q{sub = Q}) ->
      #not_q{sub = denest(Q)};
  