Skip to content

Commit

Permalink
Merge pull request JuliaLang#23584 from JuliaLang/jq/cartesian
Browse files Browse the repository at this point in the history
Fix while loop variable issue in cartesian.jl
  • Loading branch information
quinnj committed Sep 5, 2017
2 parents 30530e0 + 4c0a3e6 commit 2526b40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/cartesian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ function lreplace!(str::AbstractString, r::LReplace)
pat = r.pat_str
j = start(pat)
matching = false
local istart::Int
while !done(str, i)
cstr, i = next(str, i)
if !matching
Expand Down
2 changes: 2 additions & 0 deletions test/cartesian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
@test Base.Cartesian.exprresolve(:(1 + 3)) == 4
ex = Base.Cartesian.exprresolve(:(if 5 > 4; :x; else :y; end))
@test ex.args[2] == QuoteNode(:x)

@test Base.Cartesian.lreplace!("val_col", Base.Cartesian.LReplace{String}(:col, "col", 1)) == "val_1"

0 comments on commit 2526b40

Please sign in to comment.