SI-6725 f interpolator now supports %n tokens#2186
Closed
xeno-by wants to merge 1 commit intoscala:masterfrom
xeno-by:ticket/6725
Closed
SI-6725 f interpolator now supports %n tokens#2186xeno-by wants to merge 1 commit intoscala:masterfrom xeno-by:ticket/6725
f interpolator now supports %n tokens#2186xeno-by wants to merge 1 commit intoscala:masterfrom
xeno-by:ticket/6725
Conversation
Currently the `f` interpolator supports format specifiers which specify conversions for formatted arguments. However Java formatting is not limited to argument-related conversions as explained in: http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#detail. Conversions which don't correspond to any arguments are `%` (used to emit verbatim `'%'` characters) and `n` (used to emit platform-specific line separators). Of those only the former is supported, and this patch fixes the oversight.
Contributor
Author
|
review @odersky |
Contributor
|
Probably doesn't need review by odersky, but definitely needs test coverage (and at this point I shouldn't have to tell you that.) |
Contributor
Author
|
Oh! I wanted to mention how important it is to write tests in the hacker guide, which was written around this pull request, but forgot to actually do that... Facepalm! |
Contributor
Author
|
Superseded by #2222 |
eed3si9n
pushed a commit
to eed3si9n/scala
that referenced
this pull request
May 14, 2019
This commit is a very crude port of the classpath handling as it exists in the 2.12.x branch of scalac (hash: 232d95a), this replaces the existing Classpath code that was adapted from scalac years ago. This code was written by Grzegorz Kossakowski, Michał Pociecha, Lukas Rytz, Jason Zaugg and other scalac contributors, many thanks to them! For more information on this implementation, see the description of the PR that originally added it to scalac: scala#4060 Changes made to the copied code to get it to compile with dotty: - Rename scala.tools.nsc.util.ClassPath to dotty.tools.io.ClassPath - Rename scala.tools.nsc.classpath.* to dotty.tools.dotc.classpath.* - Replace "private[nsc]" by "private[dotty]" - Changed `isClass` methods in FileUtils to skip Scala 2.11 implementation classes (needed until we stop being retro-compatible with Scala 2.11) I also copied PlainFile.scala from scalac to get access to `PlainNioFile`.
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
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.
Currently the
finterpolator supports format specifiers whichspecify conversions for formatted arguments. However Java formatting
is not limited to argument-related conversions as explained in:
http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#detail.
Conversions which don't correspond to any arguments are
%(used toemit verbatim
'%'characters) andn(used to emit platform-specificline separators). Of those only the former is supported, and this patch
fixes the oversight.