Skip to content

Commit

Permalink
syntax: update docs to reflect behavior
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
BurntSushi committed Jul 18, 2018
1 parent 3981d2a commit 7ebe4ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions regex-syntax/src/hir/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ impl TranslatorBuilder {
/// an expression that will only ever match valid UTF-8 (otherwise, the
/// translator will return an error).
///
/// Note that currently, even when invalid UTF-8 is banned, the translator
/// will permit a negated ASCII word boundary (i.e., `(?-u:\B)`) even
/// though it can actually match at invalid UTF-8 boundaries. This bug
/// will be fixed on the next semver release.
/// Perhaps surprisingly, when invalid UTF-8 isn't allowed, a negated ASCII
/// word boundary (uttered as `(?-u:\B)` in the concrete syntax) will cause
/// the parser to return an error. Namely, a negated ASCII word boundary
/// can result in matching positions that aren't valid UTF-8 boundaries.
pub fn allow_invalid_utf8(
&mut self,
yes: bool,
Expand Down
8 changes: 4 additions & 4 deletions regex-syntax/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ impl ParserBuilder {
/// an expression that will only ever match valid UTF-8 (otherwise, the
/// parser will return an error).
///
/// Note that currently, even when invalid UTF-8 is banned, the parser
/// will permit a negated ASCII word boundary (i.e., `(?-u:\B)`) even
/// though it can actually match at invalid UTF-8 boundaries. This bug
/// will be fixed on the next semver release.
/// Perhaps surprisingly, when invalid UTF-8 isn't allowed, a negated ASCII
/// word boundary (uttered as `(?-u:\B)` in the concrete syntax) will cause
/// the parser to return an error. Namely, a negated ASCII word boundary
/// can result in matching positions that aren't valid UTF-8 boundaries.
pub fn allow_invalid_utf8(&mut self, yes: bool) -> &mut ParserBuilder {
self.hir.allow_invalid_utf8(yes);
self
Expand Down

0 comments on commit 7ebe4ae

Please sign in to comment.