-
Notifications
You must be signed in to change notification settings - Fork 404
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
Add \U00000000
notation for large unicode literals
#5443
base: master
Are you sure you want to change the base?
Conversation
This matches Python and Rust
@@ -660,6 +660,9 @@ def quotedCharCoreFn (isQuotable : Char → Bool) (inString : Bool) : ParserFn : | |||
andthenFn hexDigitFn hexDigitFn c (s.next' input i h) | |||
else if curr == 'u' then | |||
andthenFn hexDigitFn (andthenFn hexDigitFn (andthenFn hexDigitFn hexDigitFn)) c (s.next' input i h) | |||
else if curr == 'U' then | |||
(andthenFn hexDigitFn <| andthenFn hexDigitFn <| andthenFn hexDigitFn <| andthenFn hexDigitFn <| | |||
andthenFn hexDigitFn <| andthenFn hexDigitFn <| andthenFn hexDigitFn hexDigitFn) c (s.next' input i h) |
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.
One thing missing is a check that this is less than 0x110000 and not in the range [0xd800, 0xdfff]. That said, there's a missing check for u
that it's not in the surrogate range [0xd800, 0xdfff]. Right now, '\ud800'
gives '\x00'
.
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.
Right now,
'\ud800'
gives'\x00'
I guess this is related to #5445. Is Char.ofNat 0xd80f = 0
really desirable? Python seems to make a different choice here.
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.
Python passes these pairs through, right? And "\U00110000"
is a syntax error?
Mathlib CI status (docs):
|
Can we have rust's variadic syntax |
Doesn't rust support both |
nope, |
This matches Python
and RustRead this section before submitting
missing documentation
ormissing tests
then it needs fixing!RFC
orbug
issue in the description.leanprover/lean4-pr-releases:pr-release-NNNN
for Linux and M-series Macs will be generated upon build. To generate binaries for Windows and Intel-based Macs as well, write a comment containingrelease-ci
on its own line.nightly-with-mathlib
then CI will test Mathlib against your PR.awaiting-review
,awaiting-author
, andWIP
labels yourself, by writing a comment containing one of these labels on its own line.---
before submitting.Closes #0000 (
RFC
orbug
issue number fixed by this PR, if any)