anchor.diff:           "    ~s.~n",
            [format_decoder_topcase(4, Defs, "Bin", "MsgName")]),
          "\n",
  -       f("~s~n", [format_decoders(Defs, AnRes, Opts)]),
  -       "\n",
  -       f("~s~n", [format_msg_merge_code(Defs, AnRes)]),
  -       "\n",
  -       f("verify_msg(Msg) ->~n" %% Option to use gpb:verify_msg??
  -         "    ~s.~n", [format_verifier_topcase(4, Defs, "Msg")]),
  -       "\n",
  -       f("~s~n", [format_verifiers(Defs, AnRes, Opts)]),
  -       "\n",
  -       format_introspection(Defs),
  -       "\n",
  -       f("gpb_version_as_string() ->~n"),
  -       f("    \"~s\".~n", [gpb:version_as_string()]),
  -       "\n",
  -       f("gpb_version_as_list() ->~n"),
  -       f("    ~w.~n", [gpb:version_as_list()])]).
  -
  -format_nif_erl(Mod, Defs, AnRes, Opts) ->
  -    iolist_to_binary(
  -      [f("%% Automatically generated, do not edit~n"
  -         "%% Generated by ~p version ~s on ~p~n",
  -         [?MODULE, gpb:version_as_string(), calendar:local_time()]),
  -       f("-module(~w).~n", [Mod]),
  -       "\n",
  -       "-on_load(load_nif/0).\n",
  -       "-export([load_nif/0]). %% for debugging of nif loading\n",
  -       "\n",
  -       f("-export([encode_msg/1, encode_msg/2]).~n"),
  -       f("-export([decode_msg/2]).~n"),
  -       f("-export([merge_msgs/2]).~n"),
  -       f("-export([verify_msg/1]).~n"),
  -       f("-export([get_msg_defs/0]).~n"),
  -       f("-export([get_msg_names/0]).~n"),
  -       f("-export([get_enum_names/0]).~n"),
  -       f("-export([find_msg_def/1, fetch_msg_def/1]).~n"),
  -       f("-export([find_enum_def/1, fetch_enum_def/1]).~n"),
  -       f("-export([get_package_name/0]).~n"),
  -       f("-export([gpb_version_as_string/0, gpb_version_as_list/0]).~n"),
  -       "\n",
  -       f("-include(\"~s.hrl\").~n", [Mod]),
  -       f("-include(\"gpb.hrl\").~n"),
  -       "\n",
  -       f("~s~n", [format_load_nif(Mod, Opts)]),
  -       "\n",
  -       %% FIXME:
  -       %% - format an -on_load hook
  -       %%
  -       f("encode_msg(Msg) ->~n"
  -         "    encode_msg(Msg, []).~n~n"),
  -       case proplists:get_value(verify, Opts, optionally) of
  -           optionally ->
  -               f("encode_msg(Msg, Opts) ->~n"
  -                 "    case proplists:get_bool(verify, Opts) of~n"
  -                 "        true  -> verify_msg(Msg);~n"
  -                 "        false -> ok~n"
  -                 "    end,~n"
  -                 "    ~s.~n", [format_encoder_topcase(4, Defs, "Msg")]);
  -           always ->
  -               f("encode_msg(Msg, _Opts) ->~n"
  -                 "    verify_msg(Msg),~n"
  -                 "    ~s.~n", [format_encoder_topcase(4, Defs, "Msg")]);
  -           never ->
  -               f("encode_msg(Msg, _Opts) ->~n"
  -                 "    ~s.~n", [format_encoder_topcase(4, Defs, "Msg")])
  +       if DoNif ->
  +               f("~s~n", [format_nif_decoder_error_wrappers(
  +                            Defs, AnRes, Opts)]);
  +          not DoNif ->
  +               f("~s~n", [format_decoders(Defs, AnRes, Opts)])
          end,
  -       "\n",
  -       f("~s~n", [format_encoders(Defs, AnRes, Opts)]),
  -       "\n",
  -       f("decode_msg(Bin, MsgName) ->~n"
  -         "    ~s.~n",
  -         [format_decoder_topcase(4, Defs, "Bin", "MsgName")]),
  -       "\n",
  -       f("~s~n", [format_nif_decoder_error_wrappers(Defs, AnRes, Opts)]),
          "\n",
          f("~s~n", [format_msg_merge_code(Defs, AnRes)]),
          "\n",
  
positive.code: get_output_format([{binary, true} | _])      -> binary;
  get_output_format([to_msg_defs | _])         -> msg_defs;
  get_output_format([{to_msg_defs, true} | _]) -> msg_defs;
  get_output_format([nif | _])                 -> nif;
  get_output_format([{nif, true} | _])         -> nif;
  get_output_format([_ | Rest])                -> get_output_format(Rest);
  get_output_format([])                        -> file.
  
  
negative.code: 
  %% -- compile to memory -----------------------------------------------------
  
  compile_to_binary(MsgDefs, ErlCode, PossibleNifCode, Opts) ->
      {ok, Toks, _EndLine} = erl_scan:string(flatten_iolist(ErlCode)),
      FormToks = split_toks_at_dot(Toks),
      Forms = lists:map(fun(Ts) ->
  