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

Rewrite semver parsing #1036

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Rewrite semver parsing #1036

wants to merge 26 commits into from

Conversation

andreypopp
Copy link
Member

This PR rewrites semver version/formula handling from ad-hoc/angstrom parsers to ocamllex/menhir.

Why:

  • Maintaining menhir grammar specifications is easier than ad-hoc parsers and menhor provides us with location info (something angstrom lacks by design) so we also going to get better error messages.

  • We can get rid of some 3rd party dependencies eventually (menhir parsers can be "ejected")

  • The AST for formulas keeps more info now which might be handy later for programmatic modifications of package.json (bump ranges and so on).

I'm introducing a new semver library here which I want to promote to a package later (we are going to link-dev: it into esy but it can be also released separately).

Before merging this I plan to test it on a dump of npm registry metadata to make sure parser can handle all the variety.

@andreypopp andreypopp marked this pull request as ready for review January 7, 2020 23:18
@andreypopp
Copy link
Member Author

I think this is ready for review. I've ported subset of the test suite from node-semver and made it pass. Before merging I still want to check parsers on an npm metadata dump.

Copy link
Member

@ManasJayanth ManasJayanth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could only take a shallow look. Looks amazing! Very nice packaged (and tested)

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

Successfully merging this pull request may close these issues.

None yet

2 participants