From 8341c5c36e88000e24bfd26d62c98805fc96fdcf Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 21 Aug 2003 09:44:58 +0000 Subject: *** empty log message *** --- sources/scalac/ast/TreeInfo.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'sources/scalac/ast/TreeInfo.java') diff --git a/sources/scalac/ast/TreeInfo.java b/sources/scalac/ast/TreeInfo.java index fc12935250..19b2341f44 100644 --- a/sources/scalac/ast/TreeInfo.java +++ b/sources/scalac/ast/TreeInfo.java @@ -127,6 +127,21 @@ public class TreeInfo { } } + /** Is tree a self constructor call? + */ + public static boolean isSelfConstrCall(Tree tree) { + switch (tree) { + case Ident(Name name): + return name == Names.CONSTRUCTOR; + case TypeApply(Tree constr, _): + return isSelfConstrCall(constr); + case Apply(Tree constr, _): + return isSelfConstrCall(constr); + default: + return false; + } + } + /** Is tree a variable pattern */ public static boolean isVarPattern(Tree pat) { -- cgit v1.2.3