Skip to content

Commit 7ebe4ae

Browse files
committed
syntax: update docs to reflect behavior
This updates the documentation on `allow_invalid_utf8` to reflect the current behavior of the translator. The old documentation was describing the behavior of regex-syntax 0.5, but it was changed in regex-syntax 0.6.
1 parent 3981d2a commit 7ebe4ae

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

regex-syntax/src/hir/translate.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ impl TranslatorBuilder {
5959
/// an expression that will only ever match valid UTF-8 (otherwise, the
6060
/// translator will return an error).
6161
///
62-
/// Note that currently, even when invalid UTF-8 is banned, the translator
63-
/// will permit a negated ASCII word boundary (i.e., `(?-u:\B)`) even
64-
/// though it can actually match at invalid UTF-8 boundaries. This bug
65-
/// will be fixed on the next semver release.
62+
/// Perhaps surprisingly, when invalid UTF-8 isn't allowed, a negated ASCII
63+
/// word boundary (uttered as `(?-u:\B)` in the concrete syntax) will cause
64+
/// the parser to return an error. Namely, a negated ASCII word boundary
65+
/// can result in matching positions that aren't valid UTF-8 boundaries.
6666
pub fn allow_invalid_utf8(
6767
&mut self,
6868
yes: bool,

regex-syntax/src/parser.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ impl ParserBuilder {
8888
/// an expression that will only ever match valid UTF-8 (otherwise, the
8989
/// parser will return an error).
9090
///
91-
/// Note that currently, even when invalid UTF-8 is banned, the parser
92-
/// will permit a negated ASCII word boundary (i.e., `(?-u:\B)`) even
93-
/// though it can actually match at invalid UTF-8 boundaries. This bug
94-
/// will be fixed on the next semver release.
91+
/// Perhaps surprisingly, when invalid UTF-8 isn't allowed, a negated ASCII
92+
/// word boundary (uttered as `(?-u:\B)` in the concrete syntax) will cause
93+
/// the parser to return an error. Namely, a negated ASCII word boundary
94+
/// can result in matching positions that aren't valid UTF-8 boundaries.
9595
pub fn allow_invalid_utf8(&mut self, yes: bool) -> &mut ParserBuilder {
9696
self.hir.allow_invalid_utf8(yes);
9797
self

0 commit comments

Comments
 (0)