Skip to content

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#2186
xeno-by wants to merge 1 commit intoscala:masterfrom
xeno-by:ticket/6725

Conversation

@xeno-by
Copy link
Contributor

@xeno-by xeno-by commented Mar 1, 2013

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.

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.
@xeno-by
Copy link
Contributor Author

xeno-by commented Mar 1, 2013

review @odersky

@ghost ghost assigned odersky Mar 1, 2013
@paulp
Copy link
Contributor

paulp commented Mar 5, 2013

Probably doesn't need review by odersky, but definitely needs test coverage (and at this point I shouldn't have to tell you that.)

@xeno-by
Copy link
Contributor Author

xeno-by commented Mar 5, 2013

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!

@xeno-by
Copy link
Contributor Author

xeno-by commented Mar 9, 2013

Superseded by #2222

@xeno-by xeno-by closed this Mar 9, 2013
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`.
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.

3 participants