diff options
author | Sean McDirmid <sean.mcdirmid@gmail.com> | 2006-01-13 15:18:24 +0000 |
---|---|---|
committer | Sean McDirmid <sean.mcdirmid@gmail.com> | 2006-01-13 15:18:24 +0000 |
commit | 18e106e8d06e0ef3ead33db966675e723983805a (patch) | |
tree | 4e63866019439fcdaa8784e6a00dc7aa0a7bd2fb /src/compiler/scala/tools/nsc/Global.scala | |
parent | eb15d28974978c333433a432629cfa71772cf24a (diff) | |
download | scala-18e106e8d06e0ef3ead33db966675e723983805a.tar.gz scala-18e106e8d06e0ef3ead33db966675e723983805a.tar.bz2 scala-18e106e8d06e0ef3ead33db966675e723983805a.zip |
Tried to fix sourcepath, but they still have so...
Tried to fix sourcepath, but they still have some issues that need to be
resolved deeper inside the compiler.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index c7a4b2926b..a7d9fd779a 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -14,6 +14,7 @@ import scala.tools.nsc.reporters._; import scala.collection.mutable.{HashSet,HashMap,ListBuffer} + import symtab._; import symtab.classfile.{PickleBuffer, Pickler}; import util.Statistics; @@ -26,11 +27,13 @@ import backend.icode.{ICodes, GenICode, Checkers}; import backend.ScalaPrimitives; import backend.jvm.GenJVM; + class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable with Trees with CompilationUnits { + // sub-components -------------------------------------------------- object treePrinters extends TreePrinters { @@ -84,7 +87,6 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable def inform(msg: String) = System.err.println(msg); //reporter.info(null, msg, true); - def informProgress(msg: String) = if (settings.verbose.value) inform("[" + msg + "]"); @@ -139,13 +141,10 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable } def getSourceFile(clazz: Symbol): SourceFile = { - val f = classPath.output.source.location. - /* val f = classPath.getRoot(). */ - lookupPath( - clazz.fullNameString(File.separatorChar) + ".scala", false); - if (f == null) throw new FileNotFoundException( - "source file for " + clazz + " could not be found"); - getSourceFile(f) + val ret = classPath.root.find(clazz.fullNameString(File.separatorChar), false); + if (ret.sources.isEmpty) throw new FileNotFoundException( + "source file for " + clazz + " could not be found"); + getSourceFile(ret.sources.head.location); } object loaders extends SymbolLoaders { @@ -312,9 +311,9 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable stopped = settings.stop contains pd.phaseName; } } - // progress tracking def progress(current : Int, total : Int) : Unit = {} + private var phasec : Int = 0; private var unitc : Int = 0; def advancePhase : Unit = { @@ -458,6 +457,7 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable } } + def showDef(name: Name, module: boolean): unit = { def getSym(name: Name, module: boolean): Symbol = { var i = name.length - 1; |