From a5fdf3ec18bcbbe0fbc521e1820c2d7be49d4a6c Mon Sep 17 00:00:00 2001 From: buraq Date: Wed, 16 Jul 2003 12:21:58 +0000 Subject: added "isEmptySequence" method --- sources/scalac/ast/TreeInfo.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sources/scalac/ast/TreeInfo.java') 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 ): -- cgit v1.2.3