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

refactor parser codegen #497

Merged
merged 1 commit into from
Jun 16, 2023
Merged

refactor parser codegen #497

merged 1 commit into from
Jun 16, 2023

Conversation

OmarTawfik
Copy link
Contributor

@OmarTawfik OmarTawfik commented Jun 12, 2023

  • move parsing tokens to a common function
  • remove the need to pass token names as static strings everywhere, since we already have strum::AsRefStr deriver

This decreases nesting, improves readability of the parser code, and decreases the generated code by roughly 30%.
But most importantly, it unblocks #498 and #500 by making it easier to generate named or unnamed nodes at each parser root.

@changeset-bot
Copy link

changeset-bot bot commented Jun 12, 2023

⚠️ No Changeset found

Latest commit: 7e9ed20

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@OmarTawfik OmarTawfik marked this pull request as ready for review June 12, 2023 14:30
@OmarTawfik OmarTawfik requested a review from a team as a code owner June 12, 2023 14:30
Base automatically changed from search-quick-open to main June 16, 2023 01:21
- move parsing tokens to a common function
- remove the need to pass token names as static strings everywhere, since we already have `strum` AsRefStr` deriver

This decreases nesting, improves readability of the parser code, and decreases the generated code by roughly 30%.
@OmarTawfik OmarTawfik force-pushed the refactor-parser-codegen branch from 67ed043 to 7e9ed20 Compare June 16, 2023 03:32
@OmarTawfik OmarTawfik enabled auto-merge June 16, 2023 03:37
@OmarTawfik OmarTawfik added this pull request to the merge queue Jun 16, 2023
Merged via the queue into main with commit 40c3daf Jun 16, 2023
@OmarTawfik OmarTawfik deleted the refactor-parser-codegen branch June 16, 2023 03:50
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.

2 participants