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: Fix extractor logic for optional and default-valued properties #3525

Merged
merged 3 commits into from
Nov 28, 2024

Conversation

alexarice
Copy link
Collaborator

The extractor used in the assembly parser assumed that all properties/attributes were present. We should instead only propagate the extractors from the property constraint if the property is non-optional or there is a default value. The default_value also needs to be given to the extractor for when the property is not present.

Adds 2 tests to demonstrate this.

@alexarice alexarice added bug Something isn't working core xDSL core (ir, textual format, ...) labels Nov 27, 2024
@alexarice alexarice self-assigned this Nov 27, 2024
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.33%. Comparing base (158cfe1) to head (d6b7a5c).
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3525   +/-   ##
=======================================
  Coverage   90.33%   90.33%           
=======================================
  Files         464      464           
  Lines       58169    58197   +28     
  Branches     5559     5561    +2     
=======================================
+ Hits        52546    52575   +29     
  Misses       4192     4192           
+ Partials     1431     1430    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

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

Nice!

@superlopuh superlopuh merged commit d365db8 into main Nov 28, 2024
15 checks passed
@superlopuh superlopuh deleted the alexarice/prop-extractors branch November 28, 2024 22:51
EdmundGoodman pushed a commit to EdmundGoodman/xdsl that referenced this pull request Dec 6, 2024
…dslproject#3525)

The extractor used in the assembly parser assumed that all
properties/attributes were present. We should instead only propagate the
extractors from the property constraint if the property is non-optional
or there is a default value. The default_value also needs to be given to
the extractor for when the property is not present.

Adds 2 tests to demonstrate this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core xDSL core (ir, textual format, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants