diff options
author | paltherr <paltherr@epfl.ch> | 2004-03-21 17:48:43 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-03-21 17:48:43 +0000 |
commit | 430c5dbe56f5826a2b26a386e4f1f55d3bc835b7 (patch) | |
tree | 153fbe83f79b849557994bff017ea9be68776c2b /sources/scalac/symtab/SourceCompleter.java | |
parent | 61bf0c8f1d9ffb90f0fa543f5f654a08bfc365e0 (diff) | |
download | scala-430c5dbe56f5826a2b26a386e4f1f55d3bc835b7.tar.gz scala-430c5dbe56f5826a2b26a386e4f1f55d3bc835b7.tar.bz2 scala-430c5dbe56f5826a2b26a386e4f1f55d3bc835b7.zip |
- Avoided recomputations of files that are alre...
- Avoided recomputations of files that are already done in PackageParser
Diffstat (limited to 'sources/scalac/symtab/SourceCompleter.java')
-rw-r--r-- | sources/scalac/symtab/SourceCompleter.java | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/sources/scalac/symtab/SourceCompleter.java b/sources/scalac/symtab/SourceCompleter.java index b9456a4b10..fa6157ea14 100644 --- a/sources/scalac/symtab/SourceCompleter.java +++ b/sources/scalac/symtab/SourceCompleter.java @@ -8,28 +8,39 @@ package scalac.symtab; -import scala.tools.util.AbstractFile; -import scala.tools.util.SourceFile; +import java.io.IOException; -import scalac.*; -import scalac.ast.parser.*; -import scalac.typechecker.AnalyzerPhase; -import scalac.util.SourceRepresentation; -import java.io.*; +import scala.tools.util.AbstractFile; +import scalac.Global; +import scalac.symtab.Symbol; +/** This class implements a SymbolLoader that reads a source file. */ public class SourceCompleter extends SymbolLoader { - public SourceCompleter(Global global) { + //######################################################################## + // Private Fields + + /** The source file to read */ + private final AbstractFile file; + + //######################################################################## + // Public Constructors + + /** Initializes this instance with the specified source file. */ + public SourceCompleter(Global global, AbstractFile file) { super(global); + this.file = file; } - /** complete class symbol c by loading the unit - */ - public String doComplete(Symbol clasz) throws IOException { - SourceFile source = global.getSourceFile(clasz); - global.compileLate(source, false); - return "source file '" + source + "'"; + //######################################################################## + // Protected Methods + + /** Completes the specified symbol by reading the source file. */ + protected String doComplete(Symbol clasz) throws IOException { + global.compileLate(global.getSourceFile(file), false); + return "source file '" + file + "'"; } + //######################################################################## } |