Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 82f3d70

Browse files
committed
merge
2 parents 3e6ce85 + 6bbb157 commit 82f3d70

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lua/json4lua/json/json.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function decode(s, startPos)
130130
return decode_scanArray(s,startPos)
131131
end
132132
-- Number
133-
if string.find("+-0123456789.e", curChar, 1, true) then
133+
if string.find("+-0123456789.eE", curChar, 1, true) then
134134
return decode_scanNumber(s,startPos)
135135
end
136136
-- String
@@ -224,13 +224,13 @@ end
224224
function decode_scanNumber(s,startPos)
225225
local endPos = startPos+1
226226
local stringLen = string.len(s)
227-
local acceptableChars = "+-0123456789.e"
227+
local acceptableChars = "+-0123456789.eE"
228228
while (string.find(acceptableChars, string.sub(s,endPos,endPos), 1, true)
229229
and endPos<=stringLen
230230
) do
231231
endPos = endPos + 1
232232
end
233-
local stringValue = 'return ' .. string.sub(s,startPos, endPos-1)
233+
local stringValue = 'return ' .. string.sub(s,startPos, endPos-1)
234234
local stringEval = base.loadstring(stringValue)
235235
base.assert(stringEval, 'Failed to scan number [ ' .. stringValue .. '] in JSON string at position ' .. startPos .. ' : ' .. endPos)
236236
return stringEval(), endPos

lua/lua.zip

3 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)