Skip to content

Commit 2b0e7f2

Browse files
committed
closes #75
1 parent 56d5030 commit 2b0e7f2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/match.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ function normalise(ex)
8181
return ex
8282
end
8383

84+
# No longer removed from macro calls
85+
match(::LineNumberNode, ::LineNumberNode, _) = nothing
86+
8487
function match(pat, ex, env)
8588
pat = normalise(pat)
8689
pat == :_ && return env

test/runtests.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ let
4343
@capture(ex, mutable struct T_ fields__ end)
4444
@test T == :Foo
4545
@test fields == [:(x::Int), :y]
46-
46+
4747
@capture(ex, mutable struct T_ fields__ end)
4848
@test T == :Foo
4949
@test fields == [:(x::Int), :y]
@@ -87,6 +87,12 @@ let
8787
@test isexpr(x, :kw)
8888
end
8989

90+
let
91+
ex = :(@foo(a,b))
92+
@capture(ex, @foo(a_,b_))
93+
@test (a, b) == (:a, :b)
94+
end
95+
9096
macro nothing_macro()
9197
end
9298
@test @expand(@nothing_macro) === nothing

0 commit comments

Comments
 (0)