@@ -86,15 +86,15 @@ def translate(pat):
86
86
def _translate (pat , star , question_mark ):
87
87
res = []
88
88
add = res .append
89
- indices = []
89
+ star_indices = []
90
90
91
91
i , n = 0 , len (pat )
92
92
while i < n :
93
93
c = pat [i ]
94
94
i = i + 1
95
95
if c == '*' :
96
96
# store the position of the wildcard
97
- indices .append (len (res ))
97
+ star_indices .append (len (res ))
98
98
add (star )
99
99
# compress consecutive `*` into one
100
100
while i < n and pat [i ] == '*' :
@@ -160,18 +160,18 @@ def _translate(pat, star, question_mark):
160
160
else :
161
161
add (_re_escape (c ))
162
162
assert i == n
163
- return res , indices
163
+ return res , star_indices
164
164
165
165
166
- def _join_translated_parts (parts , indices ):
167
- if not indices :
166
+ def _join_translated_parts (parts , star_indices ):
167
+ if not star_indices :
168
168
return fr'(?s:{ "" .join (parts )} )\Z'
169
- iter_indices = iter (indices )
170
- j = next (iter_indices )
169
+ iter_star_indices = iter (star_indices )
170
+ j = next (iter_star_indices )
171
171
buffer = parts [:j ] # fixed pieces at the start
172
172
append , extend = buffer .append , buffer .extend
173
173
i = j + 1
174
- for j in iter_indices :
174
+ for j in iter_star_indices :
175
175
# Now deal with STAR fixed STAR fixed ...
176
176
# For an interior `STAR fixed` pairing, we want to do a minimal
177
177
# .*? match followed by `fixed`, with no possibility of backtracking.
0 commit comments