trait Repl extends ReplCore
Interface to the repl for use by the frontend (shell, the UI).
The interface should not depend on symbols and types (the compiler's internal state). At most, expose untyped trees and positions in addition to standard Java types. This decoupling would allow running the shell in a separate thread, or even in a separate process from the compiler. It should also be possible to write a new REPL frontend using this interface, and be compatible across minor compiler releases.
(The first iteration of this interface is only uses Positions and standard JVM types, but we could loosen that.)
- Source
- Interface.scala
- Alphabetic
- By Inheritance
- Repl
- ReplCore
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
- abstract type Request <: ReplRequest
- type Setting = Settings.Setting
- type SettingSet = Set[Setting]
Abstract Value Members
- abstract 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.
- Note
Currently only supports jars, not directories.
- abstract def bind(p: NamedParam): Result
- abstract def bind(name: String, boundType: String, value: Any, modifiers: List[String] = Nil): 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
- Definition Classes
- ReplCore
- abstract def classLoader: AbstractFileClassLoader
- abstract def classPathString: String
- abstract def clearExecutionWrapper(): Unit
- abstract 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.
- abstract def compileSources(sources: SourceFile*): Boolean
Compile an nsc SourceFile.
Compile an nsc SourceFile. Returns true if there are no compilation errors, or false otherwise.
- abstract def compileString(code: String): Boolean
Compile a string.
Compile a string. Returns true if there are no compilation errors, or false otherwise.
- abstract def definedTypes: List[String]
- abstract def implicitsCommandInternal(line: String): (List[String], String)
- abstract def importsCommandInternal(tokens: List[String]): List[String]
- abstract def initializeCompiler(): Boolean
- abstract def initializeComplete: Boolean
- abstract def interpret(line: String, synthetic: Boolean): Result
- abstract def interpret(line: String): 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 interpreter successfully, e.g. that there were no parse errors.
- Definition Classes
- ReplCore
- abstract def isPackaged(line: String): Boolean
- abstract def kindCommandInternal(expr: String, verbose: Boolean): String
- abstract def lastWarnings: List[(Position, String)]
- abstract 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.
- abstract def namedDefinedTerms: List[String]
- abstract def namedParam[T](name: String, value: T)(implicit arg0: reflect.api.JavaUniverse.TypeTag[T], arg1: ClassTag[T]): NamedParam
- abstract def originalPath(name: String): String
- abstract val power: Power[StdReplVals]
- abstract def presentationCompile(cursor: Int, buf: String): Either[Result, PresentationCompilationResult]
- abstract def quietBind(p: NamedParam): Result
- abstract def quietRun(code: String): Result
- abstract def reporter: ReplReporter
- abstract def requestDefining(name: String): Option[ReplRequest]
- abstract def reset(): Unit
Reset this interpreter, forgetting all user-specified requests.
- abstract def setExecutionWrapper(code: String): Unit
- abstract val settings: Settings
- abstract def showDirectory: String
- abstract def translateEnclosingClass(n: String): Option[String]
- abstract def translatePath(path: String): Option[String]
- abstract def typeCommandInternal(expr: String, verbose: Boolean): (String, String)
TODO - -n normalize -l label with case class parameter names -c complete - leave nothing out
- abstract def updateSettings(arguments: List[String]): Boolean
- abstract def userSetSettings: SettingSet
- abstract def valueOfTerm(id: String): Option[Any]
- abstract def visibleSettings: SettingSet
- abstract def withLabel[A](temp: String)(body: => A): A
- abstract def withSuppressedSettings(body: => Unit): Unit
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Repl, B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def beQuietDuring(body: => Unit): Unit
The reporter will not print results during execution of
body
. - def bindValue(name: String, value: Any): Result
Bind a specified
name
to a specifiedvalue
.Bind a specified
name
to a specifiedvalue
. The type is derived from the run-time class of the value.- Definition Classes
- ReplCore
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ensuring(cond: (Repl) => Boolean, msg: => Any): Repl
- def ensuring(cond: (Repl) => Boolean): Repl
- def ensuring(cond: Boolean, msg: => Any): Repl
- def ensuring(cond: Boolean): Repl
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def formatted(fmtstr: String): String
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- final def setContextClassLoader(): Unit
- 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.
- def →[B](y: B): (Repl, B)
- Implicit
- This member is added by an implicit conversion from Repl toArrowAssoc[Repl] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
The Scala compiler and reflection APIs.