minor: small cleanup in K2 scripting support code
This commit is contained in:
committed by
Space Team
parent
895a811b47
commit
776cdbcd3f
@@ -330,16 +330,13 @@ class Fir2IrConverter(
|
|||||||
declarationStorage.enterScope(irScript)
|
declarationStorage.enterScope(irScript)
|
||||||
irScript.parent = parent
|
irScript.parent = parent
|
||||||
for (scriptStatement in declaration.statements) {
|
for (scriptStatement in declaration.statements) {
|
||||||
if (scriptStatement is FirDeclaration) {
|
when (scriptStatement) {
|
||||||
when (scriptStatement) {
|
is FirRegularClass -> {
|
||||||
is FirRegularClass -> {
|
registerClassAndNestedClasses(scriptStatement, irScript)
|
||||||
registerClassAndNestedClasses(scriptStatement, irScript)
|
processClassAndNestedClassHeaders(scriptStatement)
|
||||||
processClassAndNestedClassHeaders(scriptStatement)
|
|
||||||
}
|
|
||||||
is FirTypeAlias -> classifierStorage.registerTypeAlias(scriptStatement, irScript)
|
|
||||||
else -> {}
|
|
||||||
}
|
}
|
||||||
|
is FirTypeAlias -> classifierStorage.registerTypeAlias(scriptStatement, irScript)
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (scriptStatement in declaration.statements) {
|
for (scriptStatement in declaration.statements) {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class Fir2IrVisitor(
|
|||||||
private val operatorGenerator = OperatorExpressionGenerator(components, this, conversionScope)
|
private val operatorGenerator = OperatorExpressionGenerator(components, this, conversionScope)
|
||||||
|
|
||||||
private var _annotationMode: Boolean = false
|
private var _annotationMode: Boolean = false
|
||||||
public val annotationMode: Boolean
|
val annotationMode: Boolean
|
||||||
get() = _annotationMode
|
get() = _annotationMode
|
||||||
|
|
||||||
private fun FirTypeRef.toIrType(): IrType = with(typeConverter) { toIrType() }
|
private fun FirTypeRef.toIrType(): IrType = with(typeConverter) { toIrType() }
|
||||||
|
|||||||
+1
-1
@@ -491,7 +491,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
|||||||
+name
|
+name
|
||||||
+fieldList(statement).withTransform()
|
+fieldList(statement).withTransform()
|
||||||
+symbol("FirScriptSymbol")
|
+symbol("FirScriptSymbol")
|
||||||
+FieldList("parameters", variable, withReplace = false)
|
+fieldList("parameters", variable, withReplace = false)
|
||||||
+fieldList(contextReceiver, useMutableOrEmpty = true)
|
+fieldList(contextReceiver, useMutableOrEmpty = true)
|
||||||
+field("resultPropertyName", nameType, nullable = true)
|
+field("resultPropertyName", nameType, nullable = true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,9 +86,7 @@ object PathUtil {
|
|||||||
|
|
||||||
val KOTLIN_SCRIPTING_PLUGIN_CLASSPATH_JARS = arrayOf(
|
val KOTLIN_SCRIPTING_PLUGIN_CLASSPATH_JARS = arrayOf(
|
||||||
KOTLIN_SCRIPTING_COMPILER_PLUGIN_JAR, KOTLIN_SCRIPTING_COMPILER_IMPL_JAR,
|
KOTLIN_SCRIPTING_COMPILER_PLUGIN_JAR, KOTLIN_SCRIPTING_COMPILER_IMPL_JAR,
|
||||||
KOTLINX_COROUTINES_CORE_JAR,
|
|
||||||
KOTLIN_SCRIPTING_COMMON_JAR, KOTLIN_SCRIPTING_JVM_JAR,
|
KOTLIN_SCRIPTING_COMMON_JAR, KOTLIN_SCRIPTING_JVM_JAR,
|
||||||
JS_ENGINES_JAR
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const val KOTLIN_TEST_NAME = "kotlin-test"
|
const val KOTLIN_TEST_NAME = "kotlin-test"
|
||||||
|
|||||||
Reference in New Issue
Block a user