blob: 29ecd3c9d671ac08eb717f183538589cedb286dc (
plain) (
tree)
|
|
package dotty.tools
package dotc
package repl
/** Reads lines from an input stream */
trait InteractiveReader {
def readLine(prompt: String): String
val interactive: Boolean
}
/** The current Scala REPL know how to do this flexibly.
*/
object InteractiveReader {
/** Create an interactive reader. Uses JLine if the
* library is available, but otherwise uses a
* SimpleReader. */
def createDefault(): InteractiveReader = {
try {
new JLineReader()
} catch {
case e =>
//out.println("jline is not available: " + e) //debug
new SimpleReader()
}
}
}
|