Skip to content

Remove octal escape literals #11140

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
merged 1 commit into from
Jan 18, 2021
Merged

Conversation

tanishiking
Copy link
Member

Closes #10895
Ref scala/scala#6324

This PR removes octal escape in String literals, which was deprecated and removed in scala 2.

@tanishiking tanishiking marked this pull request as ready for review January 17, 2021 15:12
val chr1 = '\0' // error
val str1 = "abc\123456" // error
val lf = '\012' // error
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved from untried

@@ -1157,6 +1158,8 @@ object Scanners {
nextChar()
}
}
val alt = if (oct == LF) "\\n" else "\\u%04x" format oct
Copy link
Contributor

Choose a reason for hiding this comment

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

if oct == LF then raw"\n" else f"\u$oct%04x" for style points?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 fixed

Closes scala#10895
Ref scala/scala#6324

This PR removes octal escape in String literals, which was deprecated
and removed in scala 2.
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@odersky odersky merged commit 2ba76b1 into scala:master Jan 18, 2021
@tanishiking tanishiking deleted the octal-escape-literal branch January 19, 2021 02:20
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

drop support for octal escape literals
4 participants