Skip to content

Commit 52c3389

Browse files
committed
less error prone scan_string
1 parent 015a137 commit 52c3389

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

hjson/decoder.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,16 @@ function HjsonDecoder:new(strict, object_hook, object_pairs_hook)
161161
chunks = chunks .. content
162162

163163
if terminator == exitCh then
164-
return false -- break
164+
return true -- break
165165
elseif terminator == '"' or terminator == "'" then
166166
chunks = chunks .. terminator
167-
return true -- continue
167+
return -- continue
168168
elseif terminator ~= "\\" then
169169
if strict then
170170
decodeError(s, begin, "Invalid control character " .. terminator)
171171
else
172172
chunks = chunks .. terminator
173-
return true -- continue
173+
return -- continue
174174
end
175175
end
176176

@@ -206,9 +206,8 @@ function HjsonDecoder:new(strict, object_hook, object_pairs_hook)
206206
end
207207
end
208208
chunks = chunks .. chars
209-
return true
210209
end
211-
while scan_string() do end
210+
while not scan_string() do end
212211
return chunks, _end
213212
end
214213

0 commit comments

Comments
 (0)