Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backward traversal #39

Open
drom opened this issue Jan 31, 2015 · 1 comment
Open

backward traversal #39

drom opened this issue Jan 31, 2015 · 1 comment

Comments

@drom
Copy link

drom commented Jan 31, 2015

First, thank you for very elegant, concise, and useful tool. I use both tools: estraverse and recently shift-traverse for my projects.

One thing that I am missing is backward AST traversal. IMHO It will be useful for the static code analysis algorithms like lazy SSA construction or definition search.

What do you think?

@a-x-
Copy link

a-x- commented Jul 8, 2016

Hey, @drom,
I see, you're in theme, but I am a novice.
do you know also, are there backward AST generation algorithms?

I build AST locally backward and forward from the point on target node in large (and possibly not correct at all) source code file.

e.g.:

var c conosle.log.bind(console); // far away mistaken statement
... // about 100 sloc
foo({ bar:1, baz: 2, qux: 42 });
//                        ^ Starts AST-generation here for ObjectExpression

I use acorn.parseExpressionAt and some heuristics for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants