@@ -290,7 +290,7 @@ local function decode_object(ast)
290290 statusPos = statusPos + 1
291291 local res = {}
292292 local chr = next_byte ()
293- if chr == 125 --[[ '] ' ]] then
293+ if chr == 125 --[[ '} ' ]] then
294294 statusPos = statusPos + 1
295295 return json .createEmptyObject ()
296296 end
@@ -602,9 +602,9 @@ local function add_prefix(v, pathlst)
602602 return v
603603end
604604
605- local OP = {}
605+ local operations = {}
606606
607- function OP .add (str , option , path , value )
607+ function operations .add (str , option , path , value )
608608 if path == " /" then
609609 return json .beautify (value , option )
610610 end
@@ -639,7 +639,7 @@ function OP.add(str, option, path, value)
639639 end
640640end
641641
642- function OP .remove (str , _ , path )
642+ function operations .remove (str , _ , path )
643643 if path == " /" then
644644 return " "
645645 end
@@ -671,7 +671,7 @@ function OP.remove(str, _, path)
671671 end
672672end
673673
674- function OP .replace (str , option , path , value )
674+ function operations .replace (str , option , path , value )
675675 if path == " /" then
676676 return json .beautify (value , option )
677677 end
@@ -705,7 +705,7 @@ function OP.replace(str, option, path, value)
705705end
706706
707707local function edit (str , patch , option )
708- local f = OP [patch .op ]
708+ local f = operations [patch .op ]
709709 if not f then
710710 error (string_format (" invalid op: %s" , patch .op ))
711711 return
0 commit comments