From aeb07a4544b35196de76da23454b7f4d32bb3da8 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sun, 3 Dec 2023 17:33:01 -0800 Subject: [PATCH] fix(ppx): stop printing extra `@` characters (#951) --- ppx/ast_external_process.ml | 8 +++----- ppx/error.ml | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ppx/ast_external_process.ml b/ppx/ast_external_process.ml index 41a7799f76..7fbdd93945 100644 --- a/ppx/ast_external_process.ml +++ b/ppx/ast_external_process.ml @@ -26,7 +26,7 @@ open Import module External_arg_spec = Melange_ffi.External_arg_spec module External_ffi_types = Melange_ffi.External_ffi_types -(* record pattern match complete checker*) +(* record pattern match complete checker *) let rec variant_can_unwrap_aux (row_fields : Parsetree.row_field list) : bool = match row_fields with @@ -158,8 +158,7 @@ let refine_obj_arg_type ~(nolabel : bool) (ptyp : Parsetree.core_type) : let result = Ast_attributes.iter_process_mel_string_or_int_as ptyp_attrs in (* when ppx start dropping attributes we should warn, there is a trade off whether - we should warn dropped non bs attribute or not - *) + we should warn dropped non bs attribute or not *) Mel_ast_invariant.warn_discarded_unused_attributes ptyp_attrs; match result with | None -> Error.err ~loc:ptyp.ptyp_loc Invalid_underscore_type_in_external @@ -179,8 +178,7 @@ let refine_obj_arg_type ~(nolabel : bool) (ptyp : Parsetree.core_type) : {[ external f : hi:([ `hi | `lo ] [@string]) -> unit -> _ = "" [@@obj] ]} - The result type would be [ hi:string ] -*) + The result type would be [ hi:string ] *) let get_opt_arg_type ~(nolabel : bool) (ptyp : Parsetree.core_type) : External_arg_spec.attr = if ptyp.ptyp_desc = Ptyp_any then diff --git a/ppx/error.ml b/ppx/error.ml index 17d92a54fe..ce21f0227e 100644 --- a/ppx/error.ml +++ b/ppx/error.ml @@ -63,13 +63,13 @@ let pp_error fmt err = "`@mel.return' directive *_to_opt expects the return type to be an \ option literal type (`_ option')" | Not_supported_directive_in_mel_return -> - "Unsupported `@mel.return' directive. Supported directives are one of:@\n\ - - undefined_to_opt@\n\ - - null_to_opt@\n\ - - nullable / null_undefined_to_opt@\n\ + "Unsupported `@mel.return' directive. Supported directives are one of:\n\ + - undefined_to_opt\n\ + - null_to_opt\n\ + - nullable / null_undefined_to_opt\n\ - identity" | Cannot_infer_arity_by_syntax -> - "Cannot infer arity through syntax.@\n\ + "Cannot infer arity through syntax.\n\ Use either `[@mel.uncurry n]' or the full arrow type" | Inconsistent_arity { uncurry_attribute; real } -> Printf.sprintf