Fix deprecations

This commit is contained in:
femtocleaner[bot] 2018-08-14 16:46:23 +00:00
parent 4045c322d5
commit 2d80f68087
3 changed files with 4 additions and 6 deletions

View File

@ -1,5 +1,3 @@
__precompile__()
module Flux
# Zero Flux Given

View File

@ -14,7 +14,7 @@ getfile(r, name) = r.files[findfirst(x -> x.name == name, r.files)]
function getfile(name)
r = ZipFile.Reader(deps("sentiment.zip"))
text = readstring(getfile(r, "trees/$name"))
text = read(getfile(r, "trees/$name"), String)
close(r)
return text
end
@ -29,12 +29,12 @@ function parsetree(s)
s = replace(s, r"\$", s -> "\\\$")
s = replace(s, r"[^\s\(\)]+", s -> "\"$s\"")
s = replace(s, " ", ", ")
return totree(parse(s))
return totree(Meta.parse(s))
end
function gettrees(name)
load()
ss = split(getfile("$name.txt"), '\n', keep = false)
ss = split(getfile("$name.txt"), '\n', keepempty = false)
return parsetree.(ss)
end

View File

@ -11,7 +11,7 @@ Base.push!(s::IdSet{T}, x::T) where T = (s.dict[x] = nothing; s)
Base.delete!(s::IdSet{T}, x::T) where T = (delete!(s.dict, x); s)
Base.in(x, s::IdSet) = haskey(s.dict, x)
(::Type{IdSet{T}})(xs) where T = push!(IdSet{T}(), xs...)
IdSet{T}(xs) where T = push!(IdSet{T}(), xs...)
IdSet(xs) = IdSet{eltype(xs)}(xs)