Created
April 27, 2021 15:46
-
-
Save bwindels/efd0a3368cb35c866e2fad0e0b0720a2 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
| const acorn = require("acorn"); | |
| const walk = require("acorn-walk"); | |
| walk.simple(acorn.parse("const str = this.i18n`foo ${bar} haha`", {sourceType: "module"}), { | |
| // https://github.com/estree/estree/blob/master/es2015.md#template-literals | |
| TaggedTemplateExpression(node) { | |
| console.log("TaggedTemplateExpression:") | |
| console.log(JSON.stringify(node, undefined, 2)); | |
| }, | |
| ImportDeclaration(node) { | |
| console.log("ImportDeclaration:") | |
| console.log(JSON.stringify(node, undefined, 2)); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment