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: Move assembly format type parsing to directives #3516

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

alexarice
Copy link
Collaborator

Went slightly too far on the previous refactor. I think this level of abstraction works well for allowing parse errors to be put in the correct place. PRs for operands, results, and functional-type directives to follow based on this PR.

@alexarice alexarice added the core xDSL core (ir, textual format, ...) label Nov 25, 2024
@alexarice alexarice self-assigned this Nov 25, 2024
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.33%. Comparing base (ef12f04) to head (a2cc01f).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3516      +/-   ##
==========================================
- Coverage   90.33%   90.33%   -0.01%     
==========================================
  Files         464      464              
  Lines       58076    58160      +84     
  Branches     5552     5555       +3     
==========================================
+ Hits        52464    52537      +73     
- Misses       4184     4194      +10     
- Partials     1428     1429       +1     

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


@abstractmethod
def set_types(self, types: Sequence[Attribute], state: ParsingState) -> None: ...
def parse_single_type(self, parser: Parser, state: ParsingState) -> None: ...
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure on the names parse_single_type and parse_many_types but couldn't think of anything better. I didn't want to go with parse_type and parse_types as the signatures are quite similar and this could cause confusion.

Copy link
Member

Choose a reason for hiding this comment

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

They're not fantastically beautiful but they are quite clear, which is the most important thing. One thing to consider would be parse_type/parse_type_list

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think I feel strongly either way. Happy to change it if you'd like me to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Going to go ahead and merge, can always refactor names later (will be easier to do at once with the following PRs in if we want to do it).

@alexarice alexarice merged commit a44a424 into main Nov 27, 2024
15 checks passed
@alexarice alexarice deleted the alexarice/assembly-parse-type branch November 27, 2024 10:41
EdmundGoodman pushed a commit to EdmundGoodman/xdsl that referenced this pull request Dec 6, 2024
This level of abstraction works well for allowing parse errors to be put in the
correct place.
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.

2 participants