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

Refactoring PEGjs files into smaller units #271

Merged
merged 3 commits into from
May 9, 2016

Conversation

thec0keman
Copy link
Collaborator

This refactor breaks up the PEGjs files into many smaller units. It is a fairly substantial refactor, however I tried to minimize logic changes and renaming in order to preserve some continuity with the prior code.

The goal of this was:
#1 make the logic easier to understand.
#2 provide a good first step to adding angle-bracket support by abstracting some reusable elements.

This does come with a small penalty to build speed and file size since effectively a lot of code is duplicated at build time.

My approach was to first do several passes on the code trying to break it into smaller pieces. Then, the minimal amount of code was pushed up to the top level to prevent circular dependencies. The effect was that the top level file ends up being a good high level picture of the logic path, and is only 1/3 the LOC.

There is a lot more that could be done, especially in renaming and documentation. However, I wanted to push this up for some feedback to make sure this is heading in the right direction.

Also included are fixes for:

And this is based off of #270.

@thec0keman thec0keman mentioned this pull request Apr 21, 2016
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.

1 participant