summaryrefslogtreecommitdiff
path: root/sources/scalac/ast
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-04-11 08:29:13 +0000
committerpaltherr <paltherr@epfl.ch>2003-04-11 08:29:13 +0000
commit009ca753a54bf55d67598831f2133f7b043cc160 (patch)
treedb4032c5dcdea27037f4cc02d856a020a77d2dd9 /sources/scalac/ast
parent5557a63792662299fed82e7e68ca6fab09458401 (diff)
downloadscala-009ca753a54bf55d67598831f2133f7b043cc160.tar.gz
scala-009ca753a54bf55d67598831f2133f7b043cc160.tar.bz2
scala-009ca753a54bf55d67598831f2133f7b043cc160.zip
- Moved EMPTY_ARRAY constant from Ext classes t...
- Moved EMPTY_ARRAY constant from Ext classes to class Tree.
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r--sources/scalac/ast/Tree.java10
-rw-r--r--sources/scalac/ast/parser/Parser.java6
2 files changed, 7 insertions, 9 deletions
diff --git a/sources/scalac/ast/Tree.java b/sources/scalac/ast/Tree.java
index a3cc94cf3e..ae166080d0 100644
--- a/sources/scalac/ast/Tree.java
+++ b/sources/scalac/ast/Tree.java
@@ -29,6 +29,10 @@ public class Tree {
/** Empty tree array */
public static final Tree[] EMPTY_ARRAY = new Tree[0];
+ public static final ValDef[] ValDef_EMPTY_ARRAY = new ValDef[0];
+ public static final ValDef[][] ValDef_EMPTY_ARRAY_ARRAY = new ValDef[0][];
+ public static final TypeDef[] TypeDef_EMPTY_ARRAY = new TypeDef[0];
+ public static final CaseDef[] CaseDef_EMPTY_ARRAY = new CaseDef[0];
//########################################################################
// Public Cases
@@ -691,10 +695,6 @@ public class Tree {
}
public static class ExtValDef extends ValDef {
-
- public static final ValDef[] EMPTY_ARRAY = new ValDef[0];
- public static final ValDef[][] EMPTY_ARRAY_ARRAY = new ValDef[0][0];
-
private Symbol symbol;
public ExtValDef(int mods, Name name, Tree tpe, Tree rhs)
@@ -750,8 +750,6 @@ public class Tree {
public static class ExtTypeDef extends TypeDef {
private Symbol symbol;
- public static final TypeDef[] EMPTY_ARRAY = new TypeDef[0];
-
public ExtTypeDef(int mods, Name name, Tree rhs)
{
super(mods, name, rhs);
diff --git a/sources/scalac/ast/parser/Parser.java b/sources/scalac/ast/parser/Parser.java
index 771979fcda..0a58f28dcd 100644
--- a/sources/scalac/ast/parser/Parser.java
+++ b/sources/scalac/ast/parser/Parser.java
@@ -257,10 +257,10 @@ public class Parser implements Tokens {
case Typed(Ident(_), _):
return new ValDef[]{convertToParam(t)};
case Block(Tree[] stats):
- if (stats.length == 0) return Tree.ExtValDef.EMPTY_ARRAY;
+ if (stats.length == 0) return Tree.ValDef_EMPTY_ARRAY;
}
syntaxError(t.pos, "malformed formal parameter list", false);
- return Tree.ExtValDef.EMPTY_ARRAY;
+ return Tree.ValDef_EMPTY_ARRAY;
}
/** Convert list of trees to formal parameter list
@@ -1512,7 +1512,7 @@ public class Parser implements Tokens {
Name name = ident();
TypeDef[] tparams = typeParamClauseOpt();
ValDef[][] params = (s.token == LPAREN) ? new ValDef[][]{paramClause()}
- : Tree.ExtValDef.EMPTY_ARRAY_ARRAY;
+ : Tree.ValDef_EMPTY_ARRAY_ARRAY;
return make.ClassDef(pos, mods, name.toTypeName(), tparams, params,
simpleTypedOpt(), classTemplate());
}