Skip to content

Commit 9344627

Browse files
committed
改进变量名
1 parent 98feb92 commit 9344627

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

json.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,12 @@ local function decode_string()
344344
if not i then
345345
decode_error "expected closing quote for string"
346346
end
347-
local x = string_byte(statusBuf, i)
348-
if x < 32 then
347+
local char = string_byte(statusBuf, i)
348+
if char < 32 then
349349
statusPos = i
350350
decode_error "control character in string"
351351
end
352-
if x == 34 --[[ '"' ]] then
352+
if char == 34 --[[ '"' ]] then
353353
local s = string_sub(statusBuf, statusPos + 1, i - 1)
354354
if has_unicode_escape then
355355
s = string_gsub(string_gsub(s
@@ -362,19 +362,19 @@ local function decode_string()
362362
statusPos = i + 1
363363
return s
364364
end
365-
--assert(x == 92 --[[ "\\" ]])
366-
local nx = string_byte(statusBuf, i + 1)
367-
if nx == 117 --[[ "u" ]] then
365+
--assert(char == 92 --[[ "\\" ]])
366+
local next_char = string_byte(statusBuf, i + 1)
367+
if next_char == 117 --[[ "u" ]] then
368368
if not string_match(statusBuf, "^%x%x%x%x", i + 2) then
369369
statusPos = i
370370
decode_error "invalid unicode escape in string"
371371
end
372372
has_unicode_escape = true
373373
i = i + 6
374374
else
375-
if not decode_escape_set[nx] then
375+
if not decode_escape_set[next_char] then
376376
statusPos = i
377-
decode_error("invalid escape char '"..(nx and string_char(nx) or "<eol>").."' in string")
377+
decode_error("invalid escape char '"..(next_char and string_char(next_char) or "<eol>").."' in string")
378378
end
379379
has_escape = true
380380
i = i + 2

0 commit comments

Comments
 (0)