blob: ea587a097a27e36f8fd69d5197dc391e28588fee (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
package dotty.tools
package dotc
package repl
import core.Contexts.Context
/** This object defines the type of interpreter results */
object Interpreter {
/** A result from interpreting one line of input. */
abstract sealed class Result
/** The line was interpreted successfully. */
case object Success extends Result
/** The line was erroneous in some way. */
case object Error extends Result
/** The input was incomplete. The caller should request more input.
*/
case object Incomplete extends Result
}
/** The exported functionality of the interpreter */
trait Interpreter {
import Interpreter._
/** Interpret one line of input. All feedback, including parse errors
* and evaluation results, are printed via the context's reporter.
* reporter. Values defined are available for future interpreted strings.
*/
def interpret(line: String)(implicit ctx: Context): Result
/** Suppress output during evaluation of `operation`. */
def beQuietDuring[T](operation: => T): T
}
|