REPL, minor: Ignore empty lines (#KT-21611)

This commit is contained in:
Yan Zhulanow
2017-12-07 01:38:33 +09:00
committed by Yan Zhulanow
parent edcf0aef53
commit 310ee67c35
@@ -31,6 +31,10 @@ class GenericReplCompilingEvaluator(val compiler: ReplCompiler,
override fun createState(lock: ReentrantReadWriteLock): IReplStageState<*> = AggregatedReplStageState(compiler.createState(lock), evaluator.createState(lock), lock)
override fun compileAndEval(state: IReplStageState<*>, codeLine: ReplCodeLine, scriptArgs: ScriptArgsWithTypes?, invokeWrapper: InvokeWrapper?): ReplEvalResult {
if (codeLine.code.trim().isEmpty()) {
return ReplEvalResult.UnitResult()
}
return state.lock.write {
val aggregatedState = state.asState(AggregatedReplStageState::class.java)
val compiled = compiler.compile(state, codeLine)