Dotty Documentation

0.11.0-bin-SNAPSHOT

package dotty.tools.repl
extends Object

[-] Constructors

[-] Members

A class loader that loads files from a [[scala.tools.nsc.io.AbstractFile]].

A phase that collects user defined top level imports.

These imports must be collected as typed trees and therefore after Typer.

[+] sealed trait Command

A command is on the format:

:commandName <optional arguments...>

The Command trait denotes these commands

[+] case class DocOf

A command that is used to display the documentation associated with the given expression.

[+] object DocOf
[+] object Help

:help shows the different commands implemented by the Dotty repl

[+] object Imports

:imports lists the imports that have been explicitly imported during the session

[+] final class JLineTerminal
[+] case class Load

:load <path> interprets a scala file as if entered line-by-line into the REPL

[+] object Load
[+] object Main

Main entry point to the REPL

[+] object Newline

Parsed result is simply a newline

[+] object ParseResult
[+] sealed trait ParseResult

A parsing result from string input

[+] case class Parsed

An error free parsing resulting in a list of untyped trees

[+] object Parsed

An error free parsing resulting in a list of untyped trees

[+] object Quit

:quit exits the repl

[+] class REPLFrontEnd

A customized FrontEnd for the REPL

This customized front end does not perform parsing as part of its runOn method. This allows us to keep the parsing separate from the rest of the compiler pipeline.

[+] class Rendering

This rendering object uses ClassLoaders to accomplish crossing the 4th wall (i.e. fetching back values from the compiled class files put into a specific class loader capable of loading from memory) and rendering them.

[+] object Rendering

This rendering object uses ClassLoaders to accomplish crossing the 4th wall (i.e. fetching back values from the compiled class files put into a specific class loader capable of loading from memory) and rendering them.

[+] class ReplCompiler

This subclass of Compiler is adapted for use in the REPL.

  • compiles parsed expression in the current REPL state:
    • adds the appropriate imports in scope
    • wraps expressions into a dummy object
  • provides utility to query the type of an expression
  • provides utility to query the documentation of an expression
[+] class ReplDriver

Main REPL instance, orchestrating input, compilation and presentation

[+] object ReplDriver

Main REPL instance, orchestrating input, compilation and presentation

[+] object Reset

Reset the session to the initial state from when the repl program was started

[+] final class ShowUser
[+] object ShowUser
[+] object SigKill

ctrl-c obtained from input string

[+] case class State

The state of the REPL contains necessary bindings instead of having to have mutation

The compiler in the REPL needs to do some wrapping in order to compile valid code. This wrapping occurs when a single MemberDef that cannot be top-level needs to be compiled. In order to do this, we need some unique identifier for each of these wrappers. That identifier is objectIndex.

Free expressions such as 1 + 1 needs to have an assignment in order to be of use. These expressions are therefore given a identifier on the format resX where X starts at 0 and each new expression that needs an identifier is given the increment of the old identifier. This identifier is valIndex.

[+] object State

The state of the REPL contains necessary bindings instead of having to have mutation

The compiler in the REPL needs to do some wrapping in order to compile valid code. This wrapping occurs when a single MemberDef that cannot be top-level needs to be compiled. In order to do this, we need some unique identifier for each of these wrappers. That identifier is objectIndex.

Free expressions such as 1 + 1 needs to have an assignment in order to be of use. These expressions are therefore given a identifier on the format resX where X starts at 0 and each new expression that needs an identifier is given the increment of the old identifier. This identifier is valIndex.

[+] case class SyntaxErrors

A parsing result containing syntax errors

[+] object SyntaxErrors

A parsing result containing syntax errors

[+] case class TypeOf

To find out the type of an expression you may simply do:

scala> :type (1 * 54).toString
String
[+] object TypeOf
[+] case class UnknownCommand

An unknown command that will not be handled by the REPL

[+] object UnknownCommand

An unknown command that will not be handled by the REPL

[+] object results

Contains the different data and type structures used to model results in the REPL

[+] def newStoreReporter : StoreReporter

Create empty outer store reporter