aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/repl/SimpleReader.scala
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/dotty/tools/dotc/repl/SimpleReader.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/repl/SimpleReader.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/repl/SimpleReader.scala b/compiler/src/dotty/tools/dotc/repl/SimpleReader.scala
new file mode 100644
index 000000000..5fab47bbe
--- /dev/null
+++ b/compiler/src/dotty/tools/dotc/repl/SimpleReader.scala
@@ -0,0 +1,24 @@
+package dotty.tools
+package dotc
+package repl
+
+import java.io.{BufferedReader, PrintWriter}
+import dotc.core.Contexts.Context
+
+
+/** 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 readLine(prompt: String) = {
+ if (interactive) {
+ out.print(prompt)
+ out.flush()
+ }
+ in.readLine()
+ }
+}