From 68d3bc8d76e550f98cf768362eb311d0cc4f3a0d Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Mon, 14 Jul 2014 19:34:52 +0400 Subject: Beautification and documentation. --- src/Analysis/AnalysisEnvironment.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Analysis') diff --git a/src/Analysis/AnalysisEnvironment.kt b/src/Analysis/AnalysisEnvironment.kt index d657ae4a..9fe90628 100644 --- a/src/Analysis/AnalysisEnvironment.kt +++ b/src/Analysis/AnalysisEnvironment.kt @@ -12,6 +12,12 @@ import org.jetbrains.jet.cli.jvm.* import com.intellij.openapi.util.* import org.jetbrains.jet.lang.descriptors.ModuleDescriptor +/** + * Kotlin as a service entry point + * Configures environment, analyses files and provides facilities to perform code processing without emitting bytecode + * $messageCollector is required by compiler infrastructure and will receive all compiler messages + * $body is optional and can be used to configure environment without creating local variable + */ public class AnalysisEnvironment(val messageCollector: MessageCollector, body: AnalysisEnvironment.() -> Unit = {}) : Disposable { val configuration = CompilerConfiguration(); @@ -20,6 +26,10 @@ public class AnalysisEnvironment(val messageCollector: MessageCollector, body: A body() } + /** + * Executes [processor] when analysis is complete. + * $processor is a function to receive compiler environment, module and context for symbol resolution + */ public fun withContext(processor: (JetCoreEnvironment, ModuleDescriptor, BindingContext) -> T): T { val environment = JetCoreEnvironment.createForProduction(this, configuration) val exhaust = environment.analyze(messageCollector) -- cgit