Prepare scripting infrastructure for REPL:

- refactor script compiler to simplify extending it for repl
- add repl snippet compilation functions to the new scripting compiler
- extract util functions into appropriate files
- extract repl part into separate class
- extract bridge definition and related definitions into separate file
This commit is contained in:
Ilya Chernikov
2019-04-28 18:38:24 +02:00
parent a4c049d26e
commit 89006f16cd
11 changed files with 1010 additions and 534 deletions
@@ -61,6 +61,10 @@ interface IReplStageState<T> {
fun <StateT : IReplStageState<*>> asState(target: Class<out StateT>): StateT =
if (target.isAssignableFrom(this::class.java)) this as StateT
else throw IllegalArgumentException("$this is not an expected instance of IReplStageState")
fun dispose() {
history.reset()
}
}