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

Function lower_subexps

compat/regex/regcomp.c:1318–1338  ·  view source on GitHub ↗

Lowering pass: Turn each SUBEXP node into the appropriate concatenation of OP_OPEN_SUBEXP, the body of the SUBEXP (if any) and OP_CLOSE_SUBEXP. */

Source from the content-addressed store, hash-verified

1316 if (other_idx < BITSET_WORD_BITS)
1317 dfa->used_bkref_map &= ~((bitset_word_t) 1 << other_idx);
1318 }
1319
1320 return REG_NOERROR;
1321}
1322
1323/* Lowering pass: Turn each SUBEXP node into the appropriate concatenation
1324 of OP_OPEN_SUBEXP, the body of the SUBEXP (if any) and OP_CLOSE_SUBEXP. */
1325static reg_errcode_t
1326lower_subexps (void *extra, bin_tree_t *node)
1327{
1328 regex_t *preg = (regex_t *) extra;
1329 reg_errcode_t err = REG_NOERROR;
1330
1331 if (node->left && node->left->token.type == SUBEXP)
1332 {
1333 node->left = lower_subexp (&err, preg, node->left);
1334 if (node->left)
1335 node->left->parent = node;
1336 }
1337 if (node->right && node->right->token.type == SUBEXP)
1338 {
1339 node->right = lower_subexp (&err, preg, node->right);
1340 if (node->right)
1341 node->right->parent = node;

Callers

nothing calls this directly

Calls 1

lower_subexpFunction · 0.85

Tested by

no test coverage detected