33e6a85a2d
We exclude testData pattern from copyright scope
17 lines
293 B
Kotlin
Vendored
17 lines
293 B
Kotlin
Vendored
interface Node {
|
|
val shouldProcess: Boolean
|
|
val parent: Node?
|
|
}
|
|
|
|
fun test(initial: Node?) {
|
|
var current = initial
|
|
|
|
while (current!!.shouldProcess) {
|
|
consume(current)
|
|
current = current.parent
|
|
}
|
|
|
|
<expr>consume(current)</expr>
|
|
}
|
|
|
|
fun consume(node: Node) {} |