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

[FIRRTL] Refactor parseModule into multiple functions #5710

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

rwy7
Copy link
Contributor

@rwy7 rwy7 commented Jul 27, 2023

In the FIRParser, the parseModule function is responsible for parsing all kinds of modules (int, ext, and normal). This PR breaks that code into multiple functions, trading some code duplication for readability. This will make it easier to parse classes, another module-like declaration which are being added to FIRRTL.

Also adds some additional error checking for types and group indentation.

In the FIRParser, the parseModule function is responsible for parsing all kinds
of modules (int, ext, and normal). This PR breaks that code into multiple
functions, trading some code duplication for readability. This will make it
easier to parse classes, another module-like declaration which are being added
to FIRRTL.
Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

I'm not super familiar with the FIRRTL parser but this looks like a straight refactor with some minor fixes, so it makes sense to me.

Copy link
Contributor

@dtzSiFive dtzSiFive left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the cleanup/reorg! 👍

@rwy7 rwy7 merged commit e987f48 into llvm:main Jul 28, 2023
5 checks passed
@rwy7 rwy7 deleted the parse-refactor branch July 28, 2023 00:59
@rwy7 rwy7 added the FIRRTL Involving the `firrtl` dialect label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIRRTL Involving the `firrtl` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants