@@ -290,7 +290,7 @@ local function decode_object(ast)
290
290
statusPos = statusPos + 1
291
291
local res = {}
292
292
local chr = next_byte ()
293
- if chr == 125 --[[ '] ' ]] then
293
+ if chr == 125 --[[ '} ' ]] then
294
294
statusPos = statusPos + 1
295
295
return json .createEmptyObject ()
296
296
end
@@ -602,9 +602,9 @@ local function add_prefix(v, pathlst)
602
602
return v
603
603
end
604
604
605
- local OP = {}
605
+ local operations = {}
606
606
607
- function OP .add (str , option , path , value )
607
+ function operations .add (str , option , path , value )
608
608
if path == " /" then
609
609
return json .beautify (value , option )
610
610
end
@@ -639,7 +639,7 @@ function OP.add(str, option, path, value)
639
639
end
640
640
end
641
641
642
- function OP .remove (str , _ , path )
642
+ function operations .remove (str , _ , path )
643
643
if path == " /" then
644
644
return " "
645
645
end
@@ -671,7 +671,7 @@ function OP.remove(str, _, path)
671
671
end
672
672
end
673
673
674
- function OP .replace (str , option , path , value )
674
+ function operations .replace (str , option , path , value )
675
675
if path == " /" then
676
676
return json .beautify (value , option )
677
677
end
@@ -705,7 +705,7 @@ function OP.replace(str, option, path, value)
705
705
end
706
706
707
707
local function edit (str , patch , option )
708
- local f = OP [patch .op ]
708
+ local f = operations [patch .op ]
709
709
if not f then
710
710
error (string_format (" invalid op: %s" , patch .op ))
711
711
return
0 commit comments