public final class PassManager extends Object
This arranges all compiler passes into four phases.
HtmlRewritePass
and RewriteGendersPass and other kinds of validation that doesn't require
information about the full file set.
CheckVisibilityPass. Passes should run here if they need to check the relationships
between templates.
The reason things have been divided in this way is partially to create consistency and also to enable other compiler features. For example, for in process (server side) compilation we can cache the results of the single file passes to speed up edit-refresh flows. Also, theoretically, we could run the single file passes for each file in parallel.
A note on ordering. There is no real structure to the ordering of the passes beyond what is
documented in comments. Many passes do rely on running before/after a different pass (e.g. ResolveExpressionTypesVisitor needs to run after ResolveNamesPass), but there isn't any
dependency system in place.
| Modifier and Type | Class and Description |
|---|---|
static class |
PassManager.Builder
A builder for configuring the pass manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
runSingleFilePasses(SoyFileNode file,
IdGenerator nodeIdGen) |
TemplateRegistry |
runWholeFilesetPasses(SoyFileSetNode soyTree)
Runs all the fileset passes including the autoescaper and optimization passes if configured.
|
public void runSingleFilePasses(SoyFileNode file, IdGenerator nodeIdGen)
@CheckReturnValue public TemplateRegistry runWholeFilesetPasses(SoyFileSetNode soyTree)