123456789101112131415161718192021222324openBaseopenPpxlibletexpand(e:Parsetree.expression)=matche.pexp_descwith|Pexp_apply(id,args)whennot(List.existsargs~f:(fun(lab,_)->matchlabwith|Labelled"here"->true|_->false))->lethere=Ppx_here_expander.lift_position~loc:id.pexp_locinSome{ewithpexp_desc=Pexp_apply(id,(Labelled"here",here)::args)}|Pexp_ident_->(* This case is a bit dubious but it's what was done before *)letloc=e.pexp_locinlethere=Ppx_here_expander.lift_position~locinSome(Ast_builder.Default.pexp_apply~loce[(Labelled"here",here)])|_->None;;let()=Driver.register_transformation"fail"~rules:[Context_free.Rule.special_function"failwiths"expand];;