diff options
author | buraq <buraq@epfl.ch> | 2003-07-16 12:21:58 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-07-16 12:21:58 +0000 |
commit | a5fdf3ec18bcbbe0fbc521e1820c2d7be49d4a6c (patch) | |
tree | cdcf1f64dc8e7237c159eaef8aca7ae698070da5 /sources | |
parent | e00deae3e5e84f1f63b8693b64e25ed2ee62ae07 (diff) | |
download | scala-a5fdf3ec18bcbbe0fbc521e1820c2d7be49d4a6c.tar.gz scala-a5fdf3ec18bcbbe0fbc521e1820c2d7be49d4a6c.tar.bz2 scala-a5fdf3ec18bcbbe0fbc521e1820c2d7be49d4a6c.zip |
added "isEmptySequence" method
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/ast/TreeInfo.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sources/scalac/ast/TreeInfo.java b/sources/scalac/ast/TreeInfo.java index 9721afb447..7a0618c6b8 100644 --- a/sources/scalac/ast/TreeInfo.java +++ b/sources/scalac/ast/TreeInfo.java @@ -196,6 +196,19 @@ public class TreeInfo { } } + /** returns true if the argument is an empty sequence pattern + */ + public static boolean isEmptySequence( Tree tree ) { + switch( tree ) { + case Sequence( Tree ts[] ): + return ( ts.length == 0 ); + default: + return false; + } + } + + /** returns true if the argument is a wildcard pattern + */ public static boolean isWildcardPattern( Tree tree ) { switch( tree ) { case Ident( Name n ): |