Created
December 24, 2014 20:28
-
-
Save beatak/aad8f4dc3410a241205a to your computer and use it in GitHub Desktop.
shift-scope example
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
'use strict'; | |
var program = 'var a = 42;'; | |
var parser = require('shift-parser'); | |
var scope = require('shift-scope'); | |
var ast = parser.default(program); | |
var scopeTree = scope.default(ast); | |
console.log(JSON.stringify(scopeTree, '\n', 2)); |
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
'use strict'; | |
var program = 'var a = 42;'; | |
import parse from "shift-parser"; | |
import analyzeScope from "shift-scope"; | |
let scopeTree = analyzeScope(parse(program)); | |
console.log(JSON.stringify(scopeTree, '\n', 2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment