diff options
author | michelou <michelou@epfl.ch> | 2003-09-02 16:06:30 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2003-09-02 16:06:30 +0000 |
commit | 513514d066e5cf24d052a5e9558e1b1cb83e1392 (patch) | |
tree | 0316abe03ce6d7f3e10034acff507f8c38075042 /sources/scalac/CompilerPhases.java | |
parent | 69d4d1a11836b0843bf55fd57d3f3ae16cd2fc5b (diff) | |
download | scala-513514d066e5cf24d052a5e9558e1b1cb83e1392.tar.gz scala-513514d066e5cf24d052a5e9558e1b1cb83e1392.tar.bz2 scala-513514d066e5cf24d052a5e9558e1b1cb83e1392.zip |
-- methods InsertBefore and InsertAfter now ret...
-- methods InsertBefore and InsertAfter now return the insertion
position
Diffstat (limited to 'sources/scalac/CompilerPhases.java')
-rw-r--r-- | sources/scalac/CompilerPhases.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sources/scalac/CompilerPhases.java b/sources/scalac/CompilerPhases.java index 923d436605..c78bbeabcf 100644 --- a/sources/scalac/CompilerPhases.java +++ b/sources/scalac/CompilerPhases.java @@ -8,8 +8,8 @@ package scalac; -import java.util.List; import java.util.ArrayList; +import java.util.List; /** * This class defines all compiler phases and maintains a list of @@ -170,17 +170,19 @@ public class CompilerPhases { } /** Activates phase "phase" by placing it before phase "where". */ - public void insertBefore(PhaseDescriptor phase, PhaseDescriptor where) { + public int insertBefore(PhaseDescriptor phase, PhaseDescriptor where) { int index = phases.indexOf(where); assert index >= 0 : "could not find phase " + where; phases.add(index, phase); + return index; } /** Activates phase "phase" by placing it after phase "where". */ - public void insertAfter(PhaseDescriptor phase, PhaseDescriptor where) { + public int insertAfter(PhaseDescriptor phase, PhaseDescriptor where) { int index = phases.indexOf(where); assert index >= 0 : "could not find phase " + where; phases.add(index + 1, phase); + return index + 1; } //######################################################################## |