

def parse_blocks(self):
    '\n        Parse template blocks for block tags.\n\n        Example:\n            {% a %} b {% c %} d {% e %} f {% g %}\n             => pre_c: b\n                pre_e: d\n                pre_g: f\n            {% a %} b {% f %}\n             => pre_c: b\n                pre_e: None\n                pre_g: None\n        '
    if (not self.options.blocks):
        return
    blocks = deepcopy(self.options.blocks)
    identifiers = {
        
    }
    for block in blocks:
        identifiers[block] = block.collect(self)
    while blocks:
        current_block = blocks.pop(0)
        current_identifiers = identifiers[current_block]
        block_identifiers = list(current_identifiers)
        for block in blocks:
            block_identifiers += identifiers[block]
        nodelist = self.parser.parse(block_identifiers)
        token = self.parser.next_token()
        while (token.contents not in current_identifiers):
            empty_block = blocks.pop(0)
            current_identifiers = identifiers[empty_block]
            self.blocks[empty_block.alias] = template.NodeList()
        block.blocks[current_block.alias] = nodelist

dataset/ETHPy150Open ojii/django-classy-tags/classytags/parser.py Parser.parse_blocks/VarMisuse@173/339 `self`->`block`