Merge pull request #396 from emillon/removed-string-set

Handle Syntaxerr.Removed_string_set
This commit is contained in:
Etienne Millon 2022-07-19 11:28:07 +02:00 committed by GitHub
commit e2a765f36f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 ->