Skip to content

core: (attr assembly fmt) add whitespace directive#6248

Merged
n-io merged 2 commits into
mainfrom
nicolai/attr-asm-fmt-structural-directives
Jul 13, 2026
Merged

core: (attr assembly fmt) add whitespace directive#6248
n-io merged 2 commits into
mainfrom
nicolai/attr-asm-fmt-structural-directives

Conversation

@n-io

@n-io n-io commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Adds AttrWhitespaceDirective to declarative assembly format for attributes.

WIP:

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.89%. Comparing base (62ce0be) to head (9ab0978).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6248   +/-   ##
=======================================
  Coverage   86.88%   86.89%           
=======================================
  Files         431      431           
  Lines       64599    64628   +29     
  Branches     7396     7402    +6     
=======================================
+ Hits        56130    56159   +29     
  Misses       6897     6897           
  Partials     1572     1572           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +81 to +88
def test_error_invalid_whitespace():
with pytest.raises(ParseError, match="unexpected whitespace in directive"):
_program("` `")


def test_error_not_a_whitespace_directive():
with pytest.raises(ParseError, match="expected a whitespace directive"):
_program("`+`")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these can be fused with test_error_unexpected_token above, when parametrized

Comment on lines +72 to +73
def test_whitespace_print(format_str: str, expected: str):
assert _print(format_str) == expected

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these can be fused with test_empty_format_prints_and_parses_nothing above, when parametrized, and could test the output of Parser.parse_type.

Comment on lines +76 to +79
def test_whitespace_parses_to_directive_and_consumes_nothing():
assert _program("` `").stmts == (AttrWhitespaceDirective(" "),)
assert _parse("` `", "") == []

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feels like it would be worth parametrizing this test also, to cover the three cases in the test above.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually, I can't find a matching test op-side so we might not want it.

@n-io n-io requested a review from superlopuh July 13, 2026 14:54
@superlopuh superlopuh added the core xDSL core (ir, textual format, ...) label Jul 13, 2026
@n-io n-io merged commit e603030 into main Jul 13, 2026
25 checks passed
@n-io n-io deleted the nicolai/attr-asm-fmt-structural-directives branch July 13, 2026 19:16
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