summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-03-12 19:13:03 -0700
committerPaul Phillips <paulp@improving.org>2013-03-12 19:13:03 -0700
commit5f4039f83ea27ed1da88146dc2ffab3d8dd11b29 (patch)
treec39f2cacf6e8e565835b810ca16b01893c329989 /src
parentccd1bc082630a3c4b4cfe2e64689b9e316ad8714 (diff)
parent9bc17e7779f878f17b97130359940b0d0b30f243 (diff)
downloadscala-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')
-rw-r--r--src/compiler/scala/tools/reflect/MacroImplementations.scala3
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
}