grammars-v4 icon indicating copy to clipboard operation
grammars-v4 copied to clipboard

kotlin - parse label before for loop error

Open gdannyliao opened this issue 2 years ago • 0 comments

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

gdannyliao avatar Aug 01 '23 03:08 gdannyliao