| 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 | |
| 2463 | static re_dfastate_t * |
| 2464 | transit_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; |
no test coverage detected