Handle Syntaxerr.Removed_string_set

This commit is contained in:
Etienne Millon 2022-07-19 11:07:42 +02:00
parent e89802f24c
commit 8c2039543b
1 changed files with 8 additions and 0 deletions

View File

@ -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 ->