grammars-v4
grammars-v4 copied to clipboard
kotlin - parse label before for loop error
hi, i'm parsing some code with a label before the for loop in kotlin, like:
fun sample() {
anError@ for (i in 0 until 10) {
}
}
it will give me an error: "line 1:8 mismatched input '{' expecting {<EOF>, 'class', 'interface', 'fun', 'object', 'val', 'var', 'typealias', 'public', 'private', 'protected', 'internal', 'enum', 'sealed', 'annotation', 'data', 'inner', 'tailrec', 'operator', 'inline', 'infix', 'external', 'suspend', 'override', 'abstract', 'final', 'open', 'const', 'lateinit', 'vararg', 'noinline', 'crossinline', 'expect', 'actual', AT_NO_WS, AT_PRE_WS, VALUE}"
when i removed the anError@ label, the error was gone.
please fix it