summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/pure/parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/lib/json/pure/parser.rb')
-rw-r--r--ext/json/lib/json/pure/parser.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/json/lib/json/pure/parser.rb b/ext/json/lib/json/pure/parser.rb
index 39bee54..9b30f15 100644
--- a/ext/json/lib/json/pure/parser.rb
+++ b/ext/json/lib/json/pure/parser.rb
@@ -122,9 +122,8 @@ module JSON
def parse_string
if scan(STRING)
return '' if self[1].empty?
- self[1].gsub(%r((?:\\[\\bfnrt"/]|(?:\\u(?:[A-Fa-f\d]{4}))+|\\[\x20-\xff]))n) do
- c = $&
- if u = UNESCAPE_MAP[c[1]]
+ self[1].gsub(%r((?:\\[\\bfnrt"/]|(?:\\u(?:[A-Fa-f\d]{4}))+|\\[\x20-\xff]))n) do |c|
+ if u = UNESCAPE_MAP[$&[1]]
u
else # \uXXXX
bytes = ''