Skip to content

Instantly share code, notes, and snippets.

@zxqx
Created May 5, 2015 19:42
Show Gist options
  • Save zxqx/e9c8ce4e518f27b1e0fb to your computer and use it in GitHub Desktop.
Save zxqx/e9c8ce4e518f27b1e0fb to your computer and use it in GitHub Desktop.
var fs = require('fs');
var acorn = require('./node_modules/babel/node_modules/babel-core/lib/acorn');
require('./node_modules/babel/node_modules/babel-core/lib/acorn/plugins/flow.js');
var T = fs.readFileSync('./T.js');
var ast = acorn.parse(T, {
ecmaVersion: 7,
sourceType: 'module',
plugins: {
flow: true
},
features: {
'es7.asyncFunctions': true
}
});
console.log(ast);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment