summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interactive/Global.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-01-28 18:14:42 +0000
committerMartin Odersky <odersky@gmail.com>2011-01-28 18:14:42 +0000
commit0967826371df4675053b94a2857a6d78dd9028ea (patch)
tree63ef0d7552daa068d7aafdeb2b67539616e27f86 /src/compiler/scala/tools/nsc/interactive/Global.scala
parent43d3c0218579e454826e453d03d17df67b75dc61 (diff)
downloadscala-0967826371df4675053b94a2857a6d78dd9028ea.tar.gz
scala-0967826371df4675053b94a2857a6d78dd9028ea.tar.bz2
scala-0967826371df4675053b94a2857a6d78dd9028ea.zip
Eliminated askLastTypeTree.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index 700b2393fe..644d5712ce 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -328,7 +328,7 @@ self =>
for (s <- allSources; unit <- getUnit(s)) {
if (!unit.isUpToDate && unit.status != JustParsed) reset(unit) // reparse previously typechecked units.
- if (unit.status == NotLoaded) parse(unit)
+ if (unit.status == NotLoaded) parseAndEnter(unit)
}
for (s <- allSources; unit <- getUnit(s)) {
@@ -364,7 +364,7 @@ self =>
}
/** Parse unit and create a name index. */
- def parse(unit: RichCompilationUnit): Unit = {
+ def parseAndEnter(unit: RichCompilationUnit): Unit = {
debugLog("parsing: "+unit)
currentTyperRun.compileLate(unit)
if (debugIDE && !reporter.hasErrors) validatePositions(unit.body)
@@ -372,11 +372,14 @@ self =>
unit.status = JustParsed
}
+ @deprecated("use parseTree(unit.source) instead")
+ def parse(unit: RichCompilationUnit) = parseAndEnter(unit)
+
/** Make sure unit is typechecked
*/
def typeCheck(unit: RichCompilationUnit) {
debugLog("type checking: "+unit)
- if (unit.status == NotLoaded) parse(unit)
+ if (unit.status == NotLoaded) parseAndEnter(unit)
unit.status = PartiallyChecked
currentTyperRun.typeCheck(unit)
unit.lastBody = unit.body
@@ -447,7 +450,7 @@ self =>
val unit = new RichCompilationUnit(source)
unitOfFile(source.file) = unit
reset(unit)
- parse(unit)
+ parseAndEnter(unit)
}
/** Make sure a set of compilation units is loaded and parsed */
@@ -518,18 +521,6 @@ self =>
respond(response)(typedTree(source, forceReload))
}
- /** Set sync var `response` to the last fully attributed tree produced from the
- * entire compilation unit */
- def getLastTypedTree(source: SourceFile, response: Response[Tree]) {
- informIDE("getLastTyped" + source)
- respond(response) {
- val unit = getOrCreateUnitOf(source)
- if (unit.status > PartiallyChecked) unit.body
- else if (unit.lastBody ne EmptyTree) unit.lastBody
- else typedTree(source, false)
- }
- }
-
/** Implements CompilerControl.askLinkPos */
def getLinkPos(sym: Symbol, source: SourceFile, response: Response[Position]) {
informIDE("getLinkPos "+sym+" "+source)
@@ -759,7 +750,7 @@ self =>
}
respond(response) {
onUnitOf(source) { unit =>
- if (unit.status == NotLoaded) parse(unit)
+ if (unit.status == NotLoaded) parseAndEnter(unit)
structureTraverser.traverse(unit.body)
val topLevelSyms = structureTraverser.getResult
topLevelSyms foreach forceSym