lark icon indicating copy to clipboard operation
lark copied to clipboard

Correctly put terminals into non-capturing groups when combining them

Open MegaIng opened this issue 1 month ago • 1 comments

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.

MegaIng avatar May 16 '24 13:05 MegaIng