From 8c2039543bc9bec27972edb79459dc635a1a4a66 Mon Sep 17 00:00:00 2001 From: Etienne Millon Date: Tue, 19 Jul 2022 11:07:42 +0200 Subject: [PATCH] Handle Syntaxerr.Removed_string_set --- src/lib/uTop.ml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/uTop.ml b/src/lib/uTop.ml index f751a74..c2dc6ff 100644 --- a/src/lib/uTop.ml +++ b/src/lib/uTop.ml @@ -305,6 +305,14 @@ let parse_default parse str eos_is_error = | Syntaxerr.Invalid_package_type (loc, s) -> Error ([mkloc loc], Printf.sprintf "Invalid package type: %s" s) +#endif +#if OCAML_VERSION >= (5, 0, 0) + | Syntaxerr.Removed_string_set loc -> + Error ([mkloc loc], + "Syntax error: strings are immutable, there is no assignment \ + syntax for them.\n\ + Hint: Mutable sequences of bytes are available in the Bytes module.\n\ + Hint: Did you mean to use 'Bytes.set'?") #endif end | Syntaxerr.Escape_error | Parsing.Parse_error ->