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

core: Extract AttrParser out of Parser #1211

Merged
merged 5 commits into from Jul 5, 2023
Merged

Conversation

math-fehr
Copy link
Collaborator

This PR moves the attribute parsing functions out of Parser, and moves them to a new AttrParser.
AttrParser is now given to attributes and types, so all the unrelated methods are not shown anymore in the IDE.
Also, this cleans up a bit the file as we now have two smaller files instead of a huge one.

There are no changes in the methods moved to AttrParser, so no need to review the content of the methods moved.

@math-fehr math-fehr added the core xDSL core (ir, textual format, ...) label Jun 27, 2023
@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Patch coverage: 77.67% and project coverage change: -0.08 ⚠️

Comparison is base (de9d4c9) 89.01% compared to head (c3260fe) 88.93%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1211      +/-   ##
==========================================
- Coverage   89.01%   88.93%   -0.08%     
==========================================
  Files         174      175       +1     
  Lines       23545    23585      +40     
  Branches     3560     3567       +7     
==========================================
+ Hits        20958    20975      +17     
- Misses       2020     2043      +23     
  Partials      567      567              
Impacted Files Coverage Δ
xdsl/dialects/memref.py 86.11% <50.00%> (ø)
xdsl/ir/core.py 87.76% <66.66%> (ø)
xdsl/parser/attribute_parser.py 75.26% <75.26%> (ø)
xdsl/dialects/builtin.py 84.73% <87.50%> (ø)
tests/test_attribute_definition.py 95.48% <100.00%> (ø)
tests/test_printer.py 98.31% <100.00%> (ø)
tests/test_pyrdl.py 96.79% <100.00%> (ø)
xdsl/dialects/experimental/dmp.py 50.49% <100.00%> (ø)
xdsl/dialects/experimental/fir.py 84.24% <100.00%> (ø)
xdsl/dialects/gpu.py 98.76% <100.00%> (ø)
... and 8 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@webmiche webmiche 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 surprised. Don't we have parser specific tests? Shouldn't those be split as well? o/w LGTM.

@math-fehr
Copy link
Collaborator Author

I'm surprised. Don't we have parser specific tests? Shouldn't those be split as well? o/w LGTM.

Right now, Parser inherits from AttrParser, so that's why nothing had to be changed!
We might want to rename Parser into OpParser and then make both AttrParser and OpParser inherit from the BaseParser. However, that should be done in multiple steps here I believe!

@math-fehr
Copy link
Collaborator Author

(I'm waiting for #1210 to be merged to merge this, as these are conflicting)

Copy link
Collaborator

@AntonLydike AntonLydike left a comment

Choose a reason for hiding this comment

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

👍

@math-fehr math-fehr merged commit 092d23d into main Jul 5, 2023
10 checks passed
@math-fehr math-fehr deleted the fehr/split-attr-parserr branch July 5, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants