##// END OF EJS Templates
templater: add no-op template function 'label'
Sean Farley -
r18289:9bfb5310 default
parent child Browse files
Show More
@@ -265,6 +265,15 b' def ifeq(context, mapping, args):'
265 t = stringify(args[3][0](context, mapping, args[3][1]))
265 t = stringify(args[3][0](context, mapping, args[3][1]))
266 yield runtemplate(context, mapping, compiletemplate(t, context))
266 yield runtemplate(context, mapping, compiletemplate(t, context))
267
267
268 def label(context, mapping, args):
269 if len(args) != 2:
270 # i18n: "label" is a keyword
271 raise error.ParseError(_("label expects two arguments"))
272
273 # ignore args[0] (the label string) since this is supposed to be a a no-op
274 t = stringify(args[1][0](context, mapping, args[1][1]))
275 yield runtemplate(context, mapping, compiletemplate(t, context))
276
268 methods = {
277 methods = {
269 "string": lambda e, c: (runstring, e[1]),
278 "string": lambda e, c: (runstring, e[1]),
270 "symbol": lambda e, c: (runsymbol, e[1]),
279 "symbol": lambda e, c: (runsymbol, e[1]),
@@ -280,6 +289,7 b' funcs = {'
280 "ifeq": ifeq,
289 "ifeq": ifeq,
281 "join": join,
290 "join": join,
282 "sub": sub,
291 "sub": sub,
292 "label": label,
283 }
293 }
284
294
285 # template engine
295 # template engine
General Comments 0
You need to be logged in to leave comments. Login now