From 8a61ff432543a29234193cd1f7c14abd3f3d31a0 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 2 Nov 2016 11:08:28 +0100 Subject: Move compiler and compiler tests to compiler dir --- .../src/dotty/tools/dotc/repl/SimpleReader.scala | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 compiler/src/dotty/tools/dotc/repl/SimpleReader.scala (limited to 'compiler/src/dotty/tools/dotc/repl/SimpleReader.scala') 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() + } +} -- cgit v1.2.3