Skip to content
Browse files

Applied differences between json's last svn revision (r315) and earli…

…est git commit (10f03df)
  • Loading branch information...
1 parent 059d9a1 commit 0ae05334797a4c68976d28448376f38077b11c0f @mernen committed Sep 2, 2009
View
2 VERSION
@@ -1 +1 @@
-1.1.7
+1.1.8
View
5 lib/json/pure/generator.rb
@@ -34,7 +34,6 @@ module JSON
"\x1f" => '\u001f',
'"' => '\"',
'\\' => '\\\\',
- '/' => '\/',
} # :nodoc:
# Convert a UTF8 encoded Ruby string _string_ to a JSON string, encoded with
@@ -44,7 +43,7 @@ def utf8_to_json(string) # :nodoc:
string = string.dup
string << '' # XXX workaround: avoid buffer sharing
string.force_encoding(Encoding::ASCII_8BIT)
- string.gsub!(/["\\\/\x0-\x1f]/) { MAP[$&] }
+ string.gsub!(/["\\\x0-\x1f]/) { MAP[$&] }
string.gsub!(/(
(?:
[\xc2-\xdf][\x80-\xbf] |
@@ -64,7 +63,7 @@ def utf8_to_json(string) # :nodoc:
end
else
def utf8_to_json(string) # :nodoc:
- string = string.gsub(/["\\\/\x0-\x1f]/) { MAP[$&] }
+ string = string.gsub(/["\\\x0-\x1f]/) { MAP[$&] }
string.gsub!(/(
(?:
[\xc2-\xdf][\x80-\xbf] |
View
4 lib/json/pure/parser.rb
@@ -188,7 +188,7 @@ def parse_value
end
def parse_array
- raise NestingError, "nesting of #@current_nesting is to deep" if
+ raise NestingError, "nesting of #@current_nesting is too deep" if
@max_nesting.nonzero? && @current_nesting > @max_nesting
result = @array_class.new
delim = false
@@ -220,7 +220,7 @@ def parse_array
end
def parse_object
- raise NestingError, "nesting of #@current_nesting is to deep" if
+ raise NestingError, "nesting of #@current_nesting is too deep" if
@max_nesting.nonzero? && @current_nesting > @max_nesting
result = @object_class.new
delim = false
View
3 lib/json/version.rb
@@ -1,9 +1,8 @@
module JSON
# JSON version
- VERSION = '1.1.7'
+ VERSION = '1.1.8'
VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
VERSION_BUILD = VERSION_ARRAY[2] # :nodoc:
- VARIANT_BINARY = false
end
View
1 src/json/ext/GeneratorMethodsLoader.java
@@ -361,7 +361,6 @@ public IRubyObject execute(IRubyObject vSelf, IRubyObject[] args, Block block) {
for (char c : chars) {
switch (c) {
case '"':
- case '/':
case '\\':
escapeSequence[1] = (byte)c;
break;
View
83 src/json/ext/Parser.java
@@ -1,4 +1,3 @@
-
// line 1 "src/json/ext/Parser.rl"
/*
* This code is copyrighted work by Daniel Luz <dev at mernen dot com>.
@@ -271,12 +270,11 @@ private RaiseException unexpectedToken(int absStart, int absEnd) {
return Utils.newException(runtime, Utils.M_PARSER_ERROR, msg);
}
-
-// line 298 "src/json/ext/Parser.rl"
+ // line 298 "src/json/ext/Parser.rl"
-// line 280 "src/json/ext/Parser.java"
+// line 278 "src/json/ext/Parser.java"
private static byte[] init__JSON_value_actions_0()
{
return new byte [] {
@@ -389,7 +387,6 @@ private RaiseException unexpectedToken(int absStart, int absEnd) {
static final int JSON_value_en_main = 1;
-
// line 410 "src/json/ext/Parser.rl"
@@ -398,14 +395,13 @@ ParserResult parseValue(int p, int pe) {
IRubyObject result = null;
-// line 402 "src/json/ext/Parser.java"
+// line 399 "src/json/ext/Parser.java"
{
cs = JSON_value_start;
}
-
// line 417 "src/json/ext/Parser.rl"
-// line 409 "src/json/ext/Parser.java"
+// line 405 "src/json/ext/Parser.java"
{
int _klen;
int _trans = 0;
@@ -437,7 +433,7 @@ ParserResult parseValue(int p, int pe) {
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
}
break;
-// line 441 "src/json/ext/Parser.java"
+// line 437 "src/json/ext/Parser.java"
}
}
@@ -615,7 +611,7 @@ else if ( data[p] > _JSON_value_trans_keys[_mid+1] )
}
}
break;
-// line 619 "src/json/ext/Parser.java"
+// line 615 "src/json/ext/Parser.java"
}
}
}
@@ -634,7 +630,6 @@ else if ( data[p] > _JSON_value_trans_keys[_mid+1] )
}
break; }
}
-
// line 418 "src/json/ext/Parser.rl"
if (cs >= JSON_value_first_final && result != null) {
@@ -646,7 +641,7 @@ else if ( data[p] > _JSON_value_trans_keys[_mid+1] )
}
-// line 650 "src/json/ext/Parser.java"
+// line 645 "src/json/ext/Parser.java"
private static byte[] init__JSON_integer_actions_0()
{
return new byte [] {
@@ -744,23 +739,21 @@ else if ( data[p] > _JSON_value_trans_keys[_mid+1] )
static final int JSON_integer_en_main = 1;
-
// line 438 "src/json/ext/Parser.rl"
ParserResult parseInteger(int p, int pe) {
int cs = EVIL;
-// line 756 "src/json/ext/Parser.java"
+// line 750 "src/json/ext/Parser.java"
{
cs = JSON_integer_start;
}
-
// line 444 "src/json/ext/Parser.rl"
int memo = p;
-// line 764 "src/json/ext/Parser.java"
+// line 757 "src/json/ext/Parser.java"
{
int _klen;
int _trans = 0;
@@ -847,7 +840,7 @@ else if ( data[p] > _JSON_integer_trans_keys[_mid+1] )
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
}
break;
-// line 851 "src/json/ext/Parser.java"
+// line 844 "src/json/ext/Parser.java"
}
}
}
@@ -866,7 +859,6 @@ else if ( data[p] > _JSON_integer_trans_keys[_mid+1] )
}
break; }
}
-
// line 446 "src/json/ext/Parser.rl"
if (cs < JSON_integer_first_final) {
@@ -882,7 +874,7 @@ else if ( data[p] > _JSON_integer_trans_keys[_mid+1] )
}
-// line 886 "src/json/ext/Parser.java"
+// line 878 "src/json/ext/Parser.java"
private static byte[] init__JSON_float_actions_0()
{
return new byte [] {
@@ -983,23 +975,21 @@ else if ( data[p] > _JSON_integer_trans_keys[_mid+1] )
static final int JSON_float_en_main = 1;
-
// line 474 "src/json/ext/Parser.rl"
ParserResult parseFloat(int p, int pe) {
int cs = EVIL;
-// line 995 "src/json/ext/Parser.java"
+// line 986 "src/json/ext/Parser.java"
{
cs = JSON_float_start;
}
-
// line 480 "src/json/ext/Parser.rl"
int memo = p;
-// line 1003 "src/json/ext/Parser.java"
+// line 993 "src/json/ext/Parser.java"
{
int _klen;
int _trans = 0;
@@ -1086,7 +1076,7 @@ else if ( data[p] > _JSON_float_trans_keys[_mid+1] )
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
}
break;
-// line 1090 "src/json/ext/Parser.java"
+// line 1080 "src/json/ext/Parser.java"
}
}
}
@@ -1105,7 +1095,6 @@ else if ( data[p] > _JSON_float_trans_keys[_mid+1] )
}
break; }
}
-
// line 482 "src/json/ext/Parser.rl"
if (cs < JSON_float_first_final) {
@@ -1121,7 +1110,7 @@ else if ( data[p] > _JSON_float_trans_keys[_mid+1] )
}
-// line 1125 "src/json/ext/Parser.java"
+// line 1114 "src/json/ext/Parser.java"
private static byte[] init__JSON_string_actions_0()
{
return new byte [] {
@@ -1222,7 +1211,6 @@ else if ( data[p] > _JSON_float_trans_keys[_mid+1] )
static final int JSON_string_en_main = 1;
-
// line 524 "src/json/ext/Parser.rl"
@@ -1231,15 +1219,14 @@ ParserResult parseString(int p, int pe) {
RubyString result = null;
-// line 1235 "src/json/ext/Parser.java"
+// line 1223 "src/json/ext/Parser.java"
{
cs = JSON_string_start;
}
-
// line 531 "src/json/ext/Parser.rl"
int memo = p;
-// line 1243 "src/json/ext/Parser.java"
+// line 1230 "src/json/ext/Parser.java"
{
int _klen;
int _trans = 0;
@@ -1339,7 +1326,7 @@ else if ( data[p] > _JSON_string_trans_keys[_mid+1] )
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
}
break;
-// line 1343 "src/json/ext/Parser.java"
+// line 1330 "src/json/ext/Parser.java"
}
}
}
@@ -1358,7 +1345,6 @@ else if ( data[p] > _JSON_string_trans_keys[_mid+1] )
}
break; }
}
-
// line 533 "src/json/ext/Parser.rl"
if (cs >= JSON_string_first_final && result != null) {
@@ -1501,7 +1487,7 @@ else if (surrogateStart != -1) {
}
-// line 1505 "src/json/ext/Parser.java"
+// line 1491 "src/json/ext/Parser.java"
private static byte[] init__JSON_array_actions_0()
{
return new byte [] {
@@ -1613,7 +1599,6 @@ else if (surrogateStart != -1) {
static final int JSON_array_en_main = 1;
-
// line 707 "src/json/ext/Parser.rl"
@@ -1633,14 +1618,13 @@ ParserResult parseArray(int p, int pe) {
Block.NULL_BLOCK);
-// line 1637 "src/json/ext/Parser.java"
+// line 1622 "src/json/ext/Parser.java"
{
cs = JSON_array_start;
}
-
// line 725 "src/json/ext/Parser.rl"
-// line 1644 "src/json/ext/Parser.java"
+// line 1628 "src/json/ext/Parser.java"
{
int _klen;
int _trans = 0;
@@ -1741,7 +1725,7 @@ else if ( data[p] > _JSON_array_trans_keys[_mid+1] )
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
}
break;
-// line 1745 "src/json/ext/Parser.java"
+// line 1729 "src/json/ext/Parser.java"
}
}
}
@@ -1760,7 +1744,6 @@ else if ( data[p] > _JSON_array_trans_keys[_mid+1] )
}
break; }
}
-
// line 726 "src/json/ext/Parser.rl"
if (cs >= JSON_array_first_final) {
@@ -1772,7 +1755,7 @@ else if ( data[p] > _JSON_array_trans_keys[_mid+1] )
}
-// line 1776 "src/json/ext/Parser.java"
+// line 1759 "src/json/ext/Parser.java"
private static byte[] init__JSON_object_actions_0()
{
return new byte [] {
@@ -1894,7 +1877,6 @@ else if ( data[p] > _JSON_array_trans_keys[_mid+1] )
static final int JSON_object_en_main = 1;
-
// line 778 "src/json/ext/Parser.rl"
@@ -1915,14 +1897,13 @@ ParserResult parseObject(int p, int pe) {
Block.NULL_BLOCK);
-// line 1919 "src/json/ext/Parser.java"
+// line 1901 "src/json/ext/Parser.java"
{
cs = JSON_object_start;
}
-
// line 797 "src/json/ext/Parser.rl"
-// line 1926 "src/json/ext/Parser.java"
+// line 1907 "src/json/ext/Parser.java"
{
int _klen;
int _trans = 0;
@@ -2037,7 +2018,7 @@ else if ( data[p] > _JSON_object_trans_keys[_mid+1] )
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
}
break;
-// line 2041 "src/json/ext/Parser.java"
+// line 2022 "src/json/ext/Parser.java"
}
}
}
@@ -2056,7 +2037,6 @@ else if ( data[p] > _JSON_object_trans_keys[_mid+1] )
}
break; }
}
-
// line 798 "src/json/ext/Parser.rl"
if (cs < JSON_object_first_final) {
@@ -2096,7 +2076,7 @@ else if ( data[p] > _JSON_object_trans_keys[_mid+1] )
}
-// line 2100 "src/json/ext/Parser.java"
+// line 2080 "src/json/ext/Parser.java"
private static byte[] init__JSON_actions_0()
{
return new byte [] {
@@ -2199,7 +2179,6 @@ else if ( data[p] > _JSON_object_trans_keys[_mid+1] )
static final int JSON_en_main = 1;
-
// line 871 "src/json/ext/Parser.rl"
@@ -2209,16 +2188,15 @@ public IRubyObject parse() {
IRubyObject result = null;
-// line 2213 "src/json/ext/Parser.java"
+// line 2192 "src/json/ext/Parser.java"
{
cs = JSON_start;
}
-
// line 879 "src/json/ext/Parser.rl"
p = byteList.begin();
pe = p + byteList.length();
-// line 2222 "src/json/ext/Parser.java"
+// line 2200 "src/json/ext/Parser.java"
{
int _klen;
int _trans = 0;
@@ -2328,7 +2306,7 @@ else if ( data[p] > _JSON_trans_keys[_mid+1] )
}
}
break;
-// line 2332 "src/json/ext/Parser.java"
+// line 2310 "src/json/ext/Parser.java"
}
}
}
@@ -2347,7 +2325,6 @@ else if ( data[p] > _JSON_trans_keys[_mid+1] )
}
break; }
}
-
// line 882 "src/json/ext/Parser.rl"
if (cs >= JSON_first_final && p == pe) {
View
2 tests/test_json.rb
@@ -230,7 +230,7 @@ def test_backslash
assert_equal json, JSON.unparse(data)
assert_equal data, JSON.parse(json)
#
- json = '["\/"]'
+ json = '["/"]'
data = JSON.parse(json)
assert_equal ['/'], data
assert_equal json, JSON.unparse(data)

0 comments on commit 0ae0533

Please sign in to comment.
Something went wrong with that request. Please try again.