Skip to content

Commit 1da5d4e

Browse files
Kenosimeonschaub
andcommitted
Update base/strings/lazy.jl
Co-authored-by: Simeon Schaub <[email protected]>
1 parent 1283a39 commit 1da5d4e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

base/strings/lazy.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ struct LazyString <: AbstractString
1414
LazyString(args...) = new(args)
1515
end
1616

17-
macro lazy_str(string)
17+
macro lazy_str(text)
1818
parts = Any[]
1919
lastidx = idx = 1
20-
while (idx = findnext('$', string, idx)) !== nothing
21-
lastidx < idx && push!(parts, string[lastidx:idx-1])
20+
while (idx = findnext('$', text, idx)) !== nothing
21+
lastidx < idx && push!(parts, text[lastidx:idx-1])
2222
idx += 1
23-
expr, idx = Meta.parse(string, idx; greedy=false, raise=false)
23+
expr, idx = Meta.parseatom(text, idx; filename=string(__source__.file))
2424
push!(parts, esc(expr))
2525
lastidx = idx
2626
end
27-
lastidx <= lastindex(string) && push!(parts, string[lastidx:end])
27+
lastidx <= lastindex(text) && push!(parts, text[lastidx:end])
2828
:(LazyString($(parts...)))
2929
end
3030

0 commit comments

Comments
 (0)