diff options
Diffstat (limited to 'sources/scalac/ast/TreeInfo.java')
-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 ): |