def parse(cls, parser, token):
tokens = token.split_contents()
tokens.pop(0) # Pop the tag name.
def make_variable(name):
return template.Variable(name)
def not_using(bit):
return bit != "using"
template_name_variables = map(make_variable, filter(
not_using,
takewhile(not_using, tokens)))
hint_provider_variables = map(make_variable, filter(
not_using,
dropwhile(not_using, tokens)))
return cls(template_name_variables, hint_provider_variables)
评论列表
文章目录