You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is unlikely to produce the output that the author intended, since the "foo" will never be checked. I wonder if we can detect this pattern and at least warn on it?
The text was updated successfully, but these errors were encountered:
It is definitely possible. The idea that for each node you should calculate statistic -- how much characters node will consume when matched? It is better to calculate the minimum and maximum. Here we only need the minimum, and the maximum may be needed in other analyzes. If alternative have a branch with minimum=0, then other alternatives will not be tried.
Maybe. Also, I realized, that the proposed solution will catch only part of situations. . always match everything, but it also always consume 1 character when matched. Actually we need static analysis which will create a representation of what inputs are possible at certain points. Then we would catch even such situations:
start1= [a-z]
/ [bcd] // never matched because the previous alternative matches all what this matchesstart2='prefix'/'prefix-literal'// never matched because the previous alternative matches all what this matches
Consider:
This is unlikely to produce the output that the author intended, since the "foo" will never be checked. I wonder if we can detect this pattern and at least warn on it?
The text was updated successfully, but these errors were encountered: