Skip to content

Commit bdcf667

Browse files
committed
open up runBody|interpret|runUntilQuit, so we can call/override them from subclasses
1 parent e332497 commit bdcf667

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/repl/ReplDriver.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class ReplDriver(settings: Array[String],
138138
* observable outside of the CLI, for this reason, most helper methods are
139139
* `protected final` to facilitate testing.
140140
*/
141-
final def runUntilQuit(using initialState: State = initialState)(): State = {
141+
def runUntilQuit(using initialState: State = initialState)(): State = {
142142
val terminal = new JLineTerminal
143143

144144
out.println(
@@ -181,7 +181,7 @@ class ReplDriver(settings: Array[String],
181181
interpret(parsed, quiet = true)
182182
}
183183

184-
private def runBody(body: => State): State = rendering.classLoader()(using rootCtx).asContext(withRedirectedOutput(body))
184+
protected def runBody(body: => State): State = rendering.classLoader()(using rootCtx).asContext(withRedirectedOutput(body))
185185

186186
// TODO: i5069
187187
final def bind(name: String, value: Any)(using state: State): State = state
@@ -247,7 +247,7 @@ class ReplDriver(settings: Array[String],
247247
.getOrElse(Nil)
248248
end completions
249249

250-
private def interpret(res: ParseResult, quiet: Boolean = false)(using state: State): State = {
250+
protected def interpret(res: ParseResult, quiet: Boolean = false)(using state: State): State = {
251251
res match {
252252
case parsed: Parsed if parsed.trees.nonEmpty =>
253253
compile(parsed, state, quiet)

0 commit comments

Comments
 (0)