Skip to content

Commit 3a8752a

Browse files
committed
iscall
1 parent 9921e1f commit 3a8752a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export @esc, isexpr, isline, rmlines, unblock, block, inexpr, namify, isdef,
1+
export @esc, isexpr, isline, iscall, rmlines, unblock, block, inexpr, namify, isdef,
22
longdef, shortdef, @expand, makeif, prettify, splitdef, splitarg
33

44
"""
@@ -49,6 +49,8 @@ isexpr(x, ts...) = any(T->isa(T, Type) && isa(x, T), ts)
4949

5050
isline(ex) = isexpr(ex, :line) || isa(ex, LineNumberNode)
5151

52+
iscall(ex, f) = isexpr(ex, :call) && ex.args[1] == f
53+
5254
"""
5355
rmlines(x)
5456
@@ -128,7 +130,7 @@ inside `expr`.
128130
function inexpr(ex, x)
129131
result = false
130132
MacroTools.postwalk(ex) do y
131-
if y == x
133+
if y == x
132134
result = true
133135
end
134136
return y

0 commit comments

Comments
 (0)