Skip to content

Commit

Permalink
Removed previosuly uncommented code, added more diagnosis output to R…
Browse files Browse the repository at this point in the history
…EPL.

(cherry picked from commit bcf1d9a)
  • Loading branch information
odersky authored and dragos committed Sep 5, 2012
1 parent 321d3f5 commit e8e07aa
Showing 1 changed file with 1 addition and 45 deletions.
46 changes: 1 addition & 45 deletions src/compiler/scala/tools/nsc/interactive/REPL.scala
Expand Up @@ -129,50 +129,6 @@ object REPL {
iSourceName
}

/** Compile instrumented source file
* @param iSourceName The name of the instrumented source file
* @param arguments Further argumenrs to pass to the compiler
* @return Optionallu, if no -d option is given, the virtual directory
* contained the generated bytecode classes
def compileInstrumented(iSourceName: String, arguments: List[String]): Option[AbstractFile] = {
println("compiling "+iSourceName)
val command = new CompilerCommand(iSourceName :: arguments, reporter.error(scala.reflect.internal.util.NoPosition, _))
val virtualDirectoryOpt =
if (arguments contains "-d")
None
else {
val vdir = new VirtualDirectory("(memory)", None)
command.settings.outputDirs setSingleOutput vdir
Some(vdir)
}
val compiler = new scala.tools.nsc.Global(command.settings, reporter)
val run = new compiler.Run()
println("compiling: "+command.files)
run compile command.files
virtualDirectoryOpt
}
/** Run instrumented bytecode file
* @param vdir Optionally, the virtual directory containing the generated bytecode classes
* @param iFullName The full name of the generated object
* @param stripped The contents original source file without any right hand column comments.
* @return The generated file content containing original source in the left column
* and outputs in the right column
*/
def runInstrumented(vdirOpt: Option[AbstractFile], iFullName: String, stripped: Array[Char]): Array[Char] = {
val defaultClassLoader = getClass.getClassLoader
val classLoader = vdirOpt match {
case Some(vdir) => new AbstractFileClassLoader(vdir, defaultClassLoader)
case None => defaultClassLoader
}
println("running "+iFullName)
val si = new SourceInserter(stripped)
Executor.execute(iFullName, si, classLoader)
println("done")
si.currentContents
}
*/

/** The method for implementing worksheet functionality.
* @param arguments a file name, followed by optional command line arguments that are passed
* to the compiler that processes the instrumented source.
Expand All @@ -187,7 +143,7 @@ object REPL {
// strip right hand side comment column and any trailing spaces from all lines
val strippedContents = SourceInserter.stripRight(source.content)
val strippedSource = new BatchSourceFile(source.file, strippedContents)
println("stripped source = "+strippedSource)
println("stripped source = "+strippedSource+":"+strippedContents.mkString)
comp.askReload(List(strippedSource), reloadResult)
comp.askInstrumented(strippedSource, line, instrumentedResult)
using(instrumentedResult) {
Expand Down

0 comments on commit e8e07aa

Please sign in to comment.