Open rrb3942 opened 1 month ago
This can break patchers that don't expect to be re-run over the statement multiple times.
Maybe it makes sense to add a test for this use case.
Rebased and added a test to catch if patchers are run more times than expected. I verified that the test fails without the other fixes.
See issue #637
This contains the changes from pull request #658 as well. If this pull is accepted that one may be closed.
Commit https://github.com/expr-lang/expr/commit/3da85278439a5e8ef5dc0d73f321f76742e2cecc introduced repeating the patch phase for operator overloading, but also reruns all patchers any time an operator overload is patched.
This can break patchers that don't expect to be re-run over the statement multiple times.
This patch set splits patching into two phases. First phase only patchers that don't require multiple passes are run. Second phase only patchers that require multiple passes are run.
As a side effect, it also allows any ordering between other patchers and operator overloads, where as previously if a patcher changed a nodes type it would have to be supplied as an option before the operator.
Passes all tests.