-
Notifications
You must be signed in to change notification settings - Fork 462
Ensure [[:blank:]]
only matches [ \t]
#534
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
Conversation
[[:blank:]]
only matches [ \t]
. Fix #533.[[:blank:]]
only matches [ \t]
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.
Nice catch! I think [[:space:]]
is actually supposed to match more than [ \t]
though.
@@ -1040,7 +1040,7 @@ fn ascii_class(kind: &ast::ClassAsciiKind) -> &'static [(char, char)] { | |||
X | |||
} | |||
Blank => { | |||
const X: T = &[(' ', '\t')]; | |||
const X: T = &[('\t', '\t'), (' ', ' ')]; |
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.
Oof. Thanks for catching this! It looks like a bad transcription error. However, I don't think this is right either. The docs include more characters:
[[:space:]] whitespace ([\t\n\v\f\r ])
And this is consistent with how regex-syntax 0.4
and below behaved:
regex/regex-syntax/src/parser.rs
Lines 1453 to 1454 in fa5cf6b
const SPACE: Class = &[('\t', '\t'), ('\n', '\n'), ('\x0B', '\x0B'), | |
('\x0C', '\x0C'), ('\r', '\r'), (' ', ' ')]; |
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.
@BurntSushi You're referring to docs for space
, but this bug and fix are for blank
which has fewer characters.
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.
Ug. Thanks for that. I don't think I had quite woken up yet!
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.
Thanks to @RReverser for fixing my errant observation! With that, this looks good!
Fix #533.