@@ -13537,7 +13537,8 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist,
13537
13537
* a stack. Each entry on the stack is a single character representing one
13538
13538
* of the operators; or else a pointer to an operand inversion list. */
13539
13539
13540
- #define IS_OPERAND(a) (! SvIOK(a))
13540
+ #define IS_OPERATOR(a) SvIOK(a)
13541
+ #define IS_OPERAND(a) (! IS_OPERATOR(a))
13541
13542
13542
13543
/* The stack is kept in Łukasiewicz order. (That's pronounced similar
13543
13544
* to luke-a-shave-itch (or -itz), but people who didn't want to bother
@@ -13710,12 +13711,12 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist,
13710
13711
* better be a '!', otherwise the entry below the top
13711
13712
* operand should be an operator */
13712
13713
if ( ! (top_ptr = av_fetch(stack, top_index, FALSE))
13713
- || (! IS_OPERAND (*top_ptr) && SvUV(*top_ptr) != '!')
13714
+ || (IS_OPERATOR (*top_ptr) && SvUV(*top_ptr) != '!')
13714
13715
|| top_index - fence < 1
13715
13716
|| ! (stacked_ptr = av_fetch(stack,
13716
13717
top_index - 1,
13717
13718
FALSE))
13718
- || IS_OPERAND (*stacked_ptr))
13719
+ || ! IS_OPERATOR (*stacked_ptr))
13719
13720
{
13720
13721
RExC_parse++;
13721
13722
vFAIL("Unexpected '(' with no preceding operator");
@@ -13964,7 +13965,7 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist,
13964
13965
* be an operator */
13965
13966
top_ptr = av_fetch(stack, top_index, FALSE);
13966
13967
assert(top_ptr);
13967
- if (! IS_OPERAND (*top_ptr)) {
13968
+ if (IS_OPERATOR (*top_ptr)) {
13968
13969
13969
13970
/* The only permissible operator at the top of the stack is
13970
13971
* '!', which is applied immediately to this operand. */
@@ -14109,6 +14110,7 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist,
14109
14110
Set_Node_Length(node, RExC_parse - oregcomp_parse + 1); /* MJD */
14110
14111
return node;
14111
14112
}
14113
+ #undef IS_OPERATOR
14112
14114
#undef IS_OPERAND
14113
14115
14114
14116
STATIC void
0 commit comments