From a7535cc67c51a3c4a17700ae858021357749e893 Mon Sep 17 00:00:00 2001 From: Corentin Leruth Date: Wed, 8 Feb 2023 07:42:15 +0100 Subject: [PATCH] refactor: use Ast_buildet to construct AST fragments --- src/ppx_import.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ppx_import.ml b/src/ppx_import.ml index c508e25..eee7076 100644 --- a/src/ppx_import.ml +++ b/src/ppx_import.ml @@ -572,7 +572,7 @@ let type_declaration_expand ~ctxt rec_flag type_decls = let type_decls = type_decls |> List.map (type_declaration ~tool_name ~input_name) in - Ppxlib.{pstr_desc = Pstr_type (rec_flag, type_decls); pstr_loc = loc} + Ppxlib.Ast_builder.Default.(pstr_type ~loc rec_flag type_decls) let type_declaration_expand_intf ~ctxt rec_flag type_decls = let loc = Ppxlib.Expansion_context.Extension.extension_point_loc ctxt in @@ -581,7 +581,7 @@ let type_declaration_expand_intf ~ctxt rec_flag type_decls = let type_decls = type_decls |> List.map (type_declaration ~tool_name ~input_name) in - Ppxlib.{psig_desc = Psig_type (rec_flag, type_decls); psig_loc = loc} + Ppxlib.Ast_builder.Default.(psig_type ~loc rec_flag type_decls) let module_declaration_expand ~ctxt package_type = let tool_name = Ppxlib.Expansion_context.Extension.tool_name ctxt in