249 raise error.ParseError(_("sub expects three arguments")) |
249 raise error.ParseError(_("sub expects three arguments")) |
250 |
250 |
251 pat = stringify(args[0][0](context, mapping, args[0][1])) |
251 pat = stringify(args[0][0](context, mapping, args[0][1])) |
252 rpl = stringify(args[1][0](context, mapping, args[1][1])) |
252 rpl = stringify(args[1][0](context, mapping, args[1][1])) |
253 src = stringify(args[2][0](context, mapping, args[2][1])) |
253 src = stringify(args[2][0](context, mapping, args[2][1])) |
|
254 src = stringify(runtemplate(context, mapping, |
|
255 compiletemplate(src, context))) |
254 yield re.sub(pat, rpl, src) |
256 yield re.sub(pat, rpl, src) |
255 |
257 |
256 def if_(context, mapping, args): |
258 def if_(context, mapping, args): |
257 if not (2 <= len(args) <= 3): |
259 if not (2 <= len(args) <= 3): |
258 # i18n: "if" is a keyword |
260 # i18n: "if" is a keyword |