18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-27 23:57:09 +01:00
Files
maszyna/scripting/scriptscreenrules.cpp
jerrrrycho f6e9075a73 fix(scripting): a %b counts the way it walks along the subject
A %bxy at the end of a pattern (or before what always matches) was costed
as one pass over the subject, but matchbalance walks to the end of the
subject from every opening character nothing closes: ("("):rep(1e6):find("%b()")
was let through and ran for hours in C, past the instruction hook.

A %b now multiplies wherever it stands. With the subject at hand it counts
the longest way from an opening character to its closing one, or, when it is
tried once from each position, the ways from all of them over the positions:
a long text of short balanced pairs stays cheap, one that doesn't balance is
refused.
2026-11-18 19:29:25 +01:00

13 KiB