Punycode (RFC3492) in OCaml

errors

+12
+3
lib/punycode.ml
··· 61 | Empty_label -> 62 Format.fprintf fmt "empty label" 63 64 (* {1 Error Constructors} *) 65 66 let overflow pos = Error (Overflow pos)
··· 61 | Empty_label -> 62 Format.fprintf fmt "empty label" 63 64 + let error_to_string err = 65 + Format.asprintf "%a" pp_error err 66 + 67 (* {1 Error Constructors} *) 68 69 let overflow pos = Error (Overflow pos)
+3
lib/punycode.mli
··· 70 val pp_error : Format.formatter -> error -> unit 71 (** [pp_error fmt e] pretty-prints an error with position information. *) 72 73 (** {1 Constants} 74 75 Punycode parameters as specified in
··· 70 val pp_error : Format.formatter -> error -> unit 71 (** [pp_error fmt e] pretty-prints an error with position information. *) 72 73 + val error_to_string : error -> string 74 + (** [error_to_string e] converts an error to a human-readable string. *) 75 + 76 (** {1 Constants} 77 78 Punycode parameters as specified in
+3
lib/punycode_idna.ml
··· 28 | Verification_failed -> 29 Format.fprintf fmt "IDNA verification failed (round-trip mismatch)" 30 31 (* {1 Error Constructors} *) 32 33 let punycode_error e = Error (Punycode_error e)
··· 28 | Verification_failed -> 29 Format.fprintf fmt "IDNA verification failed (round-trip mismatch)" 30 31 + let error_to_string err = 32 + Format.asprintf "%a" pp_error err 33 + 34 (* {1 Error Constructors} *) 35 36 let punycode_error e = Error (Punycode_error e)
+3
lib/punycode_idna.mli
··· 53 val pp_error : Format.formatter -> error -> unit 54 (** [pp_error fmt e] pretty-prints an error. *) 55 56 (** {1 Constants} *) 57 58 val max_domain_length : int
··· 53 val pp_error : Format.formatter -> error -> unit 54 (** [pp_error fmt e] pretty-prints an error. *) 55 56 + val error_to_string : error -> string 57 + (** [error_to_string e] converts an error to a human-readable string. *) 58 + 59 (** {1 Constants} *) 60 61 val max_domain_length : int