summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McDirmid <sean.mcdirmid@gmail.com>2007-12-24 14:39:04 +0000
committerSean McDirmid <sean.mcdirmid@gmail.com>2007-12-24 14:39:04 +0000
commiteb1e54b1e81207b90392b4e2756d4ed7a5952ab6 (patch)
tree8c508f6848104df5c280ed688aeec4c067e05f96
parent58283d2f54fb3da9deecdd9320fafe301bf1b227 (diff)
downloadscala-eb1e54b1e81207b90392b4e2756d4ed7a5952ab6.tar.gz
scala-eb1e54b1e81207b90392b4e2756d4ed7a5952ab6.tar.bz2
scala-eb1e54b1e81207b90392b4e2756d4ed7a5952ab6.zip
surgically fixing a broken build.
-rw-r--r--src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala23
-rw-r--r--src/compiler/scala/tools/nsc/symtab/SymbolTable.scala10
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Symbols.scala2
3 files changed, 12 insertions, 23 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
index 680eedd14c..39c16827c8 100644
--- a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
+++ b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
@@ -107,15 +107,10 @@ abstract class SymbolLoaders {
pkg.setInfo(pkg.moduleClass.tpe)
root.info.decls.enter(pkg)
}
-
// @return - the symbol of the class
def enterClassAndModule(name: String, completer: SymbolLoader): Symbol = {
val owner = if (root.isRoot) definitions.EmptyPackageClass else root
val className = newTermName(name)
- if (inIDE && owner.info.decls.lookup(name) != NoSymbol) {
- // refresh
- return owner.info.decls.lookup(name)
- }
assert(owner.info.decls.lookup(name) == NoSymbol, owner.fullNameString + "." + name)
val clazz = owner.newClass(NoPosition, name.toTypeName)
val module = owner.newModule(NoPosition, name)
@@ -124,13 +119,8 @@ abstract class SymbolLoaders {
module.moduleClass setInfo moduleClassLoader
owner.info.decls enter clazz
owner.info.decls enter module
-// if (completer.sourceFile != null) {
-// clazz.sourceFile = completer.sourceFile;
-// module.moduleClass.sourceFile = completer.sourceFile
-// }
assert(clazz.linkedModuleOfClass == module, module)
assert(module.linkedClassOfModule == clazz, clazz)
- //System.out.println("Added class " + clazz.fullNameString);
clazz
}
def checkAdd(name0 : String) = {
@@ -195,7 +185,6 @@ abstract class SymbolLoaders {
}
enterClassAndModule(name, loader)
}
-
for ((name, file) <- packages.elements)
enterPackage(name, newPackageLoader(file))
}
@@ -254,14 +243,13 @@ abstract class SymbolLoaders {
val global: SymbolLoaders.this.global.type = SymbolLoaders.this.global
}
protected def doComplete(root: Symbol) {
- typeParser.parse(typ, root)
+ typeParser.parse(typ, root) // don't check this
}
protected def kindString: String = typ.FullName
protected def sourceString = typ.Assembly.FullName
}
// IDE hook.
- protected def completeClassfile(root: Symbol, loader: ClassfileLoader)(f: => Unit): Unit = f
- protected def completeSourcefile(root: Symbol, loader: SourcefileLoader)(f: => Unit): Unit = f
+ protected def completeClassfile(root : Symbol, loader : ClassfileLoader)(f : => Unit) : Unit = f
class ClassfileLoader(val classFile: AbstractFile, override val sourceFile: AbstractFile, sourcePath0: AbstractFile) extends SymbolLoader {
if (sourcePath0 == null) {
@@ -285,18 +273,13 @@ abstract class SymbolLoaders {
global.attachSourceToClass(module, this, if (sourceFile ne null) sourceFile else clazz.sourceFile)
case _ =>
}
- if (root.sourceFile ne null) {
- //global.generateIdeMaps.sourceFiles(root.sourceFile) = classFile.container
- }
}
protected def kindString: String = "class file"
protected def sourceString = classFile.toString()
}
class SourcefileLoader(override val sourceFile: AbstractFile) extends SymbolLoader {
- protected def doComplete(root: Symbol): Unit = completeSourcefile(root, this) {
- global.currentRun compileLate sourceFile
- }
+ protected def doComplete(root: Symbol): Unit = global.currentRun.compileLate(sourceFile)
protected def kindString: String = "source file"
protected def sourceString = sourceFile.toString()
}
diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala b/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala
index e02e16d0aa..d73429a49d 100644
--- a/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala
+++ b/src/compiler/scala/tools/nsc/symtab/SymbolTable.scala
@@ -32,9 +32,15 @@ abstract class SymbolTable extends Names
def forMSIL: Boolean
/** are we in a lampion presentation compiler? cannot get inIDE flag from global */
- def inIDE : Boolean
+ def inIDE : Boolean = false
protected def trackTypeIDE(sym : Symbol) : Boolean = true
- protected def recycle(sym : Symbol) : Symbol = sym
+ def compare(sym : Symbol, name : Name) = sym.name == name
+ def verifyAndPrioritize[T](g : Symbol => Symbol)(pt : Type)(f : => T) = f
+ def trackSetInfo[T <: Symbol](sym : T)(info : Type) : T = {
+ sym.setInfo(info); sym
+ }
+ def notifyImport(what : Name, container : Type, from : Name, to : Name) : Unit = {}
+ def sanitize(tree : Tree) : Tree = tree
/** A period is an ordinal number for a phase in a run.
* Phases in later runs have higher periods than phases in earlier runs.
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
index 1d469a9f6d..5bec708d45 100644
--- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
@@ -516,7 +516,7 @@ trait Symbols {
val curPeriod = currentPeriod
val curPid = phaseId(curPeriod)
- if (!inIDE && validTo != NoPeriod) {
+ if (!inIDE && validTo != NoPeriod) { // IDE doesn't adapt.
// skip any infos that concern later phases
while (curPid < phaseId(infos.validFrom) && infos.prev != null)