diff --git a/REQUIRE b/REQUIRE index 9a2cb74..2cdca7f 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,2 +1,2 @@ julia 0.6 -Compat 0.54 +Compat 0.62 diff --git a/src/match.jl b/src/match.jl index 4228cf3..f41dea6 100644 --- a/src/match.jl +++ b/src/match.jl @@ -11,7 +11,7 @@ function store!(env, name, ex) end isbinding(s) = false -isbinding(s::Symbol) = contains(string(s), r"[^_]_(_str)?$") +isbinding(s::Symbol) = occursin(r"[^_]_(_str)?$", string(s)) function bname(s::Symbol) Symbol(Base.match(r"^@?(.*?)_+(_str)?$", string(s)).captures[1]) @@ -26,7 +26,7 @@ match_inner(pat::QuoteNode, ex::QuoteNode, env) = match(pat.value, ex.value, env) isslurp(s) = false -isslurp(s::Symbol) = s == :__ || contains(string(s), r"[^_]__$") +isslurp(s::Symbol) = s == :__ || occursin(r"[^_]__$", string(s)) function slurprange(pat) slurps = length(filter(isslurp, pat)) diff --git a/src/types.jl b/src/types.jl index 7e22532..2187863 100644 --- a/src/types.jl +++ b/src/types.jl @@ -4,7 +4,9 @@ struct TypeBind end istb(s) = false -istb(s::Symbol) = !(endswith(string(s), "_") || endswith(string(s), "_str")) && contains(string(s), "_") +istb(s::Symbol) = !(endswith(string(s), "_") || + endswith(string(s), "_str")) && + occursin("_", string(s)) tbname(s::Symbol) = Symbol(split(string(s), "_")[1]) tbname(s::TypeBind) = s.name diff --git a/src/utils.jl b/src/utils.jl index 37863b6..057353c 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -128,7 +128,7 @@ function inexpr(ex, x) return result end -isgensym(s::Symbol) = contains(string(s), "#") +isgensym(s::Symbol) = occursin("#", string(s)) isgensym(s) = false function gensymname(x::Symbol)