Parses the given template using the jinja environment of the given app
    and returns the AST. ASTs are cached in parse_template.cache

def parse_template(app, filename):
    """Parses the given template using the jinja environment of the given app
    and returns the AST. ASTs are cached in parse_template.cache
    """
    if not hasattr(parse_template, "cache"):
        parse_template.cache = {}
    if filename not in parse_template.cache:
        source = get_template_source(app, filename)
        parse_template.cache[filename] = app.jinja_env.parse(source, filename=filename)
    return parse_template.cache[filename]