blob: a28fb9c5fea2fdde977411ce27245b6accb2a6fc (
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
|
/* NSC -- new Scala compiler
* Copyright 2005-2011 LAMP/EPFL
* @author Stepan Koltsov
*/
package scala.tools.nsc
package interpreter
import java.io.{ BufferedReader, PrintWriter }
import io.{ Path, File, Directory }
/** Reads using standard JDK API */
class SimpleReader(
in: BufferedReader,
out: PrintWriter,
val interactive: Boolean)
extends InteractiveReader {
def this() = this(Console.in, new PrintWriter(Console.out), true)
def this(in: File, out: PrintWriter, interactive: Boolean) = this(in.bufferedReader(), out, interactive)
lazy val history = History.Empty
lazy val completion = Completion.Empty
def init() = ()
def reset() = ()
def readOneLine(prompt: String): String = {
if (interactive) {
out.print(prompt)
out.flush()
}
in.readLine()
}
}
|