MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / expand_template

Function expand_template

tools/python-3.11.9-amd64/Lib/re/_parser.py:1099–1109  ·  view source on GitHub ↗
(template, match)

Source from the content-addressed store, hash-verified

1097 return groups, literals
1098
1099def expand_template(template, match):
1100 g = match.group
1101 empty = match.string[:0]
1102 groups, literals = template
1103 literals = literals[:]
1104 try:
1105 for index, group in groups:
1106 literals[index] = g(group) or empty
1107 except IndexError:
1108 raise error("invalid group reference %d" % index) from None
1109 return empty.join(literals)

Callers

nothing calls this directly

Calls 3

errorClass · 0.70
gFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected