12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849(** {i Eq} plugin: receive another value as inherited attribute and test for equality.
Very similar to {!Compare} plugin.
For type declaration [type ('a,'b,...) typ = ...] it will create a transformation
function with type
[('a -> 'a -> bool) ->
('b -> 'b -> bool) -> ... -> ('a,'b,...) typ -> bool ]
Inherited attribute' is the same as argument, synthetized attribute is {!GT.comparison}.
*)openGTCommonlettrait_name="eq"moduleMake(AstHelpers:GTHELPERS_sig.S)=structlettrait_name=trait_namemoduleC=Compare.Make(AstHelpers)openAstHelpersclassginitial_argstdecls=object(self:'self)inheritC.ginitial_argstdeclsmethod!trait_name=trait_namemethod!syn_of_param~locs=Typ.sprintf~loc"bool"method!syn_of_main~loc?in_classtdecl=self#syn_of_param~loc"dummy"method!on_different_constructors~locis_polyother_namecnamearg_typs=Exp.let_~loc[Pat.any~loc,Exp.ident~locother_name](Exp.false_~loc)method!chain_exprs~loce1e2=Exp.app_list~loc(Exp.ident~loc"&&")[e1;e2]method!chain_init~loc=Exp.true_~locendletcreate=(newg:>C.P.plugin_constructor)endletregister()=Expander.register_plugintrait_name(moduleMake:Plugin_intf.MAKE)let()=register()