Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
TorkelE committed Jun 5, 2024
1 parent daedea8 commit 12d8a4b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/rewrite-helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ function _replacenode(expr::Symbolic, rules...; fixpoint = false)
end
end

Base.@deprecate replace(expr::Num, r::Pair, rules::Pair...; fixpoint = false) replacenode(expr, r, rules...)
Base.@deprecate replace(expr::Num, rules...; fixpoint = false) replacenode(expr, rules...)
Base.@deprecate replace(expr::Symbolic, rules...; fixpoint = false) replacenode(expr, rules...)
Base.@deprecate replace(expr::Symbolic, r::Pair, rules::Pair...; fixpoint = false) replacenode(expr, r, rules...)
Base.@deprecate replace(expr::Number, rules...; fixpoint = false) replacenode(expr, rules...)
Base.@deprecate replace(expr::Number, r::Pair, rules::Pair...; fixpoint = false) replacenode(expr, r, rules...)

"""
hasnode(c, x)
Returns true if any part of `x` fufills the condition given in c. c can be a function or an expression.
Expand Down Expand Up @@ -74,6 +81,11 @@ function _hasnode(r, y)
end
end

Base.@deprecate occursin(r::Function, y::Union{Num, Symbolic}) hasnode(r::Function, y::Union{Num, Symbolic})
Base.@deprecate occursin(r::Num, y::Union{Num, Symbolic}) hasnode(r::Num, y::Union{Num, Symbolic})
Base.@deprecate occursin(r::Symbolic, y::Union{Num, Symbolic}) hasnode(r::Symbolic, y::Union{Num, Symbolic})
Base.@deprecate occursin(r::Union{Num, Symbolic, Function}, y::Number) hasnode(r::Union{Num, Symbolic, Function}, y::Number)

"""
filterchildren(c, x)
Returns all parts of `x` that fufills the condition given in c. c can be a function or an expression.
Expand Down

0 comments on commit 12d8a4b

Please sign in to comment.