MCPcopy Create free account
hub / github.com/git/git / transit_state_sb

Function transit_state_sb

compat/regex/regexec.c:2459–2494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2457}
2458
2459#if 0
2460/* Return the next state to which the current state STATE will transit by
2461 accepting the current input byte. */
2462
2463static re_dfastate_t *
2464transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx,
2465 re_dfastate_t *state)
2466{
2467 const re_dfa_t *const dfa = mctx->dfa;
2468 re_node_set next_nodes;
2469 re_dfastate_t *next_state;
2470 int node_cnt, cur_str_idx = re_string_cur_idx (&mctx->input);
2471 unsigned int context;
2472
2473 *err = re_node_set_alloc (&next_nodes, state->nodes.nelem + 1);
2474 if (BE (*err != REG_NOERROR, 0))
2475 return NULL;
2476 for (node_cnt = 0; node_cnt < state->nodes.nelem; ++node_cnt)
2477 {
2478 int cur_node = state->nodes.elems[node_cnt];
2479 if (check_node_accept (mctx, dfa->nodes + cur_node, cur_str_idx))
2480 {
2481 *err = re_node_set_merge (&next_nodes,
2482 dfa->eclosures + dfa->nexts[cur_node]);
2483 if (BE (*err != REG_NOERROR, 0))
2484 {
2485 re_node_set_free (&next_nodes);
2486 return NULL;
2487 }
2488 }
2489 }
2490 context = re_string_context_at (&mctx->input, cur_str_idx, mctx->eflags);
2491 next_state = re_acquire_state_context (err, dfa, &next_nodes, context);
2492 /* We don't need to check errors here, since the return value of
2493 this function is next_state and ERR is already set. */
2494
2495 re_node_set_free (&next_nodes);
2496 re_string_skip_bytes (&mctx->input, 1);
2497 return next_state;

Callers 1

internal_functionFunction · 0.85

Calls 5

re_node_set_allocFunction · 0.85
check_node_acceptFunction · 0.85
re_node_set_mergeFunction · 0.85
re_string_context_atFunction · 0.85
re_acquire_state_contextFunction · 0.85

Tested by

no test coverage detected