diff options
author | Denys Shabalin <denys.shabalin@typesafe.com> | 2014-02-19 17:20:35 +0100 |
---|---|---|
committer | Denys Shabalin <denys.shabalin@typesafe.com> | 2014-02-20 13:17:12 +0100 |
commit | d49c09e3f67d780d2757085e02b0a28d333527c4 (patch) | |
tree | c4263bd1a011e8d2c955efb550d91446b6c7bffc /src/compiler/scala/tools/reflect/quasiquotes/Placeholders.scala | |
parent | 3973f29cec9f06724941b68577908f546341c45e (diff) | |
download | scala-d49c09e3f67d780d2757085e02b0a28d333527c4.tar.gz scala-d49c09e3f67d780d2757085e02b0a28d333527c4.tar.bz2 scala-d49c09e3f67d780d2757085e02b0a28d333527c4.zip |
Fix quasiquote terminology to be consistent with Scheme
1. Rename cardinality into rank. Shorter word, easier to
understand, more appropriate in our context.
2. Previously we called any dollar substitution splicing
but this is not consistent with Scheme where splicing
is substitution with non-zero rank.
So now $foo is unquoting and ..$foo and ...$foo is
unquote splicing or just splicing. Correspondingly
splicee becomes unquotee.
3. Rename si7980 test into t7980
Diffstat (limited to 'src/compiler/scala/tools/reflect/quasiquotes/Placeholders.scala')
-rw-r--r-- | src/compiler/scala/tools/reflect/quasiquotes/Placeholders.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/reflect/quasiquotes/Placeholders.scala b/src/compiler/scala/tools/reflect/quasiquotes/Placeholders.scala index e7730f878f..5986758c2b 100644 --- a/src/compiler/scala/tools/reflect/quasiquotes/Placeholders.scala +++ b/src/compiler/scala/tools/reflect/quasiquotes/Placeholders.scala @@ -12,7 +12,7 @@ import scala.collection.{immutable, mutable} */ trait Placeholders { self: Quasiquotes => import global._ - import Cardinality._ + import Rank._ import universeTypes._ // Step 1: Transform Scala source with holes into vanilla Scala source @@ -29,13 +29,13 @@ trait Placeholders { self: Quasiquotes => posMap += pos -> ((start, end)) } - def appendHole(tree: Tree, cardinality: Cardinality) = { + def appendHole(tree: Tree, rank: Rank) = { val placeholderName = c.freshName(TermName(nme.QUASIQUOTE_PREFIX + sessionSuffix)) sb.append(placeholderName) val holeTree = if (method != nme.unapply) tree else Bind(placeholderName, tree) - holeMap(placeholderName) = Hole(cardinality, holeTree) + holeMap(placeholderName) = Hole(rank, holeTree) } val iargs = method match { @@ -47,9 +47,9 @@ trait Placeholders { self: Quasiquotes => } foreach2(iargs, parts.init) { case (tree, (p, pos)) => - val (part, cardinality) = parseDots(p) + val (part, rank) = parseDots(p) appendPart(part, pos) - appendHole(tree, cardinality) + appendHole(tree, rank) } val (p, pos) = parts.last appendPart(p, pos) |