diff options
author | Denys Shabalin <denys.shabalin@typesafe.com> | 2014-01-22 17:49:26 +0100 |
---|---|---|
committer | Denys Shabalin <denys.shabalin@typesafe.com> | 2014-01-23 13:51:06 +0100 |
commit | ef118b8c86944d6fe3520782335835b9ec96590a (patch) | |
tree | 6acbd702379450a4073ec1aba57d577c4d5408e5 /src/compiler | |
parent | 7a23a908a77e2424c0f951acb3f0de6a0cac454c (diff) | |
download | scala-ef118b8c86944d6fe3520782335835b9ec96590a.tar.gz scala-ef118b8c86944d6fe3520782335835b9ec96590a.tar.bz2 scala-ef118b8c86944d6fe3520782335835b9ec96590a.zip |
Tag synthetic unit with attachment
This makes it easy to differentiate unit inserted by a compiler vs unit
written by the user. Useful for quasiquotes and pretty printing.
Additionally SyntacticBlock extractor is changed to treat EmptyTree as
zero-element block.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala b/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala index 87ab52414c..e0b863b749 100644 --- a/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala +++ b/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala @@ -189,8 +189,8 @@ trait Reifiers { self: Quasiquotes => mirrorBuildCall(nme.SyntacticBlock, tree) case Block(Nil, other) => reifyTree(other) - case Block(stats, last) => - reifyBuildCall(nme.SyntacticBlock, stats :+ last) + case SyntacticBlock(stats) if stats.size > 1 => + reifyBuildCall(nme.SyntacticBlock, stats) case Try(block, catches, finalizer) => reifyBuildCall(nme.SyntacticTry, block, catches, finalizer) case Match(selector, cases) => |