aboutsummaryrefslogblamecommitdiff
path: root/compiler/src/dotty/tools/dotc/repl/SimpleReader.scala
blob: 5fab47bbe897afc26ddf318bd8b9530f4bef9ee8 (plain) (tree)
1
2
3
4
5
6




                                            
                                 









                                                                   
                                  






                       
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()
  }
}