Package arrow.meta

Types

ArrowMetaConfigurationKeys
Link copied to clipboard
object ArrowMetaConfigurationKeys

CLI bootstrap service

CliPlugin
Link copied to clipboard
typealias CliPlugin = Plugin<CompilerContext>

An Arrow Meta CliPlugin is a named function that given a CompilerContext produces a List of ExtensionPhase.

The following plugin named "Hello World" returns a single func extension phase that produces a transformation on the user tree.

In this simple plugin we are replacing all functions named helloWorld with a new function that prints "Hello ΛRROW Meta!" when invoked.

val Meta.helloWorld: CliPlugin get() =
"Hello World" {
meta(
namedFunction(this, { name == "helloWorld" }) { c -> // <-- namedFunction(...) {...}
Transform.replace(
replacing = c,
newDeclaration = """|fun helloWorld(): Unit =
| println("Hello ΛRROW Meta!")
|""".function
)
}
)
}

func is part of the arrow.meta.quotes.Quote DSL, a high level DSL built for tree transformations. While most use cases can be covered by the Quote DSL you can also subscribe to the low level compiler phases such as Configuration, Analysis, Resolution and Code generation with the Arrow Meta Compiler DSL arrow.meta.dsl.

Meta
Link copied to clipboard
interface Meta : ComponentRegistrar, MetaPluginSyntax, InternalRegistry

Meta is the core entry point and impl of Arrow Meta in terms of its registration system and interface with the Kotlin Compiler

MetaCliProcessor
Link copied to clipboard
abstract class MetaCliProcessor(metaPluginId: String) : CommandLineProcessor
Plugin
Link copied to clipboard
data class Plugin<A>(name: String, meta: A.() -> List<ExtensionPhase>)

Functions

invoke
Link copied to clipboard
operator fun String.invoke(phases: CompilerContext.() -> List<ExtensionPhase>): CliPlugin

Enables syntactic sugar for plugin creation via: "pluginId" { meta(