- if tag == 'container':
- return ContainerNode(name, references, as_var)
-
- nodelist_main = parser.parse(('empty','endblockcontainer',))
- token = parser.next_token()
-
- if token.contents == 'empty':
- nodelist_empty = parser.parse(('endblockcontainer',))
- parser.delete_first_token()
- else:
- nodelist_empty = None
- return ContainerNode(name, references, as_var, nodelist_main, nodelist_empty)