123456789101112131415161718192021222324252627282930313233343536373839404142434445(*
* OCanren. PPX suntax extensions.
* Copyright (C) 2015-2021
* Dmitri Boulytchev, Dmitry Kosarev, Alexey Syomin, Evgeny Moiseenko
* St.Petersburg State University, JetBrains Research
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License version 2, as published by the Free Software Foundation.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU Library General Public License version 2 for more details
* (enclosed in the file COPYING).
*)openPpxlibletstring_of_expressione=Format.set_margin1000;Format.set_max_indent2000;letans=Format.asprintf"%a"Pprintast.expressioneinans;;letmapper=objectinheritAst_traverse.mapassupermethod!expressione=matchewith|{pexp_desc=Pexp_construct({txt=Lident"REPR";_},Somee);_}asexpr->lettext=string_of_expressionein{exprwithpexp_desc=Pexp_tuple[Ast_helper.Exp.constant(Pconst_string(text,e.pexp_loc,None));e]}|e->super#expressioneend;;let()=Ppxlib.Driver.register_transformation~impl:(funs->mapper#structures)"repr"