Skip to content

Commit

Permalink
Fix display of true/false attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
alastairreid committed Jan 14, 2025
1 parent 893e584 commit 2804869
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion asl_xdsl/dialects/asl.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def parse_parameter(cls, parser: AttrParser) -> bool:

def print_parameter(self, printer: Printer) -> None:
"""Print the attribute parameter."""
printer.print("true" if self.data else "false")
printer.print("<true>" if self.data else "<false>")


@irdl_attr_definition
Expand Down
2 changes: 1 addition & 1 deletion tests/filecheck/dialects/asl/types_attrs.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ builtin.module {
"test.op"() {bool_true = #asl.bool_attr<true>, bool_false = #asl.bool_attr<false>} : () -> ()

// CHECK: "test.op"() {bool_type = !asl.bool} : () -> ()
// CHECK-NEXT: "test.op"() {bool_true = #asl.bool_attrtrue, bool_false = #asl.bool_attrfalse} : () -> ()
// CHECK-NEXT: "test.op"() {bool_true = #asl.bool_attr<true>, bool_false = #asl.bool_attr<false>} : () -> ()

"test.op"() {int_type = !asl.int} : () -> ()
"test.op"() {constraint_int = !asl.int<42>} : () -> ()
Expand Down

0 comments on commit 2804869

Please sign in to comment.