def parse(self, parser):
lineno = next(parser.stream).lineno
# get the context
context = nodes.ContextReference()
# get the arguments
args = [context]
try:
while True:
args.append(parser.parse_expression())
except TemplateSyntaxError:
pass # no more arguments
# get the tag_name for use in looking up callable
self.active_tag = parser._tag_stack[-1]
# create the node
node = self.call_method('_invoke_tag', args=args, lineno=lineno)
return nodes.Output(
[node],
lineno=lineno
)
评论列表
文章目录