Skip to content

Commit

Permalink
Merge pull request #194 from ScottPJones/spj/fixv05
Browse files Browse the repository at this point in the history
Fix #193, issue with makeform macro in v0.5
  • Loading branch information
aviks committed Mar 28, 2016
2 parents 09a85af + bd6607e commit 2109bf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/fontfallback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
# Define this even if we're not calling pango, since cairo needs it.
const PANGO_SCALE = 1024.0

# Handle deprecation of readall, replacement with readstring
isdefined(:readstring) || (readstring = readall)

# Serialized glyph sizes for commont fonts.
const glyphsizes = open(fd -> JSON.parse(readall(fd)),
const glyphsizes = open(fd -> JSON.parse(readstring(fd)),
joinpath(dirname(@__FILE__), "..", "data",
"glyphsize.json"))

Expand Down
12 changes: 7 additions & 5 deletions src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +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]
end
else
(ex.head === :call && length(ex.args) == 3 && ex.args[1] === :in) &&
return ex.args[2], ex.args[3]
end
error("Not an `in` expression")
end

Expand Down

0 comments on commit 2109bf8

Please sign in to comment.