Pass system for Astral
Pass helper for Astral that simplifies traversal.
Below is a simple example.
var myPass = require'astral-pass';myPassname = 'myPass';myPassprereqs = /* other pass names here */ ;myPasswhen// ... AST chunkwhen// return true or falsedo;
You can introduce more complicated behavior by composing passes.
This is done by modifying a pass's
var astralPass = require'astral-pass';// p1 needs some info to do its transformationsvar p1 = astralPass;p1name = 'myPass';p1prereqs = 'p2' ;p1whendo ;// p2 gathers the info for p1var p2 = astralPass;p2name = 'myPass';p2whendo ;
I recommend namespacing passes with