123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789# 1 "ppx/native/common/ppx_deriving_tools.ml"openPrintfopenPpxlibopenAst_builder.DefaultopenStdLabelsopenExpansion_helpersletnot_supported~locwhat=Location.raise_errorf~loc"%s are not supported"whatletmap_locfa_loc={a_locwithtxt=fa_loc.txt}letgen_bindings~locprefixn=List.split(List.init~len:n~f:(funi->letid=sprintf"%s_%i"prefixiinletpatt=ppat_var~loc{loc;txt=id}inletexpr=pexp_ident~loc{loc;txt=lidentid}inpatt,expr))letgen_tuple~locprefixn=letps,es=gen_bindings~locprefixninps,pexp_tuple~locesletgen_record~locprefixfs=letps,es=List.split(List.mapfs~f:(fun(n,_attrs,_t)->letid=sprintf"%s_%s"prefixn.txtinletpatt=ppat_var~loc{loc=n.loc;txt=id}inletexpr=pexp_ident~loc{loc=n.loc;txt=lidentid}in(map_loclidentn,patt),expr))inletns,ps=List.splitpsinps,pexp_record~loc(List.combinenses)Noneletgen_pat_tuple~locprefixn=letpatts,exprs=gen_bindings~locprefixninppat_tuple~locpatts,exprsletgen_pat_list~locprefixn=letpatts,exprs=gen_bindings~locprefixninletpatt=List.fold_left(List.revpatts)~init:[%pat?[]]~f:(funprevpatt->[%pat?[%ppatt]::[%pprev]])inpatt,exprsletgen_pat_record~locprefixns=letxs=List.mapns~f:(funn->letid=sprintf"%s_%s"prefixn.txtinletpatt=ppat_var~loc{loc=n.loc;txt=id}inletexpr=pexp_ident~loc{loc=n.loc;txt=lidentid}in(map_loclidentn,patt),expr)inppat_record~loc(List.mapxs~f:fst)Closed,List.mapxs~f:sndlet(-->)pc_lhspc_rhs={pc_lhs;pc_rhs;pc_guard=None}letderive_of_labelname=mangle(Suffixname)letderive_of_longidentname=mangle_lid(Suffixname)letederivername(lid:Longident.tloc)=pexp_ident~loc:lid.loc(map_loc(derive_of_longidentname)lid)typederiver=|As_funof(expression->expression)|As_valofexpressionletas_val~locderiverx=matchderiverwithAs_funf->fx|As_valf->[%expr[%ef][%ex]]letas_fun~locderiver=matchderiverwith|As_funf->[%exprfunx->[%ef[%exprx]]]|As_valf->fclassvirtualderiving=objectmethodvirtualname:labelmethodvirtualextension:loc:location->path:label->core_type->expressionmethodvirtualstr_type_decl:ctxt:Expansion_context.Deriver.t->rec_flag*type_declarationlist->structuremethodvirtualsig_type_decl:ctxt:Expansion_context.Deriver.t->rec_flag*type_declarationlist->signatureendletregister?depsderiving=letargs=Deriving.Args.emptyinletstr_type_decl=deriving#str_type_declinletsig_type_decl=deriving#sig_type_declinDeriving.addderiving#name~extension:deriving#extension~str_type_decl:(Deriving.Generator.V2.make?depsargsstr_type_decl)~sig_type_decl:(Deriving.Generator.V2.make?depsargssig_type_decl)letregister_combined?depsnamederivings=letargs=Deriving.Args.emptyinletstr_type_decl~ctxtbindings=List.fold_leftderivings~init:[]~f:(funstrd->d#str_type_decl~ctxtbindings@str)inletsig_type_decl~ctxtbindings=List.fold_leftderivings~init:[]~f:(funstrd->d#sig_type_decl~ctxtbindings@str)inDeriving.addname~str_type_decl:(Deriving.Generator.V2.make?depsargsstr_type_decl)~sig_type_decl:(Deriving.Generator.V2.make?depsargssig_type_decl)moduleSchema=structletrepr_row_fieldfield=matchfield.prf_descwith|Rtag(id,_,[])->`Rtag(id,[])|Rtag(id,_,[{ptyp_desc=Ptyp_tuplets;_}])->`Rtag(id,ts)|Rtag(id,_,[t])->`Rtag(id,[t])|Rtag(_,_,_::_)->not_supported~loc:field.prf_loc"polyvariant constructor with more than one argument"|Rinherit{ptyp_desc=Ptyp_constr(id,ts);_}->`Rinherit(id,ts)|Rinherit_->not_supported~loc:field.prf_loc"this polyvariant inherit"letrepr_core_typety=letloc=ty.ptyp_locinmatchty.ptyp_descwith|Ptyp_tuplets->`Ptyp_tuplets|Ptyp_constr(id,ts)->`Ptyp_constr(id,ts)|Ptyp_vartxt->`Ptyp_var{txt;loc=ty.ptyp_loc}|Ptyp_variant(fs,Closed,None)->`Ptyp_variantfs|Ptyp_variant_->not_supported~loc"non closed polyvariants"|Ptyp_arrow_->not_supported~loc"function types"|Ptyp_any->not_supported~loc"type placeholders"|Ptyp_object_->not_supported~loc"object types"|Ptyp_class_->not_supported~loc"class types"|Ptyp_poly_->not_supported~loc"polymorphic type expressions"|Ptyp_package_->not_supported~loc"packaged module types"|Ptyp_extension_->not_supported~loc"extension nodes"|Ptyp_alias_->not_supported~loc"type aliases"letrepr_type_declarationtd=letloc=td.ptype_locinmatchtd.ptype_kind,td.ptype_manifestwith|Ptype_abstract,None->not_supported~loc"abstract types"|Ptype_abstract,Somet->`Ptype_core_typet|Ptype_variantctors,_->`Ptype_variantctors|Ptype_recordfs,_->`Ptype_recordfs|Ptype_open,_->not_supported~loc"open types"letgen_type_ascription(td:type_declaration)=letloc=td.ptype_locinptyp_constr~loc{loc;txt=lidenttd.ptype_name.txt}(List.maptd.ptype_params~f:(fun(p,_)->matchp.ptyp_descwith|Ptyp_varname->ptyp_var~locname|Ptyp_any->ptyp_any~loc|_->Location.raise_errorf~loc"this cannot be a type parameter"))letderive_sig_type_decl~derive_t~derive_label~ctxt(_rec_flag,tds)=letloc=Expansion_context.Deriver.derived_item_locctxtinList.maptds~f:(funtd->letname=td.ptype_nameinlettype_=derive_t~locname(gen_type_ascriptiontd)inlettype_=List.fold_left(List.revtd.ptype_params)~init:type_~f:(funacc(t,_)->letloc=t.ptyp_locinletname=matcht.ptyp_descwith|Ptyp_vartxt->{txt;loc}|_->Location.raise_errorf~loc"type variable is not a variable"inlett=derive_t~locnametinptyp_arrow~locNolabeltacc)inpsig_value~loc(value_description~loc~prim:[]~name:(derive_labelname)~type_))classvirtualderiving1=object(self)inheritderivingmethodvirtualt:loc:location->labelloc->core_type->core_typemethodderive_of_tuple:core_type->core_typelist->expression->expression=funt__->letloc=t.ptyp_locinnot_supported"tuple types"~locmethodderive_of_record:type_declaration->label_declarationlist->expression->expression=funtd__->letloc=td.ptype_locinnot_supported"record types"~locmethodderive_of_variant:type_declaration->constructor_declarationlist->expression->expression=funtd__->letloc=td.ptype_locinnot_supported"variant types"~locmethodderive_of_polyvariant:core_type->row_fieldlist->expression->expression=funt__->letloc=t.ptyp_locinnot_supported"polyvariant types"~locmethodprivatederive_type_ref_name:label->longidentloc->expression=funnamen->ederivernamenmethodprivatederive_type_ref'~locnaments=letf=self#derive_type_ref_namenameninletargs=List.fold_left(List.revts)~init:[]~f:(funargsa->leta=as_fun~loc(self#derive_of_core_type'a)in(Nolabel,a)::args)inAs_val(pexp_apply~locfargs)methodderive_type_ref~locnamentsx=as_val~loc(self#derive_type_ref'~locnaments)xmethodprivatederive_of_core_type't=letloc=t.ptyp_locinmatchrepr_core_typetwith|`Ptyp_tuplets->As_fun(self#derive_of_tupletts)|`Ptyp_varlabel->As_val(ederiverself#name(map_loclidentlabel))|`Ptyp_constr(id,ts)->self#derive_type_ref'self#name~locidts|`Ptyp_variantfs->As_fun(self#derive_of_polyvarianttfs)methodderive_of_core_typetx=letloc=x.pexp_locinas_val~loc(self#derive_of_core_type't)xmethodprivatederive_type_decl_labelname=map_loc(derive_of_labelself#name)namemethodderive_of_type_declarationtd=letloc=td.ptype_locinletname=td.ptype_nameinletrev_params=List.rev_maptd.ptype_params~f:(fun(t,_)->matcht.ptyp_descwith|Ptyp_vartxt->{txt;loc=t.ptyp_loc}|Ptyp_any->{txt=gen_symbol~prefix:"_"();loc=t.ptyp_loc}|_->Location.raise_errorf~loc"type variable is not a variable")inletx=[%exprx]inletexpr=matchrepr_type_declarationtdwith|`Ptype_core_typet->self#derive_of_core_typetx|`Ptype_variantctors->self#derive_of_varianttdctorsx|`Ptype_recordfs->self#derive_of_recordtdfsxinletexpr=[%expr(funx->[%eexpr]:[%tself#t~locname(gen_type_ascriptiontd)])]inletexpr=List.fold_leftrev_params~init:expr~f:(funbodyparam->pexp_fun~locNolabelNone(ppat_var~loc(map_loc(derive_of_labelself#name)param))body)in[value_binding~loc~pat:(ppat_var~loc(self#derive_type_decl_labelname))~expr;]methodextension:loc:location->path:label->core_type->expression=fun~loc:_~path:_ty->letloc=ty.ptyp_locinas_fun~loc(self#derive_of_core_type'ty)methodstr_type_decl:ctxt:Expansion_context.Deriver.t->rec_flag*type_declarationlist->structure=fun~ctxt(_rec_flag,tds)->letloc=Expansion_context.Deriver.derived_item_locctxtinletbindings=List.concat_maptds~f:self#derive_of_type_declarationin[%str[@@@ocaml.warning"-39-11-27"][%%ipstr_value~locRecursivebindings]]methodsig_type_decl:ctxt:Expansion_context.Deriver.t->rec_flag*type_declarationlist->signature=derive_sig_type_decl~derive_t:self#t~derive_label:self#derive_type_decl_labelendendletrecget_variant_names~locc=matchSchema.repr_row_fieldcwith|`Rtag(name,ts)->[Printf.sprintf{|["%s"%s]|}name.txt(ts|>List.map~f:(fun_->", _")|>String.concat~sep:"");]|`Rinherit(n,ts)->(matchSchema.repr_core_type(ptyp_constr~loc:n.locnts)with|`Ptyp_variantfields->List.concat_mapfields~f:(get_variant_names~loc)|_->[])letget_constructor_namescs=List.mapcs~f:(func->letname=c.pcd_nameinmatchc.pcd_argswith|Pcstr_record_fs->Printf.sprintf{|["%s", { _ }]|}name.txt|Pcstr_tupleli->Printf.sprintf{|["%s"%s]|}name.txt(li|>List.map~f:(fun_->", _")|>String.concat~sep:""))moduleConv=structtype'ctxtuple={tpl_loc:location;tpl_types:core_typelist;tpl_ctx:'ctx;}type'ctxrecord={rcd_loc:location;rcd_fields:label_declarationlist;rcd_ctx:'ctx;}typevariant_case=|Vcs_tupleoflabelloc*variant_case_ctxtuple|Vcs_recordoflabelloc*variant_case_ctxrecordandvariant_case_ctx=|Vcs_ctx_variantofconstructor_declaration|Vcs_ctx_polyvariantofrow_fieldtypevariant={vrt_loc:location;vrt_cases:variant_caselist;vrt_ctx:variant_ctx;}andvariant_ctx=|Vrt_ctx_variantoftype_declaration|Vrt_ctx_polyvariantofcore_typeletrepr_polyvariant_casescs=List.revcs|>List.map~f:(func->c,Schema.repr_row_fieldc)letrepr_variant_casescs=List.revcsletderiving_of~name~of_t~is_allow_any_constr~derive_of_tuple~derive_of_record~derive_of_variant~derive_of_variant_case()=(object(self)inheritSchema.deriving1methodname=namemethodt~loc_namet=[%type:[%tof_t~loc]->[%tt]]method!derive_of_tuplettsx=lett={tpl_loc=t.ptyp_loc;tpl_types=ts;tpl_ctx=t}inderive_of_tupleself#derive_of_core_typetxmethod!derive_of_recordtdfsx=lett={rcd_loc=td.ptype_loc;rcd_fields=fs;rcd_ctx=td}inderive_of_recordself#derive_of_core_typetxmethod!derive_of_varianttdcsx=letloc=td.ptype_locinletcs=repr_variant_casescsinletallow_any_constr=cs|>List.find_opt~f:(funcs->is_allow_any_constr(Vcs_ctx_variantcs))|>Option.map(funcse->econstructcs(Somee))inletcs=List.filter~f:(funcs->not(is_allow_any_constr(Vcs_ctx_variantcs)))csinletbody,cases=List.fold_leftcs~init:(matchallow_any_constrwith|Someallow_any_constr->allow_any_constrx,[]|None->leterror_message=Printf.sprintf"expected %s"(get_constructor_namescs|>String.concat~sep:" or ")in([%exprMelange_json.of_json_error~json:[%ex][%eestring~locerror_message]],[]))~f:(fun(next,cases)c->letmake(n:labelloc)arg=pexp_construct(map_loclidentn)~loc:n.locarginletctx=Vcs_ctx_variantcinletn=c.pcd_nameinmatchc.pcd_argswith|Pcstr_recordfs->lett=lett={rcd_loc=loc;rcd_fields=fs;rcd_ctx=ctx}inVcs_record(n,t)inletnext=derive_of_variant_caseself#derive_of_core_type(maken)t~allow_any_constrnextinnext,t::cases|Pcstr_tuplets->letcase=lett={tpl_loc=loc;tpl_types=ts;tpl_ctx=ctx}inVcs_tuple(n,t)inletnext=derive_of_variant_caseself#derive_of_core_type(maken)case~allow_any_constrnextinnext,case::cases)inlett={vrt_loc=loc;vrt_cases=cases;vrt_ctx=Vrt_ctx_varianttd;}inderive_of_variantself#derive_of_core_typet~allow_any_constrbodyxmethod!derive_of_polyvariantt(cs:row_fieldlist)x=letloc=t.ptyp_locinletallow_any_constr=cs|>List.find_opt~f:(funcs->is_allow_any_constr(Vcs_ctx_polyvariantcs))|>Option.map(funcs->matchcs.prf_descwith|Rinherit_->failwith"[@allow_any] placed on inherit clause"|Rtag(n,_,_)->fune->pexp_variant~loc:n.locn.txt(Somee))inletcs=List.filter~f:(funcs->not(is_allow_any_constr(Vcs_ctx_polyvariantcs)))csinletcases=repr_polyvariant_casescsinletbody,cases=List.fold_leftcases~init:(matchallow_any_constrwith|Someallow_any_constr->allow_any_constrx,[]|None->leterror_message=Printf.sprintf"expected %s"(cs|>List.concat_map~f:(get_variant_names~loc)|>String.concat~sep:" or ")in([%exprMelange_json.of_json_unexpected_variant~json:x[%eestring~locerror_message]],[]))~f:(fun(next,cases)(c,r)->letctx=Vcs_ctx_polyvariantcinmatchrwith|`Rtag(n,ts)->letmakearg=pexp_variant~loc:n.locn.txtarginletcase=lett={tpl_loc=loc;tpl_types=ts;tpl_ctx=ctx}inVcs_tuple(n,t)inletnext=derive_of_variant_caseself#derive_of_core_typemakecase~allow_any_constrnextinnext,case::cases|`Rinherit(n,ts)->letmaybe_e=self#derive_type_ref~locself#namentsxinlett=ptyp_variant~loccsClosedNoneinletnext=[%exprmatch[%emaybe_e]with|e->(e:>[%tt])|exceptionMelange_json.Of_json_error(Melange_json.Unexpected_variant_)->[%enext]]innext,cases)inlett={vrt_loc=loc;vrt_cases=cases;vrt_ctx=Vrt_ctx_polyvariantt;}inderive_of_variantself#derive_of_core_typet~allow_any_constrbodyxend:>deriving)letderiving_of_match~name~of_t~cmp_sort_vcs~derive_of_tuple~derive_of_record~derive_of_variant_case()=(object(self)inheritSchema.deriving1methodname=namemethodt~loc_namet=[%type:[%tof_t~loc]->[%tt]]method!derive_of_tuplettsx=lett={tpl_loc=t.ptyp_loc;tpl_types=ts;tpl_ctx=t}inderive_of_tupleself#derive_of_core_typetxmethod!derive_of_recordtdfsx=lett={rcd_loc=td.ptype_loc;rcd_fields=fs;rcd_ctx=td}inderive_of_recordself#derive_of_core_typetxmethod!derive_of_varianttdcsx=letloc=td.ptype_locinleterror_message=Printf.sprintf"expected %s"(get_constructor_namescs|>String.concat~sep:" or ")inletcs=repr_variant_casescsinletcs=List.stable_sort~cmp:(funcs1cs2->letvcs1=Vcs_ctx_variantcs1andvcs2=Vcs_ctx_variantcs2incmp_sort_vcsvcs1vcs2)csinletcases=List.fold_leftcs~init:[[%pat?_]-->[%exprMelange_json.of_json_error~json:x[%eestring~locerror_message]];]~f:(funnext(c:constructor_declaration)->letctx=Vcs_ctx_variantcinletmake(n:labelloc)arg=pexp_construct(map_loclidentn)~loc:n.locarginletn=c.pcd_nameinmatchc.pcd_argswith|Pcstr_recordfs->lett=letr={rcd_loc=loc;rcd_fields=fs;rcd_ctx=ctx}inVcs_record(n,r)inderive_of_variant_caseself#derive_of_core_type(maken)t::next|Pcstr_tuplets->lett=lett={tpl_loc=loc;tpl_types=ts;tpl_ctx=ctx}inVcs_tuple(n,t)inderive_of_variant_caseself#derive_of_core_type(maken)t::next)inpexp_match~locxcasesmethod!derive_of_polyvariantt(cs:row_fieldlist)x=letloc=t.ptyp_locinletcases=repr_polyvariant_casescsinletcases=List.stable_sort~cmp:(fun(cs1,_)(cs2,_)->letvcs1=Vcs_ctx_polyvariantcs1andvcs2=Vcs_ctx_polyvariantcs2incmp_sort_vcsvcs1vcs2)casesinletctors,inherits=List.partition_mapcases~f:(fun(c,r)->letctx=Vcs_ctx_polyvariantcinmatchrwith|`Rtag(n,ts)->lett={tpl_loc=loc;tpl_types=ts;tpl_ctx=ctx}inLeft(n,Vcs_tuple(n,t))|`Rinherit(n,ts)->Right(n,ts))inletcatch_all=[%pat?x]-->List.fold_left(List.revinherits)~init:(leterror_message=Printf.sprintf"expected %s"(cs|>List.concat_map~f:(get_variant_names~loc)|>String.concat~sep:" or ")in[%exprMelange_json.of_json_unexpected_variant~json:x[%eestring~locerror_message]])~f:(funnext(n,ts)->letmaybe=self#derive_type_ref~locself#namentsxinlett=ptyp_variant~loccsClosedNonein[%exprmatch[%emaybe]with|x->(x:>[%tt])|exceptionMelange_json.Of_json_error(Melange_json.Unexpected_variant_)->[%enext]])inletcases=List.fold_leftctors~init:[catch_all]~f:(funnext((n:labelloc),t)->letmakearg=pexp_variant~loc:n.locn.txtarginderive_of_variant_caseself#derive_of_core_typemaket::next)inpexp_match~locxcasesend:>deriving)letderiving_to~name~t_to~derive_of_tuple~derive_of_record~derive_of_variant_case()=(object(self)inheritSchema.deriving1methodname=namemethodt~loc_namet=[%type:[%tt]->[%tt_to~loc]]method!derive_of_tuplettsx=letloc=t.ptyp_locinlett={tpl_loc=loc;tpl_types=ts;tpl_ctx=t}inletn=List.lengthtsinletp,es=gen_pat_tuple~loc"x"ninpexp_match~locx[p-->derive_of_tupleself#derive_of_core_typetes]method!derive_of_recordtdfsx=lett={rcd_loc=td.ptype_loc;rcd_fields=fs;rcd_ctx=td}inletloc=td.ptype_locinletp,es=gen_pat_record~loc"x"(List.mapfs~f:(funf->f.pld_name))inpexp_match~locx[p-->derive_of_recordself#derive_of_core_typetes]method!derive_of_varianttdcsx=letloc=td.ptype_locinletctor_pat(n:labelloc)pat=ppat_construct~loc:n.loc(map_loclidentn)patinletcs=repr_variant_casescsinpexp_match~locx(List.rev_mapcs~f:(func->letn=c.pcd_nameinletctx=Vcs_ctx_variantcinmatchc.pcd_argswith|Pcstr_recordfs->letp,es=gen_pat_record~loc"x"(List.mapfs~f:(funf->f.pld_name))inlett=lett={rcd_loc=loc;rcd_fields=fs;rcd_ctx=ctx}inVcs_record(n,t)inctor_patn(Somep)-->derive_of_variant_caseself#derive_of_core_typetes|Pcstr_tuplets->letarity=List.lengthtsinlett=lett={tpl_loc=loc;tpl_types=ts;tpl_ctx=ctx}inVcs_tuple(n,t)inletp,es=gen_pat_tuple~loc"x"arityinctor_patn(ifarity=0thenNoneelseSomep)-->derive_of_variant_caseself#derive_of_core_typetes))method!derive_of_polyvariantt(cs:row_fieldlist)x=letloc=t.ptyp_locinletcases=repr_polyvariant_casescsinletcases=List.rev_mapcases~f:(fun(c,r)->letctx=Vcs_ctx_polyvariantcinmatchrwith|`Rtag(n,[])->lett=lett={tpl_loc=loc;tpl_types=[];tpl_ctx=ctx}inVcs_tuple(n,t)inppat_variant~locn.txtNone-->derive_of_variant_caseself#derive_of_core_typet[]|`Rtag(n,ts)->lett={tpl_loc=loc;tpl_types=ts;tpl_ctx=ctx}inletps,es=gen_pat_tuple~loc"x"(List.lengthts)inppat_variant~locn.txt(Someps)-->derive_of_variant_caseself#derive_of_core_type(Vcs_tuple(n,t))es|`Rinherit(n,ts)->[%pat?[%pppat_type~locn]asx]-->self#derive_of_core_type(ptyp_constr~loc:n.locnts)[%exprx])inpexp_match~locxcasesend:>deriving)endincludeSchema