Closed vityaman closed 2 weeks ago
I see no reason why to remove a useful feature. OK, it's not a big thing, but it's something that makes usage a bit easier. The problem described in #136 seems not to be related to this filtering of unwanted tokens.
@mike-lischke, returned following tokens filtering based on ignoredTokens
. I placed it right after processRule
inside collectCandidates
to avoid caching dependent results.
@mike-lischke, if you are talking about this cache fix, I can make the same changes to Java and TypeScript versions of the library. Do we need it?
No, no, that's not what I meant. I spoke about future changes in the TS version that would need to be tracked by the ports and the more the source code diverts, the harder it is to do that.
There is a problem explained at https://github.com/mike-lischke/antlr4-c3/issues/136#issuecomment-2268664819 because of cache dependency on
ignoredTokens
value. I just removed the token filter ingetFollowingTokens
. This logic originally was added in "Initial commit" 7 years ago, so motivation is unclear. On the one hand, tests were not changed, so the behavior with which all are agreed is the same. On the other hand, now we can get some elements ofignoredTokens
infollowSet
fromcandidates
. It can be fixed by simply adding a check afterfollowSet
was received either from the cache or computation.@mike-lischke, there are two questions:
If yes, then I'll do changes and this test case will be OK: