All files / transform transform.js

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18                        3x 3x   3x    
import VSLPreprocessor from './transformers/vslpreprocessor';
import VSLTransformer from './transformers/vsltransformer';
 
/**
 * Performs transformation on a given AST root array. By default the parser will
 * output the top-level AST result as a `CodeBlock[]`, so you can just pass the
 * parser output into here safely. Don't forget to load in the STL (by inserting
 * it into the CodeBlock).
 * 
 * @param {CodeBlock[]} ast - The AST 
 */
export default function transform(ast: CodeBlock[]) {
    let preprocessor = new VSLPreprocessor();
    preprocessor.queue(ast);
 
    new VSLTransformer(preprocessor.context).queue(ast);
}