Templates::DependencyVisitor
A visitor over a parsed template's AST that collects references to other templates, following crinja's visitor pattern (see Crinja::Visitor and Visitor::Inspector). The parser AST has no accept method, so this visitor owns the traversal itself.
Only statically resolvable references (string literals) are collected: a dynamic reference like {% include somevar %} can't be tracked without rendering, so it is skipped (and logged at debug level) instead of producing a bogus dependency.
Constants
REFERENCE_TAGS = {"include", "extends", "import", "from"}
Tags whose string literal arguments name other templates
Constructors
Instance methods
Parse source and return the kv:// keys of all referenced templates, deduplicated and sorted. Self-references (a template including itself) are skipped.
visit(node : AST::NodeList)
Sourcevisit(node : AST::TagNode)
Sourcevisit(node : AST::TemplateNode)
Source