Packages

class ILoop extends LoopCommands

The Scala interactive shell. This part provides the user interface, with evaluation and auto-complete handled by IMain.

There should be no direct dependency of this code on the compiler; it should all go through the intp reference to the interpreter, or maybe eventually even over the wire to a remote compiler.

Source
ILoop.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ILoop
  2. LoopCommands
  3. AnyRef
  4. Any
Implicitly
  1. by loopToInterpreter
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ILoop(config: ShellConfig, inOverride: BufferedReader = null, out: PrintWriter = new PrintWriter(Console.out, true))

Type Members

  1. class LineCmd extends LoopCommand
    Definition Classes
    LoopCommands
  2. abstract class LoopCommand extends (String) => Result
    Definition Classes
    LoopCommands
  3. class NullaryCmd extends LoopCommand
    Definition Classes
    LoopCommands
  4. case class Result(keepRunning: Boolean, lineToRecord: Option[String]) extends Product with Serializable
    Definition Classes
    LoopCommands
  5. class VarArgsCmd extends LoopCommand
    Definition Classes
    LoopCommands

Value Members

  1. def Repl(config: ShellConfig, interpreterSettings: Settings, out: PrintWriter): IMain
  2. def addReplay(cmd: String): Unit

    Record a command for replay should the user request a :replay

  3. def addUrlsToClassPath(urls: URL*): Unit

    Adds all specified jars to the compile and runtime classpaths.

    Adds all specified jars to the compile and runtime classpaths.

    urls

    The list of items to add to the compile and runtime classpaths.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
    Note

    Currently only supports jars, not directories.

  4. def ambiguousError(cmd: String): Result
    Definition Classes
    LoopCommands
  5. def asyncEcho(async: Boolean, msg: => String): Unit
  6. final def beQuietDuring(body: => Unit): Unit

    The reporter will not print results during execution of body.

    The reporter will not print results during execution of body.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    ReplReplCore
  7. def bind(p: NamedParam): Results.Result
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  8. def bind(name: String, boundType: String, value: Any, modifiers: List[String] = Nil): Results.Result

    Bind a specified name to a specified value.

    Bind a specified name to a specified value. The name may later be used by expressions passed to interpret.

    name

    the variable name to bind

    boundType

    the type of the variable, as a string

    value

    the object value to bind to it

    returns

    an indication of whether the binding succeeded

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    ReplCore
  9. def bindValue(name: String, value: Any): Results.Result

    Bind a specified name to a specified value.

    Bind a specified name to a specified value. The type is derived from the run-time class of the value.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    ReplCore
  10. def classLoader: AbstractFileClassLoader
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  11. def classPathString: String
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  12. def clearExecutionWrapper(): Unit
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  13. def close(): Unit

    This instance is no longer needed, so release any resources it is using.

    This instance is no longer needed, so release any resources it is using. The reporter's output gets flushed.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  14. def closeInterpreter(): Unit

    Close the interpreter and set the var to null.

    Close the interpreter and set the var to null.

    Used by sbt.

  15. def colonCommand(line: String): Result
    Definition Classes
    LoopCommands
  16. def colonCompletion(line: String, cursor: Int): Completion
    Definition Classes
    LoopCommands
  17. def command(line: String): Result
  18. def commands: List[LoopCommand]

    Available commands

    Available commands

    Definition Classes
    ILoopLoopCommands
  19. def compileSources(sources: SourceFile*): Boolean

    Compile an nsc SourceFile.

    Compile an nsc SourceFile. Returns true if there are no compilation errors, or false otherwise.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  20. def compileString(code: String): Boolean

    Compile a string.

    Compile a string. Returns true if there are no compilation errors, or false otherwise.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  21. def compilerClasspath: Seq[URL]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  22. def completion(accumulator: Accumulator = new Accumulator): MultiCompletion
  23. def completionsCommand(what: String): Result
  24. def createInterpreter(interpreterSettings: Settings): Unit

    Create a new interpreter.

    Create a new interpreter.

    Used by sbt.

  25. def definedTypes: List[String]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  26. def echoCommandMessage(msg: String): Unit
    Definition Classes
    ILoopLoopCommands
  27. def echoOff[A](op: => A): A
  28. def editCommand(what: String, editor: Option[String]): Result
  29. def editCommand(what: String): Result
  30. def enablePowerMode(isDuringInit: Boolean): Unit
  31. val fileCompletion: Completion
  32. def helpCommand(line: String): Result

    print a friendly help message

    print a friendly help message

    Definition Classes
    LoopCommands
  33. def helpSummary(): Unit
    Definition Classes
    LoopCommands
  34. def history: History
  35. lazy val historyCommand: LoopCommand { def defaultLines: Int }

    Show the history

  36. def implicitsCommandInternal(line: String): (List[String], String)
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  37. def importsCommandInternal(tokens: List[String]): List[String]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  38. def initializeCompiler(): Boolean
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  39. def initializeComplete: Boolean
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  40. def interpret(line: String, synthetic: Boolean): Results.Result
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  41. def interpret(line: String): Results.Result

    Interpret one line of input.

    Interpret one line of input. All feedback, including parse errors and evaluation results, are printed via the supplied compiler's reporter. Values defined are available for future interpreted strings.

    The return value is whether the line was interpreted successfully, e.g. that there were no parse errors.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    ReplCore
  42. def interpretAllFrom(file: File, verbose: Boolean = false): Unit

    interpret all lines from a specified file

  43. def interpretFinally(line: String): Results.Result
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  44. final def interpretStartingWith(start: String): Option[String]

    Interpret expressions starting with the first line.

    Interpret expressions starting with the first line. Read lines until a complete compilation unit is available or until a syntax error has been seen. If a full unit is read, go ahead and interpret it. Return the full string to be recorded for replay, if any.

  45. var intp: Repl
  46. def isPackaged(line: String): Boolean
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  47. def kindCommandInternal(expr: String, verbose: Boolean): String
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  48. def lastWarnings: List[(Position, String)]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  49. def lineCommand(what: String): Result
  50. def loadCommand(arg: String): Result
  51. final def loop(): LineResult
    Annotations
    @tailrec()
  52. def mostRecentVar: String

    Returns the name of the most recent interpreter result.

    Returns the name of the most recent interpreter result. Mostly this exists so you can conveniently invoke methods on the previous result.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  53. def namedDefinedTerms: List[String]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  54. def namedParam[T](name: String, value: T)(implicit arg0: reflect.api.JavaUniverse.TypeTag[T], arg1: ClassTag[T]): NamedParam
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  55. def originalPath(name: String): String
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  56. def outputDir: AbstractFile
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  57. def parseString(line: String): Results.Result

    TODO resolve scan, parse, compile, interpret, which just indicate how much work to do.

    TODO resolve scan, parse, compile, interpret, which just indicate how much work to do.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  58. def pasteCommand(arg: String): Result
  59. val power: Power[StdReplVals]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  60. def powerCmd(): Result
  61. lazy val powerCommands: List[LoopCommand]

    Power user commands

  62. def presentationCompile(cursor: Int, buf: String): Either[Results.Result, PresentationCompilationResult]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  63. def printWelcome(): Unit

    Print a welcome message!

  64. def processLine(line: String): Boolean
  65. lazy val prompt: String
  66. def quietBind(p: NamedParam): Results.Result
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  67. def quietRun(code: String): Results.Result
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  68. def readOneLine(): String
  69. def replay(): Unit

    Announces as it replays.

  70. def replayCommand(line: String): Unit

    create a new interpreter and replay the given commands

  71. var replayCommandStack: List[String]

    A reverse list of commands to replay if the user requests a :replay

  72. def replayCommands: collection.immutable.List[String]

    A list of commands to replay if the user requests a :replay

  73. val replayQuestionMessage: String
  74. def reporter: ReplReporter
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  75. def requestDefining(name: String): Option[ReplRequest]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  76. def require(arg: String): Unit

    Adds jar file to the current classpath.

    Adds jar file to the current classpath. Jar will only be added if it does not contain classes that already exist on the current classpath.

    Importantly, require adds jars to the classpath without resetting the state of the interpreter. This is in contrast to replay which can be used to add jars to the classpath and which creates a new instance of the interpreter and replays all interpreter expressions.

  77. def reset(): Unit

    Resets without announcements.

  78. def resetCommand(line: String): Unit

    reset the interpreter in an attempt to start fresh.

    reset the interpreter in an attempt to start fresh. Supplying settings creates a new compiler.

  79. def run(interpreterSettings: Settings): Boolean

    Start an interpreter with the given settings.

    Start an interpreter with the given settings.

    returns

    true if successful

  80. def saveCommand(filename: String): Result
  81. def savingReplayStack[T](body: => T): T
  82. def searchHistory(_cmdline: String): Unit

    Search the history

  83. def setExecutionWrapper(code: String): Unit
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  84. val settings: Settings
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  85. val settingsCompletion: Completion
  86. lazy val shCommand: LoopCommand

    fork a shell and run a command

  87. val shellCompletion: Completion
  88. def showDirectory: String
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  89. lazy val standardCommands: collection.immutable.List[LoopCommand]

    Standard commands *

  90. def tokenize(line: String): List[TokenData]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  91. def translateEnclosingClass(n: String): Option[String]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  92. def translatePath(path: String): Option[String]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  93. def typeCommandInternal(expr: String, verbose: Boolean): (String, String)

    TODO - -n normalize -l label with case class parameter names -c complete - leave nothing out

    TODO - -n normalize -l label with case class parameter names -c complete - leave nothing out

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  94. def updateSettings(arguments: List[String]): Boolean
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  95. def userSetSettings: (=>collection.immutable.List[Settings.Setting]) forSome {val _1: Repl}
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  96. def valueOfTerm(id: String): Option[Any]
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  97. def verbosity(): Unit
  98. def visibleSettings: (=>collection.immutable.List[Settings.Setting]) forSome {val _1: Repl}
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  99. def welcome: String
  100. def withFile[A](filename: String)(action: (File) => A): Option[A]
  101. def withLabel[A](temp: String)(body: => A): A
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  102. def withSuppressedSettings(body: => Unit): Unit
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    Repl
  103. object LineResults extends Enumeration
  104. object LoopCommand
    Definition Classes
    LoopCommands
  105. object Result extends java.io.Serializable
    Definition Classes
    LoopCommands

Shadowed Implicit Value Members

  1. def reset(): Unit

    Reset this interpreter, forgetting all user-specified requests.

    Reset this interpreter, forgetting all user-specified requests.

    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iLoop: Repl).reset()
    Definition Classes
    Repl

Deprecated Value Members

  1. final def setContextClassLoader(): Unit
    Implicit
    This member is added by an implicit conversion from ILoop toRepl performed by method loopToInterpreter in scala.tools.nsc.interpreter.shell.ILoop.
    Definition Classes
    ReplCore
    Annotations
    @deprecated
    Deprecated

    (Since version 2.12.0) The thread context classloader is now set and restored around execution of REPL line, this method is now a no-op.