Dotty Documentation

0.11.0-bin-SNAPSHOT

class ReplDriver
extends Driver

Main REPL instance, orchestrating input, compilation and presentation

[-] Constructors

ReplDriver ( settings: Array [ String ] , out: PrintStream , classLoader: Option [ ClassLoader ] )

[-] Members

[+] private val classLoader : Option [ ClassLoader ]
[+] private var compiler : ReplCompiler
[+] private val messageRenderer : MessageRendering

A MessageRenderer without file positions

[+] private val out : PrintStream
[+] private var rendering : Rendering
[+] private var rootCtx : Context
[+] private val settings : Array [ String ]
[+] final def bind ( name: String , value: Any ) ( implicit state: State ) : State
[+] private def compile ( parsed: Parsed , istate: State ) : State

Compile parsed trees and evolve state in accordance

[+] protected final def completions ( cursor: Int , expr: String , state0: State ) : List [ Candidate ]

Extract possible completions at the index of cursor in expr

[+] private def displayDefinitions ( tree: Tree , newestWrapper: Name ) ( implicit state: State ) : State

Display definitions from tree

[+] private def displayErrors ( errs: Seq [ MessageContainer ] ) ( implicit state: State ) : State

Output errors to out

[+] private def initialCtx : Context

Create a fresh and initialized context with IDE mode enabled

[+] final def initialState : State

the initial, empty state of the REPL session

[+] private def interpret ( res: ParseResult ) ( implicit state: State ) : State
[+] private def interpretCommand ( cmd: Command ) ( implicit state: State ) : State

Interpret cmd to action and propagate potentially new state

[+] private def newRun ( state: State ) : State
[+] private def renderMessage ( cont: MessageContainer ) : Context => String

Render messages using the MessageRendering trait

[+] protected def resetToInitial ( ) : Unit

Reset state of repl to the initial state

This method is responsible for performing an all encompassing reset. As such, when the user enters :reset this method should be called to reset everything properly

[+] final def run ( input: String ) ( implicit state: State ) : State
[+] final def runUntilQuit ( initialState: State ) : State

Run REPL with state until :quit command found

This method is the main entry point into the REPL. Its effects are not observable outside of the CLI, for this reason, most helper methods are protected final to facilitate testing.

[+] def runUntilQuit$default$1 : State

Run REPL with state until :quit command found

This method is the main entry point into the REPL. Its effects are not observable outside of the CLI, for this reason, most helper methods are protected final to facilitate testing.

[+] override def sourcesRequired : Boolean

Overridden to false in order to not have to give sources on the commandline

[+] private def withRedirectedOutput ( op: => State ) : State