File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -197,14 +197,12 @@ class ReplDriver(settings: Array[String],
197197 private def extractImports (trees : List [untpd.Tree ]): List [untpd.Import ] =
198198 trees.collect { case imp : untpd.Import => imp }
199199
200- private def interpret (res : ParseResult )(implicit state : State ): State =
201- res match {
200+ private def interpret (res : ParseResult )(implicit state : State ): State = {
201+ val newState = res match {
202202 case parsed : Parsed if parsed.trees.nonEmpty =>
203- val newState = compile(parsed)
203+ compile(parsed)
204204 .withHistory(parsed.sourceCode :: state.history)
205205 .newRun(compiler, rootCtx)
206- out.println() // Prints newline after commands, also fixes #1369
207- newState
208206
209207 case SyntaxErrors (src, errs, _) =>
210208 displayErrors(errs)
@@ -218,6 +216,9 @@ class ReplDriver(settings: Array[String],
218216 case _ => // new line, empty tree
219217 state
220218 }
219+ out.println()
220+ newState
221+ }
221222
222223 /** Compile `parsed` trees and evolve `state` in accordance */
223224 protected [this ] final def compile (parsed : Parsed )(implicit state : State ): State = {
Original file line number Diff line number Diff line change 1+ scala> print("foo")
2+ foo
3+ scala> "Hello"
4+ val res0: String = Hello
You can’t perform that action at this time.
0 commit comments