lark
lark copied to clipboard
Correctly put terminals into non-capturing groups when combining them
Fix #1414
The core issue is that A B got turned into /{A}{B}/ instead of /(?:{A})(?:{B})/. Most of the time, this doesn't matter, however if B is a manually defined regex, for example /c|d/, the overall regex ended up being /ac|d/, which ofcourse means something else than the BNF was supposed to express.
This is technically a breaking change if people were relying on this buggy behavior.
Good change. But I have a feeling this might trigger some hidden bugs in various repos.