def parse(self, text, info=None):
    'Parses the text string, text, and returns a dictionary\n        representing the compiled template block(s) as Python code, in the\n        format expected by template.document.\n        '
    self.defblock = {}
    self.metadata = {}
    tokens = self.split_text(text)
    if (tokens is None):
        return None
    self.fileinfo.append(info)
    block = self._parse(tokens, info)
    self.fileinfo.pop()
    if block:
        return {'BLOCK': block, 'DEFBLOCKS': self.defblock, 'METADATA': self.metadata}
    else:
        return None
Parses the text string, text, and returns a dictionary
representing the compiled template block(s) as Python code, in the
format expected by template.document.
def parse(self, text, info=None):
    'Parses the text string, text, and returns a dictionary\n        representing the compiled template block(s) as Python code, in the\n        format expected by template.document.\n        '
    self.defblock = {}
    self.metadata = {}
    tokens = self.split_text(text)
    if (tokens is None):
        return None
    self.fileinfo.append(info)
    block = self._parse(tokens, info)
    self.fileinfo.pop()
    if block:
        return {'BLOCK': block, 'DEFBLOCKS': self.defblock, 'METADATA': self.metadata}
    else:
        return None