-
Notifications
You must be signed in to change notification settings - Fork 79
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
FromUnicodeScalarView deprecation message possibly references unimplemented conversion? #344
Comments
@kamcma I think that missing conversion is just an oversight. Wanna PR one? |
Will do! |
For the record, the motivating use-case that led me to even discover the absence of these conversions mentioned in the deprecation message was wanting to use Foundation's let p = Parse(input: Substring.self) {
Peek {
From(.unicodeScalars) {
Prefix(1, while: CharacterSet.alphanumerics.contains)
}
}
// ...
} If there's a better way to do that, I'm all ears. |
Well, having played around with CharacterSet as a parser directly a little more, I may be able to accomplish this more cleanly like so: let p = Parse(input: Substring.self) {
Peek {
Prefix(1).pipe {
CharacterSet.letters
}
}
CharacterSet.alphanumerics
} Probably |
I think the deprecation messages for
FromUnicodeScalarView
might reference an unimplemented conversion?swift-parsing/Sources/Parsing/Internal/Deprecations.swift
Lines 808 to 850 in f949081
This compiles with the deprecation warning:
But the suggested replacement does not:
Would be happy to be told I'm holding it wrong! Feel free to close/convert to discussion if so. Thanks for the incredible library.
The text was updated successfully, but these errors were encountered: