diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-12-29 05:12:43 -0800 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-12-29 05:12:43 -0800 |
commit | 58e3daf6a81300422ad18988848b4c160682bdb6 (patch) | |
tree | 3e8f9e7f6054a5d88b49dbe69831eabf14c5da0a | |
parent | b7840d6b41db910111d73e307c70d32fef0fcee1 (diff) | |
parent | 2d612c38df4ecc4ad82ae26858de9e34ce66fcee (diff) | |
download | scala-58e3daf6a81300422ad18988848b4c160682bdb6.tar.gz scala-58e3daf6a81300422ad18988848b4c160682bdb6.tar.bz2 scala-58e3daf6a81300422ad18988848b4c160682bdb6.zip |
Merge pull request #1811 from scalamacros/topic/tree-nonempty
adds Tree.nonEmpty
-rw-r--r-- | src/reflect/scala/reflect/api/Trees.scala | 6 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Trees.scala | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/api/Trees.scala b/src/reflect/scala/reflect/api/Trees.scala index cfa6315797..e4ee048f84 100644 --- a/src/reflect/scala/reflect/api/Trees.scala +++ b/src/reflect/scala/reflect/api/Trees.scala @@ -89,6 +89,12 @@ trait Trees { self: Universe => */ def isEmpty: Boolean + /** Is this tree one of the empty trees? + * + * @see `isEmpty` + */ + def nonEmpty: Boolean + /** Can this tree carry attributes (i.e. symbols, types or positions)? * Typically the answer is yes, except for the `EmptyTree` null object and * two special singletons: `emptyValDef` and `pendingSuperCall`. diff --git a/src/reflect/scala/reflect/internal/Trees.scala b/src/reflect/scala/reflect/internal/Trees.scala index 9e737528d2..4dad3dd37a 100644 --- a/src/reflect/scala/reflect/internal/Trees.scala +++ b/src/reflect/scala/reflect/internal/Trees.scala @@ -39,6 +39,8 @@ trait Trees extends api.Trees { self: SymbolTable => def isDef = false def isEmpty = false + def nonEmpty = !isEmpty + def canHaveAttrs = true /** The canonical way to test if a Tree represents a term. |