Skip to content
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

Improve support for Unicode supplementary characters in identifiers and string interpolation #9805

Merged
merged 2 commits into from Mar 17, 2022

Conversation

som-snytt
Copy link
Contributor

Precedence uses codepoint when probing lead char.

Scanner accepts supplementary chars in more places,
such as op_Supple, 'Supple'.

Fixes scala/bug#12482
Fixes scala/bug#12484
Fixes scala/bug#12485
Fixes scala/bug#12486

src/reflect/scala/reflect/internal/Chars.scala Outdated Show resolved Hide resolved
test/files/run/t1406.scala Outdated Show resolved Hide resolved
@som-snytt
Copy link
Contributor Author

som-snytt commented Nov 8, 2021

While looking at this, I had to relearn scala/vscode-scala-syntax#222 (comment)

in fact the last thing in my repl history is:

scala> implicit class P(sc: StringContext) { def x_*(parts: Any*) = "ha" }
class P

scala> x_*"no"
val res0: String = ha

Conversely, the obsolete test code was going to test s"$x_*" which is not allowed.

Precedence uses codepoint when probing lead char.

Scanner accepts supplementary chars in more places,
such as op_Supple, Supple"interp", s"$Supple".
@martijnhoekstra
Copy link
Contributor

I promise I'll get around to this this week, sorry for taking so long.

@dwijnand dwijnand modified the milestones: 2.13.8, 2.13.9 Dec 15, 2021
@SethTisue SethTisue modified the milestones: 2.13.8, 2.13.9 Dec 15, 2021
@SethTisue
Copy link
Member

@martijnhoekstra still interested in pursuing this?

@som-snytt
Copy link
Contributor Author

They have really long vacations over there. In America, they talk about the Halloween to New Year's period, but there it's All Hallow's to Summer Solstice.

@SethTisue
Copy link
Member

@unkarjedy you opened all four of the original tickets; would you be interested in reviewing this?

@SethTisue SethTisue changed the title Improve supplementary char support Improve support for Unicode supplementary characters in identifiers and string interpolation Mar 11, 2022
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Mar 11, 2022
@som-snytt
Copy link
Contributor Author

Also thanks @martijnhoekstra for previous help.

As the author, I am off the hook for review, which would require me to understand the delta. I dread the forward port, if necessary.

@som-snytt
Copy link
Contributor Author

I was about to say thanks @martijnhoekstra but I see I just said that. Now I have to review how this PR compares with what is on dotty.

Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SethTisue
Copy link
Member

SethTisue commented Mar 17, 2022

@som-snytt shall we go ahead and hit "merge"? can't quite tell if you're done.

@som-snytt
Copy link
Contributor Author

I'm not sure if @lrytz is done. Edit: I'm not sure if lrytz will say I'm not done.

@lrytz
Copy link
Member

lrytz commented Mar 17, 2022

Happy to have it merged, my comment was just a nudge to see if you have a better idea.

@SethTisue SethTisue merged commit c8ee991 into scala:2.13.x Mar 17, 2022
@som-snytt
Copy link
Contributor Author

Not only am I out of ideas, I have no memory of what this code does. If I have an idea when forward porting to Scala 3, I'll be sure to backport it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
6 participants