| 1225 | |
| 1226 | /* Check the halt state STATE match the current context. |
| 1227 | Return 0 if not match, if the node, STATE has, is a halt node and |
| 1228 | match the context, return the node. */ |
| 1229 | |
| 1230 | static int |
| 1231 | internal_function |
| 1232 | check_halt_state_context (const re_match_context_t *mctx, |
| 1233 | const re_dfastate_t *state, int idx) |
| 1234 | { |
| 1235 | int i; |
| 1236 | unsigned int context; |
| 1237 | #ifdef DEBUG |
| 1238 | assert (state->halt); |
| 1239 | #endif |
| 1240 | context = re_string_context_at (&mctx->input, idx, mctx->eflags); |
| 1241 | for (i = 0; i < state->nodes.nelem; ++i) |
| 1242 | if (check_halt_node_context (mctx->dfa, state->nodes.elems[i], context)) |
| 1243 | return state->nodes.elems[i]; |
| 1244 | return 0; |
| 1245 | } |
no test coverage detected