Right now, the Kotlin parser uses AntlrKotlinErrorListener to deal with errors while parsing. That class throws ParseCancellationException on syntax error, which seems to be a dummy class that doesn't hold any information. Basically, the information on which token the error occurred is completely lost.
Also, the parser explicitly removes all other listeners from the ANTLR parser, so you can't even inject one yourself to get that error information.
I think at least one, if not both, of these are issues that should be fixed. Otherwise, the user only gets a "something is wrong" error.
Right now, the Kotlin parser uses
AntlrKotlinErrorListener
to deal with errors while parsing. That class throwsParseCancellationException
on syntax error, which seems to be a dummy class that doesn't hold any information. Basically, the information on which token the error occurred is completely lost. Also, the parser explicitly removes all other listeners from the ANTLR parser, so you can't even inject one yourself to get that error information.I think at least one, if not both, of these are issues that should be fixed. Otherwise, the user only gets a "something is wrong" error.