-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Switch to Acorn #200
Comments
👏 Cool, let me know if you need any specific help! |
I'm going to try to dig into this this week and hopefully will have some tasks you can chip in on. In the meantime, take a look at the |
Working on this. |
As a side note, I'm going to remove |
Getting close, waiting on a few compat fixes: estree/estree#98 |
Should this be noted in the README? It doesn't seem to be up to date in light of this bug. |
whoa @nzakas you got that done super fast |
The readme will be updated when the work complete. |
So we should be able to merge anything in https://github.com/babel/acorn-to-esprima so that babel-eslint/babel-jscs only deals with flow/es7 stuff? |
I'm not sure what you mean, can you explain some more? |
@xjamundx I had done some early work a while back, and @RReverser did a bunch as well. I just started from where we left off and fixed failing tests. :) |
I was thinking we could use espree in babel-eslint if we could move the functionality there. Like for the template string issues you'll probably find https://github.com/babel/acorn-to-esprima/blob/master/src/convertTemplateType.js. https://github.com/eslint/espree/blob/b8576c6260401b52b392e0df70932dd0c4ccb9d7/espree.js#L351 is from https://github.com/babel/acorn-to-esprima/blob/master/src/toToken.js I guess I thought espree could use acorn-to-esprima methods so it's a single place to make updates but I guess not? |
There's definitely some things that useful, but the overall approach we're taking is a bit different. Here's the latest: https://github.com/eslint/espree/blob/issue200/espree.js In short, we're doing the conversion on-the-fly instead of after the fact, which allows us to more easily mimic what Espree is doing today in terms of |
Ok cool I see |
Basically done with this. Now just waiting for the various issues/PRs on Acorn and Acorn-JSX to land to fix the remaining broken tests. |
Getting closer on this. A bunch of my changes have been merged into Acorn. There are a couple of edge cases I'm still working on, mostly having to do with template strings. Hopefully will have this done in the next couple of weeks. |
Even closer than I thought after the recent Acorn release. There are just a couple of failing tests left for |
Just waiting for one bug fix from Acorn: acornjs/acorn#345 |
Working through some perf issues. As it is, this is slower than existing Espree. I've been working on cutting the time down and I'm pretty close. With Espree 2.x:
With Espree 3.x:
|
tl;dr I'm stopping work on bugs to convert Espree over to be powered by Acorn.
There's a lot of time and energy required to maintain a parser. It was never the intent of Espree to need to exist and since Esprima came back to life, the intent was to wait for Esprima to provide the hooks Espree needed to make the changes we'd need to continue functioning in the same way. That's taken a lot longer than we thought (still not on the roadmap), and so Espree has lingered on.
We'd like to get to a point where Espree is basically just a thin layer on top of an already-existing parser. As it turns out, Acorn already has the hooks we need to do that. So, in the interest of supporting an already-existing and well-supported parser, I'll start working on moving Espree to be built on top of Acorn. The intent is to provide the exact same interface that Espree currently has, effectively turning Espree into a translation layer between Acorn and Esprima outputs.
Things to get working:
superInFunctions(removed)The text was updated successfully, but these errors were encountered: