Created
June 8, 2023 05:07
-
-
Save rayepeng/a8ce84b76f61cf4b66e4144f60bc623c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function walkAST(ast, before, after, options){ | |
parents.unshift(ast); | |
switch (ast.type) { | |
case 'NamedBlock': | |
case 'Block': | |
ast.nodes = walkAndMergeNodes(ast.nodes); | |
break; | |
case 'Case': | |
case 'Filter': | |
case 'Mixin': | |
case 'Tag': | |
case 'InterpolatedTag': | |
case 'When': | |
case 'Code': | |
case 'While': | |
if (ast.block) { // here!!! | |
ast.block = walkAST(ast.block, before, after, options); | |
} | |
break; | |
case 'Text': | |
break; | |
} | |
parents.shift(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment