All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.seskar.compiler.env.backend.EnvTransformer.kt Maven / Gradle / Ivy

package seskar.compiler.env.backend

import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.declarations.IrProperty
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
import seskar.compiler.union.backend.JsName

internal class EnvTransformer(
    private val context: IrPluginContext,
) : IrElementTransformerVoid() {
    override fun visitProperty(declaration: IrProperty): IrStatement {
        val variableName = declaration.toEnvVariableName()
        if (variableName != null) {
            declaration.annotations += JsName(context, declaration, variableName)
        }

        return super.visitProperty(declaration)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy