-
-
Notifications
You must be signed in to change notification settings - Fork 557
refactor(codegen): print string literals containing lone surrogates without reference to raw
#10044
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
Merged
graphite-app
merged 1 commit into
main
from
03-26-refactor_codegen_print_string_literals_containing_lone_surrogates_without_reference_to_raw_
Mar 29, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Mar 25, 2025
CodSpeed Instrumentation Performance ReportMerging #10044 will not alter performanceComparing Summary
|
93d7896
to
687f8bf
Compare
dc171cd
to
025be46
Compare
This was referenced Mar 27, 2025
025be46
to
22f9406
Compare
687f8bf
to
61beb43
Compare
This was referenced Mar 27, 2025
69f5a24
to
015a0a1
Compare
61beb43
to
e3a2d8a
Compare
015a0a1
to
1162843
Compare
e3a2d8a
to
5cc0884
Compare
This was referenced Mar 28, 2025
5cc0884
to
ce4b22b
Compare
0aa89a2
to
d822f65
Compare
ce4b22b
to
2e54383
Compare
This was referenced Mar 28, 2025
Merge activity
|
…ithout reference to `raw` (#10044) #10041 changed how lone surrogates are handled in `StringLiteral`s. `StringLiteral`s which include lone surrogates now have the `lone_surrogates` flag set, and `value` encodes lone surrogates as `\u{FFFD}XXXX`, where `XXXX` is the code unit encoded as hex. Codegen check the `lone_surrogates` flag and decode the lone surrogates if they're present. This means that: 1. A `StringLiteral` no longer needs to have `raw` field populated, so you can (if you choose to for some reason) create a new `StringLiteral` containing lone surrogates. 2. `StringLiteral`s containing lone surrogates now have any other characters escaped same as how `StringLiteral`s without lone surrogates are printed.
d822f65
to
f0e1510
Compare
2e54383
to
719742b
Compare
Base automatically changed from
03-25-fix_parser_store_lone_surrogates_as_escape_sequence
to
main
March 29, 2025 13:04
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#10041 changed how lone surrogates are handled in
StringLiteral
s.StringLiteral
s which include lone surrogates now have thelone_surrogates
flag set, andvalue
encodes lone surrogates as\u{FFFD}XXXX
, whereXXXX
is the code unit encoded as hex.Codegen check the
lone_surrogates
flag and decode the lone surrogates if they're present. This means that:A
StringLiteral
no longer needs to haveraw
field populated, so you can (if you choose to for some reason) create a newStringLiteral
containing lone surrogates.StringLiteral
s containing lone surrogates now have any other characters escaped same as howStringLiteral
s without lone surrogates are printed.