Skip to content

Commit 62396a6

Browse files
committed
ISLE: remove Scheme-style boolean syntax
The `#t` and `#f` syntax is misleading: they are actually integer expressions, not booleans, so `#t` represents the integer `1` but *not* the boolean `true`. They have been replaced by the named constants `$true` and `$false`, and not used anywhere except tests, so they can be removed without breaking any lowering/optimization code. Copyright (c) 2024, Arm Limited. Signed-off-by: Karl Meakin <karl.meakin@arm.com>
1 parent f6e7ae9 commit 62396a6

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

cranelift/isle/isle/isle_examples/pass/test4.isle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
a
2222
(Ext1 x)
2323
(Ext2 x)))
24-
(C #t))
24+
(C 1))
2525

2626
(type Opcode (enum A B C))
2727
(type MachInst (enum D E F))

cranelift/isle/isle/src/parser.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,10 +890,6 @@ impl<'a> Parser<'a> {
890890
let ret = self.parse_expr_inner_parens(pos)?;
891891
self.expect_rparen()?;
892892
Ok(ret)
893-
} else if self.eat_sym_str("#t")? {
894-
Ok(Expr::ConstInt { val: 1, pos })
895-
} else if self.eat_sym_str("#f")? {
896-
Ok(Expr::ConstInt { val: 0, pos })
897893
} else if self.is_const() {
898894
let val = self.parse_const()?;
899895
Ok(Expr::ConstPrim { val, pos })

0 commit comments

Comments
 (0)