anchor.diff:             maps ->
                  ""
          end,
  +       "\n",
  +       format_export_types(get_type_specs_by_opts(Opts),
  +                           get_records_or_maps_by_opts(Opts), Defs),
          "\n",
          [[?f("~s~n", [format_load_nif(Mod, Opts)]),
            "\n"]
  
positive.code:        [?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",
         format_export_types(get_type_specs_by_opts(Opts), Defs),
         "\n",
         [["-on_load(load_nif/0).\n",
           "-export([load_nif/0]). %% for debugging of nif loading\n",
           "\n"]
  
negative.code:                         PossibleNifCode,Opts,Reason})
               end
               || Ts <- FormToks],
      {AttrForms0, CodeForms} = split_forms_at_first_code(Forms),
      % extract export_type and type forms from attribute forms
      AttrForms = lists:filter(fun ({attribute, _, export_type, _}) -> false;
                                   ({attribute, _, type, _}) -> false;
                                   (_) -> true
                               end, AttrForms0),
      TypeForms = AttrForms -- AttrForms0,
      FieldDef = field_record_to_attr_form(),
      OneofDef = oneof_record_to_attr_form(),
      RpcDef   = rpc_record_to_attr_form(),
      RecordBaseDefs = [FieldDef, OneofDef, RpcDef],
      MsgRecordForms = msgdefs_to_record_attrs(MsgDefs),
      AllForms = AttrForms ++ RecordBaseDefs ++ MsgRecordForms ++ TypeForms ++ CodeForms,
      combine_erl_and_possible_nif(compile:forms(AllForms, Opts),
                                   PossibleNifCode).
  
  