Skip to content

Commit a80be88

Browse files
authored
Merge pull request #176 from fingolfin/mh/VERSION
Remove code for Julia <= 0.7
2 parents 41d8f61 + ad43b61 commit a80be88

File tree

3 files changed

+7
-23
lines changed

3 files changed

+7
-23
lines changed

src/match/macro.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,8 @@ macro match(ex, lines)
5252
ex = $(esc(ex))
5353
end
5454

55-
@static if VERSION < v"0.7.0-"
56-
body = foldr((clause, body) -> makeclause(clause..., body),
57-
nothing, clauses(lines))
58-
else
59-
body = foldr((clause, body) -> makeclause(clause..., body),
60-
clauses(lines); init=nothing)
61-
end
55+
body = foldr((clause, body) -> makeclause(clause..., body),
56+
clauses(lines); init=nothing)
6257

6358
push!(result.args, body)
6459
return result

src/structdef.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
const STRUCTSYMBOL = VERSION < v"0.7-" ? :type : :struct
2-
isstructdef(ex) = Meta.isexpr(ex, STRUCTSYMBOL)
1+
isstructdef(ex) = Meta.isexpr(ex, :struct)
32

43
function splitstructdef(ex)
54
ex = MacroTools.striplines(ex)
@@ -60,7 +59,7 @@ function combinestructdef(d)::Expr
6059
$(d[:constructors]...)
6160
end
6261

63-
Expr(STRUCTSYMBOL, d[:mutable], header, body)
62+
Expr(:struct, d[:mutable], header, body)
6463
end
6564

6665
function combinefield(x)

src/utils.jl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,8 @@ More convenient macro expansion, e.g.
219219
@expand @time foo()
220220
```
221221
"""
222-
@static if VERSION <= v"0.7.0-DEV.484"
223-
macro expand(ex)
224-
:(alias_gensyms(macroexpand($(current_module()), $(ex,)[1])))
225-
end
226-
else
227-
macro expand(ex)
228-
:(alias_gensyms(macroexpand($(__module__), $(ex,)[1])))
229-
end
222+
macro expand(ex)
223+
:(alias_gensyms(macroexpand($(__module__), $(ex,)[1])))
230224
end
231225

232226

@@ -471,11 +465,7 @@ Flatten any redundant blocks into a single block, over the whole expression.
471465
flatten(ex) = postwalk(flatten1, ex)
472466

473467
function makeif(clauses, els = nothing)
474-
@static if VERSION < v"0.7.0-"
475-
foldr((c, ex)->:($(c[1]) ? $(c[2]) : $ex), els, clauses)
476-
else
477-
foldr((c, ex)->:($(c[1]) ? $(c[2]) : $ex), clauses; init=els)
478-
end
468+
foldr((c, ex)->:($(c[1]) ? $(c[2]) : $ex), clauses; init=els)
479469
end
480470

481471
unresolve1(x) = x

0 commit comments

Comments
 (0)