minor: fix typos and terminology
This commit is contained in:
@@ -67,7 +67,8 @@ open class GenericRepl(
|
||||
private val psiFileFactory: PsiFileFactoryImpl = PsiFileFactory.getInstance(environment.project) as PsiFileFactoryImpl
|
||||
private val analyzerEngine = CliReplAnalyzerEngine(environment)
|
||||
|
||||
private class ChunkState(
|
||||
// "line" - is the unit of evaluation here, could in fact consists of several character lines
|
||||
private class LineState(
|
||||
val code: String,
|
||||
val psiFile: KtFile,
|
||||
val errorHolder: DiagnosticMessageHolder)
|
||||
@@ -89,7 +90,7 @@ open class GenericRepl(
|
||||
override fun getScriptParameters(scriptDescriptor: ScriptDescriptor): List<ScriptParameter> = emptyList()
|
||||
}
|
||||
|
||||
private var chunkState: ChunkState? = null
|
||||
private var lineState: LineState? = null
|
||||
|
||||
private var lastDependencies: KotlinScriptExternalDependencies? = null
|
||||
|
||||
@@ -117,7 +118,7 @@ open class GenericRepl(
|
||||
val syntaxErrorReport = AnalyzerWithCompilerReport.Companion.reportSyntaxErrors(psiFile, errorHolder)
|
||||
|
||||
if (!syntaxErrorReport.isHasErrors) {
|
||||
chunkState = ChunkState(code, psiFile, errorHolder)
|
||||
lineState = LineState(code, psiFile, errorHolder)
|
||||
}
|
||||
|
||||
return when {
|
||||
@@ -131,11 +132,11 @@ open class GenericRepl(
|
||||
fun eval(executionNumber: Long, code: String): EvalResult {
|
||||
synchronized(this) {
|
||||
val (psiFile, errorHolder) = run {
|
||||
if (chunkState == null || chunkState!!.code != code) {
|
||||
if (lineState == null || lineState!!.code != code) {
|
||||
val res = checkComplete(executionNumber, code)
|
||||
if (res != EvalResult.Ready) return@eval res
|
||||
}
|
||||
Pair(chunkState!!.psiFile, chunkState!!.errorHolder)
|
||||
Pair(lineState!!.psiFile, lineState!!.errorHolder)
|
||||
}
|
||||
|
||||
val newDependencies = scriptDefinition.getDependenciesFor(psiFile, environment.project, lastDependencies)
|
||||
|
||||
@@ -28,7 +28,7 @@ import javax.script.*
|
||||
|
||||
class KotlinJsr232ScriptEngine(
|
||||
disposable: Disposable,
|
||||
private val factory: KotlinJsr232StandardScriptEngineFactory,
|
||||
private val factory: ScriptEngineFactory,
|
||||
private val scriptDefinition: KotlinScriptDefinition,
|
||||
private val compilerConfiguration: CompilerConfiguration
|
||||
) : AbstractScriptEngine(), ScriptEngine {
|
||||
|
||||
@@ -90,7 +90,7 @@ class ScriptTemplateTest {
|
||||
|
||||
@Test
|
||||
fun testScriptWithOverridenParam() {
|
||||
val aClass = compileScript("overriden_parameter.kts", ScriptBaseClassWithOverridenProperty::class, null)
|
||||
val aClass = compileScript("overridden_parameter.kts", ScriptBaseClassWithOverriddenProperty::class, null)
|
||||
Assert.assertNotNull(aClass)
|
||||
aClass!!.getConstructor(Integer.TYPE).newInstance(4)
|
||||
}
|
||||
@@ -176,11 +176,11 @@ class ScriptTemplateTest {
|
||||
|
||||
private fun compileScript(
|
||||
scriptPath: String,
|
||||
scriptBase: KClass<out Any>,
|
||||
scriptTemplate: KClass<out Any>,
|
||||
environment: Map<String, Any?>? = null,
|
||||
runIsolated: Boolean = true,
|
||||
suppressOutput: Boolean = false): Class<*>? =
|
||||
compileScriptImpl("compiler/testData/script/" + scriptPath, KotlinScriptDefinitionFromTemplate(scriptBase, null, null, environment), runIsolated, suppressOutput)
|
||||
compileScriptImpl("compiler/testData/script/" + scriptPath, KotlinScriptDefinitionFromTemplate(scriptTemplate, null, null, environment), runIsolated, suppressOutput)
|
||||
|
||||
private fun compileScriptImpl(
|
||||
scriptPath: String,
|
||||
@@ -294,7 +294,7 @@ abstract class ScriptWithoutParams(num: Int)
|
||||
@ScriptTemplateDefinition(
|
||||
scriptFilePattern =".*\\.kts",
|
||||
resolver = TestKotlinScriptDependenciesResolver::class)
|
||||
abstract class ScriptBaseClassWithOverridenProperty(override val num: Int) : TestClassWithOverridableProperty(num)
|
||||
abstract class ScriptBaseClassWithOverriddenProperty(override val num: Int) : TestClassWithOverridableProperty(num)
|
||||
|
||||
@ScriptTemplateDefinition(resolver = TestKotlinScriptDependenciesResolver::class)
|
||||
abstract class ScriptWithArrayParam(val myArgs: Array<String>)
|
||||
|
||||
Reference in New Issue
Block a user