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

org.jetbrains.kotlinx.jupyter.api.CodePreprocessor.kt Maven / Gradle / Ivy

There is a newer version: 0.12.0-335
Show newest version
package org.jetbrains.kotlinx.jupyter.api

import org.jetbrains.kotlinx.jupyter.api.libraries.LibraryDefinitionProducer

/**
 * Preprocesses the cell code before its execution
 */
interface CodePreprocessor {
    /**
     * Returns `true` if this preprocessor accepts the given [code]
     */
    fun accepts(code: String): Boolean = true

    /**
     * Performs code preprocessing
     */
    fun process(
        code: String,
        host: KotlinKernelHost,
    ): Result

    data class Result(val code: Code, val libraries: List = emptyList())
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy