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

Move parser helpers to irfmt::parsers #29

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

urso
Copy link
Contributor

@urso urso commented Feb 8, 2024

This is an intermediary step backporting some changes from #20 into main.

This PR focuses on moving the existing parsers into the irfmt::parsers module. Idea is to have parsers (and helpers) under the irfmt module for discoverability, similar to the irfmt::printers module.

In addition to that I implemented the Parsable trait for AttrObj and Ptr<TypeObj> by copying the former attr_parse and type_parse function as is into the trait. I did this change to improve symmetry: If a type implements Printable, then it should implement Parsable as well.

Besides implementing Parsable for the 2 types there is no change in the implementation logic. Just moving symbols around.

@vaivaswatha vaivaswatha closed this Feb 8, 2024
@vaivaswatha vaivaswatha reopened this Feb 8, 2024
@vaivaswatha vaivaswatha merged commit 88b13e2 into vaivaswatha:master Feb 8, 2024
10 checks passed
@urso urso deleted the move-parsers-to-irfmt branch February 18, 2024 00:56
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