anchor.diff:      end.
   
   
  -format_msg_merge_code(Defs) ->
  +format_msg_merge_code(Defs, AnRes) ->
       MsgNames = [MsgName || {{msg, MsgName}, _MsgDef} <- Defs],
       [format_merge_msgs_top_level(MsgNames),
  -     [format_msg_merger(MsgName, MsgDef)
  +     [format_msg_merger(MsgName, MsgDef, AnRes)
         || {{msg, MsgName}, MsgDef} <- Defs]].
   
   format_merge_msgs_top_level([]) ->
  
positive.code:        "\n",
         f("~s~n", [format_decoders(Defs, AnRes, Opts)]),
         "\n",
         f("~s~n", [format_msg_merge_code(Defs)]),
         "\n",
         f("verify_msg(Msg) ->~n" %% Option to use gpb:verify_msg??
           "    ~s.~n", [format_verifier_topcase(4, Defs, "Msg")]),
  
negative.code:     FieldUpdatings = string:join(Overwritings ++ SeqAddings ++ MsgMergings,
                                   UpdateCommaSep),
      FnIndent = flength("~p(", [MergeFn]),
      [[[f("~p(Prev, undefined) -> Prev;~n", [MergeFn]),
         f("~p(undefined, New) -> New;~n", [MergeFn])]
        || occurs_as_optional_submsg(MsgName, AnRes)],
       f("~p(#~p{~s},~n", [MergeFn, MsgName, PFieldMatchings]),
       indent(FnIndent, f("#~p{~s}) ->~n", [MsgName, NFieldMatchings])),
       f("    #~p{~s}.~n~n", [MsgName, FieldUpdatings])].
  
  occurs_as_optional_submsg(MsgName, #anres{msg_occurrences=Occurrences}=AnRes) ->
      %% Note: order of evaluation below is important (the exprs of `andalso'):
      %% Messages are present in Occurrences only if they are sub-messages
      can_occur_as_sub_msg(MsgName, AnRes) andalso
          lists:member(optional, dict:fetch(MsgName, Occurrences)).
  
  format_field_skippers(MsgName) ->
      [format_varint_skipper(MsgName),
  