Skip to content

Commit 2e4b163

Browse files
committed
RExC_state_t: convert in_lookaround to boolean
1 parent b6ec6bc commit 2e4b163

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

regcomp.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
16921692

16931693
RExC_seen = 0;
16941694
RExC_maxlen = 0;
1695-
RExC_in_lookaround = 0;
1695+
RExC_in_lookaround = false;
16961696
RExC_seen_zerolen = *exp == '^' ? -1 : 0;
16971697
RExC_recode_x_to_native = 0;
16981698
RExC_in_multi_char_class = 0;
@@ -2945,7 +2945,7 @@ S_handle_named_backref(pTHX_ RExC_state_t *pRExC_state,
29452945
* If the construct is empty generates a NOTHING op and returns its
29462946
* regnode_offset, which the caller would then return to its caller.
29472947
*
2948-
* If the construct is not empty increments RExC_in_lookaround, and turns
2948+
* If the construct is not empty sets RExC_in_lookaround, and turns
29492949
* on any flags provided in RExC_seen, and then returns 0 to signify
29502950
* that parsing should continue.
29512951
*
@@ -2976,7 +2976,7 @@ S_reg_la_NOTHING(pTHX_ RExC_state_t *pRExC_state, U32 flags,
29762976
}
29772977

29782978
RExC_seen |= flags;
2979-
RExC_in_lookaround++;
2979+
RExC_in_lookaround = true;
29802980
return 0; /* keep parsing! */
29812981
}
29822982

@@ -2993,7 +2993,7 @@ S_reg_la_NOTHING(pTHX_ RExC_state_t *pRExC_state, U32 flags,
29932993
* If the construct is empty generates an OPFAIL op and returns its
29942994
* regnode_offset which the caller should then return to its caller.
29952995
*
2996-
* If the construct is not empty increments RExC_in_lookaround, and also
2996+
* If the construct is not empty sets RExC_in_lookaround, and also
29972997
* increments RExC_seen_zerolen, and turns on the flags provided in
29982998
* RExC_seen, and then returns 0 to signify that parsing should continue.
29992999
*
@@ -3026,7 +3026,7 @@ S_reg_la_OPFAIL(pTHX_ RExC_state_t *pRExC_state, U32 flags,
30263026
* does not match ever. */
30273027
RExC_seen_zerolen++;
30283028
RExC_seen |= flags;
3029-
RExC_in_lookaround++;
3029+
RExC_in_lookaround = true;
30303030
return 0; /* keep parsing! */
30313031
}
30323032

@@ -3105,7 +3105,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp, U32 depth)
31053105
I32 after_freeze = 0;
31063106
I32 num; /* numeric backreferences */
31073107
SV * max_open; /* Max number of unclosed parens */
3108-
I32 was_in_lookaround = RExC_in_lookaround;
3108+
bool was_in_lookaround = RExC_in_lookaround;
31093109
I32 fake_eval = 0; /* matches paren */
31103110

31113111
/* The difference between the following variables can be seen with *
@@ -3427,7 +3427,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp, U32 depth)
34273427
}
34283428

34293429
RExC_seen_zerolen++;
3430-
RExC_in_lookaround++;
3430+
RExC_in_lookaround = true;
34313431
RExC_seen |= seen_flag_set;
34323432

34333433
RExC_parse_set(start_arg);

regcomp_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ struct RExC_state_t {
140140
U8 *study_chunk_recursed; /* bitmap of which subs we have moved
141141
through */
142142
U32 study_chunk_recursed_bytes; /* bytes in bitmap */
143-
I32 in_lookaround;
143+
bool in_lookaround;
144144
I32 contains_locale;
145145
I32 recode_x_to_native;
146146
I32 in_multi_char_class;

0 commit comments

Comments
 (0)