-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zed_utf8.next_error
: raise Zed_utf8.Out_of_bounds
in case of invalid offset.
#52
Zed_utf8.next_error
: raise Zed_utf8.Out_of_bounds
in case of invalid offset.
#52
Conversation
1fcf3da
to
34a102c
Compare
c82b028
to
0d927c3
Compare
src/zed_utf8.mli
Outdated
[ofs] is [String.length str] and [msg] is the empty string. | ||
@raise [Zed_utf8.Out_of_bounds] if [ofs] not an index of [str]. | ||
*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ofs] is [String.length str] and [msg] is the empty string. | |
@raise [Zed_utf8.Out_of_bounds] if [ofs] not an index of [str]. | |
*) | |
[ofs] is [String.length str] and [msg] is the empty string. | |
@raise [Zed_utf8.Out_of_bounds] if [ofs] is not an index of [str]. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function seems to be raising Invalid as well, could you add it to the documentation at the same time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
fe2d1e8
to
15925e3
Compare
src/zed_utf8.mli
Outdated
@raise [Zed_utf8.Invalid] if [str] is not a correct UTF8 sequence. | ||
@raise [Zed_utf8.Out_of_bounds] if [ofs] not an index of [str]. | ||
*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small formatting fix:
@raise [Zed_utf8.Invalid] if [str] is not a correct UTF8 sequence. | |
@raise [Zed_utf8.Out_of_bounds] if [ofs] not an index of [str]. | |
*) | |
@raise [Zed_utf8.Invalid] if [str] is not a correct UTF8 sequence. | |
@raise [Zed_utf8.Out_of_bounds] if [ofs] not an index of [str]. *) |
15925e3
to
3e9e005
Compare
Looks good to me too. |
CHANGES: * `Zed_utf8.next_error`: raise `Zed_utf8.Out_of_bounds` in case of invalid offset (@Lucccyo, ocaml-community/zed#52) * `kill_next_word` should not raise `Out_of_bound` (@Lucccyo, ocaml-community/zed#55) * `of_utf8`: add `Uchar.is_valid` to check the input (@Lucccyo, ocaml-community/zed#51)
Zed_utf8.next_error string offset
should fail withZed_utf8.Out_of_bounds
, whenoffset
does not belong to a valid range (from 0 tostring
's length).