tunnelvisionlabs / antlr4ts

Optimized TypeScript target for ANTLR 4
Other
624 stars 106 forks source link

Code release produced a wrong typings file. #479

Closed mike-lischke closed 3 years ago

mike-lischke commented 4 years ago

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.

mike-lischke commented 3 years ago

Fixed in -alpha.4