mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 11:13:43 +03:00
14 lines
348 B
JavaScript
14 lines
348 B
JavaScript
// File to parse input as an AST using acorn
|
|
|
|
const parserOptions = {
|
|
ranges: true,
|
|
locations: true,
|
|
ecmaVersion: "latest",
|
|
// https://github.com/tc39/proposal-hashbang
|
|
allowHashBang: true,
|
|
};
|
|
|
|
const acorn = require("acorn");
|
|
const res = acorn.parse(process.argv[1], parserOptions);
|
|
console.log(JSON.stringify(res, void 0, 2));
|