-
Notifications
You must be signed in to change notification settings - Fork 49
Implement \R, \v, \h for character/scalar modes #384
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
@swift-ci Please test |
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! Do you also want to take #375 to fix the handling of \N
?
default: return false | ||
} | ||
} | ||
} |
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.
Character has a isNewline
. Can we share implementation and/or SPI for this?
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.
Also, is this the same list?
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.
It's the same list — we should ultimately have this on UnicodeScalar as well; probably with a name to match Character
's.
@swift-ci Please test |
@swift-ci Please test |
@swift-ci Please test |
1 similar comment
@swift-ci Please test |
241f155
to
6d27790
Compare
@swift-ci Please test macOS platform |
6d27790
to
a49854f
Compare
@swift-ci Please test macOS platform |
Figured this issue out — we were looking at the character view to test whether the current position was the start of a line, even in Unicode scalar mode. I've fixed that and audited the rest of the assertions to make sure that we're looking at the correct view. |
@swift-ci Please test |
@swift-ci Please test |
This implements these meta characters as per the Unicode proposal. We still need to expand how we treat
\n
. It should have mostly the same behavior as\v
, but I also want to make sure that/\r\n/
will match an"\r\n"
character.