mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
allows to compile only parts of the source files, denoted by top-level "sections" (function with lambda param calls), but preserving original file line/column numbers for easier diagnostics. Allow e.g. to compile gradle "buildscript" section without preprocessing original file in advance. See tests for examples.
23 lines
310 B
Kotlin
Vendored
23 lines
310 B
Kotlin
Vendored
|
|
println("should not be printed")
|
|
|
|
fun unlistedSectionName(body: () -> Unit): Unit = body()
|
|
|
|
let {
|
|
println("Hello, World!")
|
|
}
|
|
|
|
println("ignore here")
|
|
|
|
unlistedSectionName {
|
|
println("should not be printed too")
|
|
}
|
|
|
|
println("ignore here")
|
|
|
|
apply {
|
|
println("That's all, folks!")
|
|
}
|
|
|
|
println("ignore here")
|