regex: clean up/refactor some EVAL code #24985
before could be declared at it's first use.
Giving it type ptrdiff_t should avoid the need to cast it too, and it's not modified after that point so it could be const.
gimme is only used by PUSH_MULTICALL_FLAGS_PREFIX_(newcv, flags, reginfo->); that I could see, it isn't modified, nor is a pointer taken, so it could be moved to point of use and made const.
I'd be inclined to move ret down too, just after SPAGAIN.
should this assert(logical == 2)?
Or should it be a switch?
Also, something else to refactor would be the magic numbers, but that might be out of context.
Also a natural switch where the magic letters could use names (the switch might be a matter of taste, and the magic letters might be out of scope, so feel free to dismiss.)
All done now, in an extra commit entitled 'tweak S_run_code_block()'
I've added the assert, but declined the switch and magic numbers suggestions
I've declined these suggestions for now.
Approved these changes.
Approved these changes.
tonycoz
iabyn
Several commits which collectively refactor and simplify the code which handles /(?{...})/ and similar, and moves the actual perl-calling part of it into a separate static function.