Skip to content

SI-6725 f interpolator now supports %n tokens#2222

Merged
paulp merged 1 commit intoscala:2.10.xfrom
scalamacros:ticket/6725
Mar 13, 2013
Merged

SI-6725 f interpolator now supports %n tokens#2222
paulp merged 1 commit intoscala:2.10.xfrom
scalamacros:ticket/6725

Conversation

@xeno-by
Copy link
Contributor

@xeno-by xeno-by commented Mar 9, 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 9, 2013

review @paulp

@ghost ghost assigned paulp Mar 12, 2013
@paulp
Copy link
Contributor

paulp commented Mar 13, 2013

LGTM

paulp added a commit that referenced this pull request Mar 13, 2013
SI-6725 `f` interpolator now supports %n tokens
@paulp paulp merged commit 5f4039f into scala:2.10.x Mar 13, 2013
@retronym
Copy link
Member

@xeno-by Could you please submit a followup that shows this working in the JavaDoc for f, and in the String Interpolation guide on docs.scala-lang.org? In the guide, we should mention that it only works from Scala 2.10.2 onwards.

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