Skip to content

Commit 8d80dec

Browse files
committed
Use Expr instead of Meta.parse
1 parent 1e6c829 commit 8d80dec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/rule.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function rewrite_rhs(expr::Expr)
156156
if expr.head == :where
157157
rhs = expr.args[1]
158158
predicate = expr.args[2]
159-
expr = Meta.parse("$predicate ? $rhs : nothing")
159+
expr = :($predicate ? $rhs : nothing)
160160
end
161161
return expr
162162
end

test/rulesets.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ end
133133
end
134134

135135
@testset "where" begin
136-
expected = Meta.parse("f(~x) ? ~x + ~y : nothing")
136+
expected = :(f(~x) ? ~x + ~y : nothing)
137137
@test SymbolicUtils.rewrite_rhs(:((~x + ~y) where f(~x))) == expected
138138

139139
@syms a b

0 commit comments

Comments
 (0)