LiveData.Tracked.FlatAst.Pass.RewriteAst (live_data v0.1.0-alpha0)
Must be given a normalized (Expr.Scope only, no Expr.Block) FlatAST.
Will traverse the AST from the return position, rewriting static chunks into templates and rewrite the AST to return those templates.
This is done in three subpasses:
- MakeStructure - This is what traverses the AST from return position and generates the templates. No rewriting is done here, data is just collected for the later subpasses.
- ExpandDependencies - Expands the set of dependencies of the statics we extracted in subpass 1 into cumulative dependency sets. These cumulative dependency sets are what we will use later on when deciding what needs to be included in the rewritten function.
- RewriteScope - This is the subpass that actually performs the rewrite. The data from the other two subpasses is used here. The return value is the rewritten AST.
Link to this section Summary
Link to this section Functions
Link to this function