Here is my code:
fun loop(block: (Int, Parser) -> Unit) {
for ((index, parser) in queue.withIndex())
block(index, parser)
}
label@ loop { index, parser ->
parser.parseLine(event.getLine(index)) {
if (it.cancelled) {
return@label
}
// stuff
}
}
and for a parseLine
it looks like this
abstract fun parseLine(line: String, block: (ParserCallback) -> Unit)
ParserCallback
is just a data class
Probably I’m doing something wrong, but someone said that if I get CompilationException
I should notify you guys about that… so I’m doing that. IntelliJ IDEA allows that syntax above, so I hoped it will work, but not necessarily.
I’m using Gradle with Kotlin 1.2.50.
I have a pretty short deadline so it would be AWESOME if someone could help me with that.
Also, I forgot, the error message:
PS: When I put label@
on parseLine
function it still doesn’t work.