Lines Matching refs:match

193     mp_obj_match_t *match = m_new_obj_var(mp_obj_match_t, char *, caps_num);  in ure_exec()  local
195 memset((char *)match->caps, 0, caps_num * sizeof(char *)); in ure_exec()
196 int res = re1_5_recursiveloopprog(&self->re, &subj, match->caps, caps_num, is_anchored); in ure_exec()
198 m_del_var(mp_obj_match_t, char *, caps_num, match); in ure_exec()
202 match->base.type = &match_type; in ure_exec()
203 match->num_matches = caps_num / 2; // caps_num counts start and end pointers in ure_exec()
204 match->str = args[1]; in ure_exec()
205 return MP_OBJ_FROM_PTR(match); in ure_exec()
289 mp_obj_match_t *match = mp_local_alloc(sizeof(mp_obj_match_t) + caps_num * sizeof(char *)); in re_sub_helper() local
290 match->base.type = &match_type; in re_sub_helper()
291 match->num_matches = caps_num / 2; // caps_num counts start and end pointers in re_sub_helper()
292 match->str = where; in re_sub_helper()
296 memset((char *)match->caps, 0, caps_num * sizeof(char *)); in re_sub_helper()
297 int res = re1_5_recursiveloopprog(&self->re, &subj, match->caps, caps_num, false); in re_sub_helper()
300 if (!res || match->caps[0] == match->caps[1]) { in re_sub_helper()
306 vstr_init(&vstr_return, match->caps[0] - subj.begin); in re_sub_helper()
310 vstr_add_strn(&vstr_return, subj.begin, match->caps[0] - subj.begin); in re_sub_helper()
313 …str((mp_obj_is_callable(replace) ? mp_call_function_1(replace, MP_OBJ_FROM_PTR(match)) : replace)); in re_sub_helper()
336 if (match_no >= (unsigned int)match->num_matches) { in re_sub_helper()
340 const char *start_match = match->caps[match_no * 2]; in re_sub_helper()
343 const char *end_match = match->caps[match_no * 2 + 1]; in re_sub_helper()
357 subj.begin = match->caps[1]; in re_sub_helper()
365 mp_local_free(match); in re_sub_helper()