Skip to content

Commit

Permalink
Make fix conditional on version
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPJones committed Mar 28, 2016
1 parent d63ce3c commit bd6607e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ function Maybe(T::Type)
end

function in_expr_args(ex::Expr)
if ex.head === :in
ex.head === :in && return ex.args[1], ex.args[2]
if VERSION < v"0.5.0-dev+3200"
(ex.head === :comparison && length(ex.args) == 3 && ex.args[2] === :in) &&
return ex.args[1], ex.args[2]
elseif (ex.head === :comparison && length(ex.args) == 3 &&
ex.args[2] === :in)
return ex.args[1], ex.args[3]
elseif (ex.head === :call && length(ex.args) == 3 &&
ex.args[1] === :in)
else
(ex.head === :call && length(ex.args) == 3 && ex.args[1] === :in) &&
return ex.args[2], ex.args[3]
end
end
error("Not an `in` expression")
end

Expand Down

0 comments on commit bd6607e

Please sign in to comment.