Skip to content

Commit

Permalink
Removal of braces from xDSL printing multiple results too
Browse files Browse the repository at this point in the history
  • Loading branch information
mesham committed Oct 26, 2022
1 parent 69c766d commit 2a2ac0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/mlir_printer_test.py
Expand Up @@ -176,7 +176,7 @@ def test_op_with_results():
)

print_as_mlir_and_compare(
"""(%0 : !param_attr, %1 : !param_type) = any()""",
"""%0 : !param_attr, %1 : !param_type = any()""",
"""%0, %1 = "any"() : () -> (#param_attr, !param_type)""",
)

Expand Down
7 changes: 4 additions & 3 deletions xdsl/parser.py
Expand Up @@ -574,9 +574,10 @@ def parse_optional_typed_result(
def parse_optional_typed_results(
self,
skip_white_space: bool = True
) -> list[tuple[str, Attribute]] | None:
res = self.parse_list(lambda: self.parse_optional_typed_result(skip_white_space=skip_white_space))
if len(res) == 0:
) -> list[tuple[str, Attribute]] | None:
res = self.parse_list(lambda: self.parse_optional_typed_result(
skip_white_space=skip_white_space))
if len(res) == 0:
return None
elif len(res) == 1 and res[0] is None:
return None
Expand Down

0 comments on commit 2a2ac0f

Please sign in to comment.