Skip to content

Commit

Permalink
Merge pull request #219 from julia-vscode/string-itr
Browse files Browse the repository at this point in the history
fix string iteration following )
  • Loading branch information
pfitzseb committed Jan 10, 2021
2 parents 0627a97 + f4a9ee8 commit 386c1c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/iterate.jl
Expand Up @@ -637,7 +637,7 @@ function _string(x, i)
bracket = true
elseif is_rparen(x.trivia[ti])
isinterpolant = false
arg = true
arg = !(ai <= length(x.args) && !isstringliteral(x.args[ai]))
bracket = false
end
ti += 1
Expand Down
17 changes: 17 additions & 0 deletions test/iterate.jl
Expand Up @@ -492,6 +492,23 @@ end
@test x[3] === x.args[2]
@test x[4] === x.trivia[2]
@test x[5] === x.args[3]

x = cst"\"$(a)$(b)$(c)d\""
@test length(x) == 14
@test x[1] === x.trivia[1]
@test x[2] === x.trivia[2]
@test x[3] === x.trivia[3]
@test x[4] === x.args[1]
@test x[5] === x.trivia[4]
@test x[6] === x.trivia[5]
@test x[7] === x.trivia[6]
@test x[8] === x.args[2]
@test x[9] === x.trivia[7]
@test x[10] === x.trivia[8]
@test x[11] === x.trivia[9]
@test x[12] === x.args[3]
@test x[13] === x.trivia[10]
@test x[14] === x.args[4]
end

@testset ":macrocall" begin
Expand Down

0 comments on commit 386c1c1

Please sign in to comment.