antlr-kotlin icon indicating copy to clipboard operation
antlr-kotlin copied to clipboard

Grammar with string interpolation confuses kotlin compiler

Open jayv opened this issue 3 years ago • 0 comments

I'm new to antlr, so perhaps I'm doing something wrong. I'm trying to write a grammar for a language with string interpolation like kotlin by starting from the MiniCalc example. Changing INTERPOLATION_OPEN from #{ into ${ it seems to generate invalid kotlin code:

LITERAL_NAMES list contains "'${'" I suppose this needs escaping in the code generator or is there another way around this? I'd be happy to contribute if pointed in the right direction.

jayv avatar Apr 11 '21 21:04 jayv