summaryrefslogtreecommitdiff
path: root/sources/scalac/ast
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-09-07 19:03:19 +0000
committerpaltherr <paltherr@epfl.ch>2003-09-07 19:03:19 +0000
commita9af998cdc3175c764fa0f17d276dfd96dfe1579 (patch)
treec73529a3df070b105d4a77c282c10fd62005e0ff /sources/scalac/ast
parent70d78cbfc802ccc49d5d324755865ff07985dfef (diff)
downloadscala-a9af998cdc3175c764fa0f17d276dfd96dfe1579.tar.gz
scala-a9af998cdc3175c764fa0f17d276dfd96dfe1579.tar.bz2
scala-a9af998cdc3175c764fa0f17d276dfd96dfe1579.zip
- Added concat methods
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r--sources/scalac/ast/Tree.java.tmpl9
1 files changed, 9 insertions, 0 deletions
diff --git a/sources/scalac/ast/Tree.java.tmpl b/sources/scalac/ast/Tree.java.tmpl
index ca2f06242a..e39768b597 100644
--- a/sources/scalac/ast/Tree.java.tmpl
+++ b/sources/scalac/ast/Tree.java.tmpl
@@ -165,6 +165,15 @@ public class Tree {
return clone;
}
+ /** Returns the concatenation of the two arrays. */
+ public static Tree[] concat(Tree[] array1, Tree[] array2) {
+ if (array1.length == 0) return array2;
+ if (array2.length == 0) return array1;
+ Tree[] clone = cloneArray(array1.length, array2);
+ for (int i = 0; i < array1.length; i++) clone[i] = array1[i];
+ return clone;
+ }
+
public Tree duplicate() {
return duplicator.transform(this);
}