The template being analyzed.
A map from a local name for the block to the Block. The local name must be a legal CSS ident/class name but this is not validated here. See CLASS_NAME_IDENT for help validating a legal class name.
The current element, created when calling startElement. The current element is unset after calling endElement.
A per-element correlation of styles used. The current correlation is added to this list when endElement is called.
Template validator instance to verify blocks applied to an element.
Return the number of blocks discovered in this Template.
All bhe blocks this block depends on. Same as referenced blocks except for the return type.
Return the number of elements discovered in this Analysis.
Finish an {ElementAnalysis} object returned from Analysis.startElement
to
the end location in source and save {Style} usage on the parent {Analysis}.
The {ElementAnalysis} we are finishing.
Optional. The location in code where this element tag is closed..
Given a {SourcePosition}, ensure that the file name is present. If not, add the template identifier.
Convenience getter for fetching a block from the template scope.
Returns the local name of the provided in this Analysis' template.
The block for which the local name should be returned.
The local name of the given block.
Get the nth element discovered in this Analysis.
Get an Element by ID.
All the blocks referenced by this analysis.
Generates a [[SerializedTemplateAnalysis]] for this analysis.
The local name for the block object using the local prefix for the block.
Get a new {ElementAnalysis} object to track an individual element's {Style}
consumption in this {Analysis}' template. Every {ElementAnalysis} returned from
Analysis.startElement
must be passed to Analysis.endElement
before startElement
is called again.
The {SourceLocation} of this element in the template.
Optional. The tag name of the element being represented by this {ElementAnalysis}.
A new {ElementAnalysis}.
Return the number of styles discovered in this Analysis' Template. TODO: This is slow. We can pre-compute this as elements are added.
All the blocks referenced by this block and all the blocks they reference recursively.
Creates a TemplateAnalysis from its serialized form.
The analysis to be recreated.
Generated using TypeDoc
An Analysis performs book keeping and ensures internal consistency of the block objects referenced within a single template. It is designed to be used as part of an AST walk over a template.