tunnelvisionlabs / antlr4ts

Optimized TypeScript target for ANTLR 4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code release produced a wrong typings file.

mike-lischke opened this issue · comments

I haven't looked at the details of antlr4ts for a while already, so I don't know when this was introduced, but currently (0.5.0-alpha.3) there's a bug in ParserInterpreter.d.ts which causes a crash in my grammer debugger. Line 64 reads:

protected rootContext: InterpreterRuleContext;

which is probably as it has been before. Later (4.5.1) a line was added:

readonly rootContext: InterpreterRuleContext;

in the same file, about which ESLint actually complains (both members must have the same signature). My grammar debugger writes to the rootContext which ended up on the newly added readonly member (and caused an exception as this is not writable).

The fix is to define the writable member as:

protected _rootContext: InterpreterRuleContext;

which I now use to set the new context content and everything is back to work normally.

Fixed in -alpha.4