You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
401 B

5 years ago
  1. #!/usr/bin/env node
  2. // This script should reprint the contents of the given file without
  3. // reusing the original source, but with identical AST structure.
  4. var recast = require("recast");
  5. recast.run(function(ast, callback) {
  6. recast.visit(ast, {
  7. visitNode: function(path) {
  8. this.traverse(path);
  9. path.node.original = null;
  10. }
  11. });
  12. callback(ast);
  13. });