diff options
author | Paul Phillips <paulp@improving.org> | 2013-03-12 19:13:03 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-03-12 19:13:03 -0700 |
commit | 5f4039f83ea27ed1da88146dc2ffab3d8dd11b29 (patch) | |
tree | c39f2cacf6e8e565835b810ca16b01893c329989 /src/compiler | |
parent | ccd1bc082630a3c4b4cfe2e64689b9e316ad8714 (diff) | |
parent | 9bc17e7779f878f17b97130359940b0d0b30f243 (diff) | |
download | scala-5f4039f83ea27ed1da88146dc2ffab3d8dd11b29.tar.gz scala-5f4039f83ea27ed1da88146dc2ffab3d8dd11b29.tar.bz2 scala-5f4039f83ea27ed1da88146dc2ffab3d8dd11b29.zip |
Merge pull request #2222 from scalamacros/ticket/6725
SI-6725 `f` interpolator now supports %n tokens
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/reflect/MacroImplementations.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/reflect/MacroImplementations.scala b/src/compiler/scala/tools/reflect/MacroImplementations.scala index 86cd845c54..ae13cc561f 100644 --- a/src/compiler/scala/tools/reflect/MacroImplementations.scala +++ b/src/compiler/scala/tools/reflect/MacroImplementations.scala @@ -118,7 +118,8 @@ abstract class MacroImplementations { if (!strIsEmpty) { val len = str.length while (idx < len) { - if (str(idx) == '%') { + def notPercentN = str(idx) != '%' || (idx + 1 < len && str(idx + 1) != 'n') + if (str(idx) == '%' && notPercentN) { bldr append (str substring (start, idx)) append "%%" start = idx + 1 } |