Skip to content

Commit 3acb4e2

Browse files
Change dynamic cost arg to be var instead of literal
1 parent 93f5e4f commit 3acb4e2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/set_cost.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ struct EnableCostsDeclarations;
140140
impl UserDefinedCommand for EnableCostsDeclarations {
141141
fn update(&self, egraph: &mut EGraph, args: &[Expr]) -> Result<(), Error> {
142142
let span = args[0].span();
143-
if let [GenericExpr::Lit(_, Literal::String(name))] = args {
143+
if let [GenericExpr::Var(_, name)] = args {
144144
let function = egraph.get_function(name).ok_or_else(|| {
145145
Error::ParseError(ParseError(
146146
span.clone(),

tests/integration_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn test_extract_enable_cost() {
9797
None,
9898
"
9999
(datatype E (Add E E) (Sub E E :cost 200) (Num i64))
100-
(enable-dynamic-cost \"Num\")
100+
(enable-dynamic-cost Num)
101101
(set-cost (Num 2) 1000)",
102102
)
103103
.unwrap();

0 commit comments

Comments
 (0)