mike-lischke / antlr4ng

Next Generation TypeScript runtime for ANTLR4
Other
65 stars 11 forks source link

ATNConfig.reachesIntoOuterContext should be an "int" (number) #49

Closed kaby76 closed 3 months ago

kaby76 commented 3 months ago

Going through the parser trace diffs.

ATNConfig.reachesIntoOuterContext should be an "int" (number), as it is defined in CSharp, Java, assigned as a number in JavaScript, but defined as a boolean in Antlr4ng. We can confirm that with a call to int Max(a,b) called in CSharp, Java, JavaScript, but not Antlr4ng.

mike-lischke commented 3 months ago

Yes, I know, but a comment in the source code says it can be a boolean, because it is never decremented (so it's always yes or no). So I made it a boolean.

And the precedence filter handling is implemented differently, not using a bit in the reachesInfoOuterContext member (taken over from the JS implementation).