anchor.diff:               "             end,\n",
                "    NifBase = \"", atom_to_list(Mod) ++ ".nif", "\",\n",
                "    Nif = filename:join(NifDir, NifBase),\n",
  -             f("    erlang:load_nif(Nif, ~w).\n", [VsnAsList])];
  +             ?f("    erlang:load_nif(Nif, ~w).\n", [VsnAsList])];
           LoadNifFnText when is_list(LoadNifFnText); is_binary(LoadNifFnText) ->
               [replace_tilde_s(iolist_to_binary(LoadNifFnText),
  -                             iolist_to_binary(f("\"~s.nif\"", [Mod])),
  -                             iolist_to_binary(f("~w", [VsnAsList])))]
  +                             iolist_to_binary(?f("\"~s.nif\"", [Mod])),
  +                             iolist_to_binary(?f("~w", [VsnAsList])))]
       end.
   
   replace_tilde_s(<<"{{nifbase}}", Rest/binary>>, ModBin, VsnBin) ->
  
positive.code:     DoNif = proplists:get_bool(nif, Opts),
      AsLib = proplists:get_bool(include_as_lib, Opts),
      iolist_to_binary(
        [f("%% Automatically generated, do not edit~n"
           "%% Generated by ~p version ~s on ~w~n",
           [?MODULE, gpb:version_as_string(), calendar:local_time()]),
         f("-module(~w).~n", [Mod]),
         "\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"),
         format_enum_value_symbol_converter_exports(Defs),
         f("-export([get_package_name/0]).~n"),
         [f("-export([descriptor/0]).~n") || get_gen_descriptor_by_opts(Opts)],
         f("-export([gpb_version_as_string/0, gpb_version_as_list/0]).~n"),
         "\n",
         [["-on_load(load_nif/0).\n",
           "-export([load_nif/0]). %% for debugging of nif loading\n",
           "\n"]
          || DoNif],
         f("-include(\"~s.hrl\").~n", [Mod]),
         case get_field_format_by_opts(Opts) of
             fields_as_records ->
                 if AsLib ->
                         f("-include_lib(\"gpb/include/gpb.hrl\").~n");
                    not AsLib ->
                         f("-include(\"gpb.hrl\").~n")
                 end;
             fields_as_proplists ->
                 ""
         end,
         "\n",
         [[f("~s~n", [format_load_nif(Mod, Opts)]),
           "\n"]
          || DoNif],
         %% Enabling inlining seems to cause performance to drop drastically
  
negative.code:        [replace_term('<Names>', [EnumName || {{enum,EnumName}, _} <- Defs])]),
       "\n",
       format_fetch_msg_defs(MsgDefs),
       ?f("~n"),
       format_fetch_enum_defs(EnumDefs),
       ?f("~n"),
       format_find_msg_defs(MsgDefs, Opts),
       ?f("~n"),
       format_find_enum_defs(EnumDefs),
       ?f("~n"),
       format_enum_value_symbol_converters(EnumDefs),
       ?f("~n"),
       format_get_package_name(Defs),
       ?f("~n"),
       format_descriptor(Defs, Opts)
      ].
  
  