Skip to content

Commit

Permalink
Handle eachrsplit change
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPJones committed Oct 21, 2023
1 parent 03d8782 commit dab4dbe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["ScottPJones <[email protected]>"]
keywords = ["Strings"]
license = "MIT"
uuid = "e79e7a6a-7bb1-5a4d-9d64-da657b06f53a"
version = "1.1.4"
version = "1.1.5"

[deps]
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
Expand Down
13 changes: 9 additions & 4 deletions src/util.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#=
Utility functions for Str strings
Copyright 2018-2021 Gandalf Software, Inc., Scott P. Jones,
Copyright 2018-2023 Gandalf Software, Inc., Scott P. Jones,
and other contributors to the Julia language
Licensed under MIT License, see LICENSE.md
Based initially on julia/test/strings/util.jl
Expand Down Expand Up @@ -131,16 +131,21 @@ split(str::_SplitTypes, splitter::SetOfChars;
limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) =
__split(str, in(splitter), limit, checkkeep(keepempty, keep, :split), splitarr(str))

@static if isdefined(Base, :eachrsplit)
const _RSplitTypes = MaybeSub{<:Str{<:Union{_LatinCSE,_UCS2CSE,_UTF32CSE}}}
else
const _RSplitTypes = MaybeSub{<:Str}
Base._rsplit(str::MaybeSub{<:Str}, splitter, limit, keepempty, vec) =
__rsplit(str, splitter, limit, keepempty, vec)
end

rsplit(str::MaybeSub{<:Str}, splitter;
rsplit(str::_RSplitTypes, splitter;
limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) =
__rsplit(str, splitter, limit, checkkeep(keepempty, keep, :rsplit), splitarr(str))
rsplit(str::MaybeSub{<:Str}, splitter::AbstractChar;
rsplit(str::_RSplitTypes, splitter::AbstractChar;
limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) =
__rsplit(str, isequal(splitter), limit, checkkeep(keepempty, keep, :rsplit), splitarr(str))
rsplit(str::MaybeSub{<:Str}, splitter::SetOfChars;
rsplit(str::_RSplitTypes, splitter::SetOfChars;
limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) =
__rsplit(str, in(splitter), limit, checkkeep(keepempty, keep, :rsplit), splitarr(str))

Expand Down

0 comments on commit dab4dbe

Please sign in to comment.