anchor.diff:  -module(gpb).
   %-compile(export_all).
   -export([decode_msg/3]).
  +-export([merge_msgs/3]).
   -include_lib("eunit/include/eunit.hrl").
   
   %% TODO:
  
positive.code:                                        occurrence=required, opts=[]}]},
                      {{msg,t2}, [#field{name=b, fnum=1, type=uint32,
                                         occurrence=required, opts=[]}]}]).
  
negative.code:           (#field{name=FName, type={msg,_FieldMsgName}}, AccFields) ->
                 PrevMsg = keyfetch(FName,AccFields),
                 NewMsg  = keyfetch(FName,NewFields),
                 MergedMsg = merge_msgs(PrevMsg, NewMsg, MsgDefs),
                 replace_field(FName, MergedMsg, AccFields);
            (#field{name=FName}, AccFields) ->
                 case keyfetch(FName, NewFields) of
                     undefined -> AccFields;
                     NewValue  -> replace_field(FName, NewValue, AccFields)
                 end
         end,
         PrevFields,
         MsgDef)}.
  