Skip to content

Commit 3536b56

Browse files
authored
Merge pull request #66 from stevengj/0.7-compat
fix 0.7 deprecations
2 parents e762757 + 77dd79c commit 3536b56

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/MacroTools.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module MacroTools
33

44
using Compat
55
using Compat.Markdown
6-
using Compat.Random
76
export @match, @capture
87

98
include("match.jl")
@@ -16,9 +15,14 @@ include("examples/destruct.jl")
1615
include("examples/threading.jl")
1716
include("examples/forward.jl")
1817

18+
const animals = Symbol[]
19+
1920
function __init__()
2021
animals_file = joinpath(dirname(@__FILE__), "..", "animals.txt")
21-
global animals = shuffle(Symbol.(lowercase.(split(read(animals_file, String)))))
22+
_animals = split(read(animals_file, String))
23+
resize!(animals, length(_animals))
24+
animals .= Symbol.(lowercase.(_animals))
25+
Compat.Random.shuffle!(animals)
2226
end
2327

2428
end # module

src/utils.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function gatherwheres(ex)
198198
end
199199
end
200200

201-
md""" splitdef(fdef)
201+
""" splitdef(fdef)
202202
203203
Match any function definition
204204
@@ -214,9 +214,9 @@ calling `MacroTools.combinedef(dict)`, or explicitly with
214214
```
215215
rtype = get(dict, :rtype, :Any)
216216
all_params = [get(dict, :params, [])..., get(dict, :whereparams, [])...]
217-
:(function $(dict[:name]){$(all_params...)}($(dict[:args]...);
218-
$(dict[:kwargs]...))::$rtype
219-
$(dict[:body])
217+
:(function \$(dict[:name]){\$(all_params...)}(\$(dict[:args]...);
218+
\$(dict[:kwargs]...))::\$rtype
219+
\$(dict[:body])
220220
end)
221221
```
222222
"""

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ let
4040
x::Int
4141
y
4242
end)
43-
@capture(ex, type T_ fields__ end)
43+
@capture(ex, mutable struct T_ fields__ end)
4444
@test T == :Foo
4545
@test fields == [:(x::Int), :y]
4646

0 commit comments

Comments
 (0)