json 1.8.1 → 1.8.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of json might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/.travis.yml +10 -12
- data/CHANGES +23 -0
- data/Gemfile +1 -5
- data/{README.rdoc → README.md} +34 -47
- data/Rakefile +10 -20
- data/VERSION +1 -1
- data/ext/json/ext/fbuffer/fbuffer.h +10 -1
- data/ext/json/ext/generator/extconf.rb +0 -10
- data/ext/json/ext/generator/generator.c +85 -28
- data/ext/json/ext/generator/generator.h +34 -5
- data/ext/json/ext/parser/extconf.rb +0 -10
- data/ext/json/ext/parser/parser.c +166 -130
- data/ext/json/ext/parser/parser.h +19 -4
- data/ext/json/ext/parser/parser.rl +84 -48
- data/ext/json/extconf.rb +3 -0
- data/java/src/json/ext/ByteListTranscoder.java +1 -2
- data/java/src/json/ext/Generator.java +9 -7
- data/java/src/json/ext/GeneratorMethods.java +1 -2
- data/java/src/json/ext/GeneratorService.java +1 -2
- data/java/src/json/ext/GeneratorState.java +1 -2
- data/java/src/json/ext/OptionsReader.java +1 -2
- data/java/src/json/ext/Parser.java +87 -87
- data/java/src/json/ext/Parser.rl +7 -7
- data/java/src/json/ext/ParserService.java +1 -2
- data/java/src/json/ext/RuntimeInfo.java +1 -2
- data/java/src/json/ext/StringDecoder.java +1 -2
- data/java/src/json/ext/StringEncoder.java +5 -0
- data/java/src/json/ext/Utils.java +1 -2
- data/json-java.gemspec +16 -1
- data/json.gemspec +0 -0
- data/json_pure.gemspec +23 -26
- data/lib/json/add/complex.rb +7 -1
- data/lib/json/add/rational.rb +5 -0
- data/lib/json/add/time.rb +1 -1
- data/lib/json/common.rb +5 -5
- data/lib/json/pure/generator.rb +10 -2
- data/lib/json/version.rb +1 -1
- data/tests/test_json.rb +8 -34
- data/tests/test_json_generate.rb +34 -8
- data/tools/diff.sh +18 -0
- metadata +39 -39
- data/COPYING +0 -58
- data/COPYING-json-jruby +0 -57
- data/GPL +0 -340
@@ -3,8 +3,7 @@
|
|
3
3
|
/*
|
4
4
|
* This code is copyrighted work by Daniel Luz <dev at mernen dot com>.
|
5
5
|
*
|
6
|
-
* Distributed under the Ruby
|
7
|
-
* for details.
|
6
|
+
* Distributed under the Ruby license: https://www.ruby-lang.org/en/about/license.txt
|
8
7
|
*/
|
9
8
|
package json.ext;
|
10
9
|
|
@@ -130,7 +129,7 @@ public class Parser extends RubyObject {
|
|
130
129
|
*
|
131
130
|
* <dt><code>:create_additions</code>
|
132
131
|
* <dd>If set to <code>false</code>, the Parser doesn't create additions
|
133
|
-
* even if a
|
132
|
+
* even if a matching class and <code>create_id</code> was found. This option
|
134
133
|
* defaults to <code>true</code>.
|
135
134
|
*
|
136
135
|
* <dt><code>:object_class</code>
|
@@ -248,7 +247,7 @@ public class Parser extends RubyObject {
|
|
248
247
|
*/
|
249
248
|
@JRubyMethod
|
250
249
|
public IRubyObject parse(ThreadContext context) {
|
251
|
-
return new ParserSession(this, context).parse();
|
250
|
+
return new ParserSession(this, context, info).parse();
|
252
251
|
}
|
253
252
|
|
254
253
|
/**
|
@@ -304,6 +303,7 @@ public class Parser extends RubyObject {
|
|
304
303
|
private static class ParserSession {
|
305
304
|
private final Parser parser;
|
306
305
|
private final ThreadContext context;
|
306
|
+
private final RuntimeInfo info;
|
307
307
|
private final ByteList byteList;
|
308
308
|
private final ByteList view;
|
309
309
|
private final byte[] data;
|
@@ -315,9 +315,10 @@ public class Parser extends RubyObject {
|
|
315
315
|
// no idea about the origins of this value, ask Flori ;)
|
316
316
|
private static final int EVIL = 0x666;
|
317
317
|
|
318
|
-
private ParserSession(Parser parser, ThreadContext context) {
|
318
|
+
private ParserSession(Parser parser, ThreadContext context, RuntimeInfo info) {
|
319
319
|
this.parser = parser;
|
320
320
|
this.context = context;
|
321
|
+
this.info = info;
|
321
322
|
this.byteList = parser.checkAndGetSource().getByteList();
|
322
323
|
this.data = byteList.unsafeBytes();
|
323
324
|
this.view = new ByteList(data, false);
|
@@ -337,11 +338,11 @@ public class Parser extends RubyObject {
|
|
337
338
|
}
|
338
339
|
|
339
340
|
|
340
|
-
// line
|
341
|
+
// line 365 "Parser.rl"
|
341
342
|
|
342
343
|
|
343
344
|
|
344
|
-
// line
|
345
|
+
// line 347 "Parser.java"
|
345
346
|
private static byte[] init__JSON_value_actions_0()
|
346
347
|
{
|
347
348
|
return new byte [] {
|
@@ -455,7 +456,7 @@ static final int JSON_value_error = 0;
|
|
455
456
|
static final int JSON_value_en_main = 1;
|
456
457
|
|
457
458
|
|
458
|
-
// line
|
459
|
+
// line 471 "Parser.rl"
|
459
460
|
|
460
461
|
|
461
462
|
void parseValue(ParserResult res, int p, int pe) {
|
@@ -463,14 +464,14 @@ static final int JSON_value_en_main = 1;
|
|
463
464
|
IRubyObject result = null;
|
464
465
|
|
465
466
|
|
466
|
-
// line
|
467
|
+
// line 469 "Parser.java"
|
467
468
|
{
|
468
469
|
cs = JSON_value_start;
|
469
470
|
}
|
470
471
|
|
471
|
-
// line
|
472
|
+
// line 478 "Parser.rl"
|
472
473
|
|
473
|
-
// line
|
474
|
+
// line 476 "Parser.java"
|
474
475
|
{
|
475
476
|
int _klen;
|
476
477
|
int _trans = 0;
|
@@ -496,13 +497,13 @@ case 1:
|
|
496
497
|
while ( _nacts-- > 0 ) {
|
497
498
|
switch ( _JSON_value_actions[_acts++] ) {
|
498
499
|
case 9:
|
499
|
-
// line
|
500
|
+
// line 456 "Parser.rl"
|
500
501
|
{
|
501
502
|
p--;
|
502
503
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
503
504
|
}
|
504
505
|
break;
|
505
|
-
// line
|
506
|
+
// line 508 "Parser.java"
|
506
507
|
}
|
507
508
|
}
|
508
509
|
|
@@ -565,25 +566,25 @@ case 1:
|
|
565
566
|
switch ( _JSON_value_actions[_acts++] )
|
566
567
|
{
|
567
568
|
case 0:
|
568
|
-
// line
|
569
|
+
// line 373 "Parser.rl"
|
569
570
|
{
|
570
571
|
result = getRuntime().getNil();
|
571
572
|
}
|
572
573
|
break;
|
573
574
|
case 1:
|
574
|
-
// line
|
575
|
+
// line 376 "Parser.rl"
|
575
576
|
{
|
576
577
|
result = getRuntime().getFalse();
|
577
578
|
}
|
578
579
|
break;
|
579
580
|
case 2:
|
580
|
-
// line
|
581
|
+
// line 379 "Parser.rl"
|
581
582
|
{
|
582
583
|
result = getRuntime().getTrue();
|
583
584
|
}
|
584
585
|
break;
|
585
586
|
case 3:
|
586
|
-
// line
|
587
|
+
// line 382 "Parser.rl"
|
587
588
|
{
|
588
589
|
if (parser.allowNaN) {
|
589
590
|
result = getConstant(CONST_NAN);
|
@@ -593,7 +594,7 @@ case 1:
|
|
593
594
|
}
|
594
595
|
break;
|
595
596
|
case 4:
|
596
|
-
// line
|
597
|
+
// line 389 "Parser.rl"
|
597
598
|
{
|
598
599
|
if (parser.allowNaN) {
|
599
600
|
result = getConstant(CONST_INFINITY);
|
@@ -603,7 +604,7 @@ case 1:
|
|
603
604
|
}
|
604
605
|
break;
|
605
606
|
case 5:
|
606
|
-
// line
|
607
|
+
// line 396 "Parser.rl"
|
607
608
|
{
|
608
609
|
if (pe > p + 9 - (parser.quirksMode ? 1 : 0) &&
|
609
610
|
absSubSequence(p, p + 9).equals(JSON_MINUS_INFINITY)) {
|
@@ -632,7 +633,7 @@ case 1:
|
|
632
633
|
}
|
633
634
|
break;
|
634
635
|
case 6:
|
635
|
-
// line
|
636
|
+
// line 422 "Parser.rl"
|
636
637
|
{
|
637
638
|
parseString(res, p, pe);
|
638
639
|
if (res.result == null) {
|
@@ -645,7 +646,7 @@ case 1:
|
|
645
646
|
}
|
646
647
|
break;
|
647
648
|
case 7:
|
648
|
-
// line
|
649
|
+
// line 432 "Parser.rl"
|
649
650
|
{
|
650
651
|
currentNesting++;
|
651
652
|
parseArray(res, p, pe);
|
@@ -660,7 +661,7 @@ case 1:
|
|
660
661
|
}
|
661
662
|
break;
|
662
663
|
case 8:
|
663
|
-
// line
|
664
|
+
// line 444 "Parser.rl"
|
664
665
|
{
|
665
666
|
currentNesting++;
|
666
667
|
parseObject(res, p, pe);
|
@@ -674,7 +675,7 @@ case 1:
|
|
674
675
|
}
|
675
676
|
}
|
676
677
|
break;
|
677
|
-
// line
|
678
|
+
// line 680 "Parser.java"
|
678
679
|
}
|
679
680
|
}
|
680
681
|
}
|
@@ -694,7 +695,7 @@ case 5:
|
|
694
695
|
break; }
|
695
696
|
}
|
696
697
|
|
697
|
-
// line
|
698
|
+
// line 479 "Parser.rl"
|
698
699
|
|
699
700
|
if (cs >= JSON_value_first_final && result != null) {
|
700
701
|
res.update(result, p);
|
@@ -704,7 +705,7 @@ case 5:
|
|
704
705
|
}
|
705
706
|
|
706
707
|
|
707
|
-
// line
|
708
|
+
// line 710 "Parser.java"
|
708
709
|
private static byte[] init__JSON_integer_actions_0()
|
709
710
|
{
|
710
711
|
return new byte [] {
|
@@ -803,7 +804,7 @@ static final int JSON_integer_error = 0;
|
|
803
804
|
static final int JSON_integer_en_main = 1;
|
804
805
|
|
805
806
|
|
806
|
-
// line
|
807
|
+
// line 498 "Parser.rl"
|
807
808
|
|
808
809
|
|
809
810
|
void parseInteger(ParserResult res, int p, int pe) {
|
@@ -821,15 +822,15 @@ static final int JSON_integer_en_main = 1;
|
|
821
822
|
int cs = EVIL;
|
822
823
|
|
823
824
|
|
824
|
-
// line
|
825
|
+
// line 827 "Parser.java"
|
825
826
|
{
|
826
827
|
cs = JSON_integer_start;
|
827
828
|
}
|
828
829
|
|
829
|
-
// line
|
830
|
+
// line 515 "Parser.rl"
|
830
831
|
int memo = p;
|
831
832
|
|
832
|
-
// line
|
833
|
+
// line 835 "Parser.java"
|
833
834
|
{
|
834
835
|
int _klen;
|
835
836
|
int _trans = 0;
|
@@ -910,13 +911,13 @@ case 1:
|
|
910
911
|
switch ( _JSON_integer_actions[_acts++] )
|
911
912
|
{
|
912
913
|
case 0:
|
913
|
-
// line
|
914
|
+
// line 492 "Parser.rl"
|
914
915
|
{
|
915
916
|
p--;
|
916
917
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
917
918
|
}
|
918
919
|
break;
|
919
|
-
// line
|
920
|
+
// line 922 "Parser.java"
|
920
921
|
}
|
921
922
|
}
|
922
923
|
}
|
@@ -936,7 +937,7 @@ case 5:
|
|
936
937
|
break; }
|
937
938
|
}
|
938
939
|
|
939
|
-
// line
|
940
|
+
// line 517 "Parser.rl"
|
940
941
|
|
941
942
|
if (cs < JSON_integer_first_final) {
|
942
943
|
return -1;
|
@@ -958,7 +959,7 @@ case 5:
|
|
958
959
|
}
|
959
960
|
|
960
961
|
|
961
|
-
// line
|
962
|
+
// line 964 "Parser.java"
|
962
963
|
private static byte[] init__JSON_float_actions_0()
|
963
964
|
{
|
964
965
|
return new byte [] {
|
@@ -1060,7 +1061,7 @@ static final int JSON_float_error = 0;
|
|
1060
1061
|
static final int JSON_float_en_main = 1;
|
1061
1062
|
|
1062
1063
|
|
1063
|
-
// line
|
1064
|
+
// line 552 "Parser.rl"
|
1064
1065
|
|
1065
1066
|
|
1066
1067
|
void parseFloat(ParserResult res, int p, int pe) {
|
@@ -1078,15 +1079,15 @@ static final int JSON_float_en_main = 1;
|
|
1078
1079
|
int cs = EVIL;
|
1079
1080
|
|
1080
1081
|
|
1081
|
-
// line
|
1082
|
+
// line 1084 "Parser.java"
|
1082
1083
|
{
|
1083
1084
|
cs = JSON_float_start;
|
1084
1085
|
}
|
1085
1086
|
|
1086
|
-
// line
|
1087
|
+
// line 569 "Parser.rl"
|
1087
1088
|
int memo = p;
|
1088
1089
|
|
1089
|
-
// line
|
1090
|
+
// line 1092 "Parser.java"
|
1090
1091
|
{
|
1091
1092
|
int _klen;
|
1092
1093
|
int _trans = 0;
|
@@ -1167,13 +1168,13 @@ case 1:
|
|
1167
1168
|
switch ( _JSON_float_actions[_acts++] )
|
1168
1169
|
{
|
1169
1170
|
case 0:
|
1170
|
-
// line
|
1171
|
+
// line 543 "Parser.rl"
|
1171
1172
|
{
|
1172
1173
|
p--;
|
1173
1174
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1174
1175
|
}
|
1175
1176
|
break;
|
1176
|
-
// line
|
1177
|
+
// line 1179 "Parser.java"
|
1177
1178
|
}
|
1178
1179
|
}
|
1179
1180
|
}
|
@@ -1193,7 +1194,7 @@ case 5:
|
|
1193
1194
|
break; }
|
1194
1195
|
}
|
1195
1196
|
|
1196
|
-
// line
|
1197
|
+
// line 571 "Parser.rl"
|
1197
1198
|
|
1198
1199
|
if (cs < JSON_float_first_final) {
|
1199
1200
|
return -1;
|
@@ -1209,7 +1210,7 @@ case 5:
|
|
1209
1210
|
}
|
1210
1211
|
|
1211
1212
|
|
1212
|
-
// line
|
1213
|
+
// line 1215 "Parser.java"
|
1213
1214
|
private static byte[] init__JSON_string_actions_0()
|
1214
1215
|
{
|
1215
1216
|
return new byte [] {
|
@@ -1311,7 +1312,7 @@ static final int JSON_string_error = 0;
|
|
1311
1312
|
static final int JSON_string_en_main = 1;
|
1312
1313
|
|
1313
1314
|
|
1314
|
-
// line
|
1315
|
+
// line 616 "Parser.rl"
|
1315
1316
|
|
1316
1317
|
|
1317
1318
|
void parseString(ParserResult res, int p, int pe) {
|
@@ -1319,15 +1320,15 @@ static final int JSON_string_en_main = 1;
|
|
1319
1320
|
IRubyObject result = null;
|
1320
1321
|
|
1321
1322
|
|
1322
|
-
// line
|
1323
|
+
// line 1325 "Parser.java"
|
1323
1324
|
{
|
1324
1325
|
cs = JSON_string_start;
|
1325
1326
|
}
|
1326
1327
|
|
1327
|
-
// line
|
1328
|
+
// line 623 "Parser.rl"
|
1328
1329
|
int memo = p;
|
1329
1330
|
|
1330
|
-
// line
|
1331
|
+
// line 1333 "Parser.java"
|
1331
1332
|
{
|
1332
1333
|
int _klen;
|
1333
1334
|
int _trans = 0;
|
@@ -1408,7 +1409,7 @@ case 1:
|
|
1408
1409
|
switch ( _JSON_string_actions[_acts++] )
|
1409
1410
|
{
|
1410
1411
|
case 0:
|
1411
|
-
// line
|
1412
|
+
// line 591 "Parser.rl"
|
1412
1413
|
{
|
1413
1414
|
int offset = byteList.begin();
|
1414
1415
|
ByteList decoded = decoder.decode(byteList, memo + 1 - offset,
|
@@ -1423,13 +1424,13 @@ case 1:
|
|
1423
1424
|
}
|
1424
1425
|
break;
|
1425
1426
|
case 1:
|
1426
|
-
// line
|
1427
|
+
// line 604 "Parser.rl"
|
1427
1428
|
{
|
1428
1429
|
p--;
|
1429
1430
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1430
1431
|
}
|
1431
1432
|
break;
|
1432
|
-
// line
|
1433
|
+
// line 1435 "Parser.java"
|
1433
1434
|
}
|
1434
1435
|
}
|
1435
1436
|
}
|
@@ -1449,7 +1450,7 @@ case 5:
|
|
1449
1450
|
break; }
|
1450
1451
|
}
|
1451
1452
|
|
1452
|
-
// line
|
1453
|
+
// line 625 "Parser.rl"
|
1453
1454
|
|
1454
1455
|
if (parser.createAdditions) {
|
1455
1456
|
RubyHash match_string = parser.match_string;
|
@@ -1476,8 +1477,7 @@ case 5:
|
|
1476
1477
|
}
|
1477
1478
|
}
|
1478
1479
|
|
1479
|
-
if (cs >= JSON_string_first_final && result != null) {
|
1480
|
-
RuntimeInfo info = RuntimeInfo.forRuntime(context.getRuntime());
|
1480
|
+
if (cs >= JSON_string_first_final && result != null) {
|
1481
1481
|
if (info.encodingsSupported() && result instanceof RubyString) {
|
1482
1482
|
((RubyString)result).force_encoding(context, info.utf8.get());
|
1483
1483
|
}
|
@@ -1488,7 +1488,7 @@ case 5:
|
|
1488
1488
|
}
|
1489
1489
|
|
1490
1490
|
|
1491
|
-
// line
|
1491
|
+
// line 1493 "Parser.java"
|
1492
1492
|
private static byte[] init__JSON_array_actions_0()
|
1493
1493
|
{
|
1494
1494
|
return new byte [] {
|
@@ -1601,7 +1601,7 @@ static final int JSON_array_error = 0;
|
|
1601
1601
|
static final int JSON_array_en_main = 1;
|
1602
1602
|
|
1603
1603
|
|
1604
|
-
// line
|
1604
|
+
// line 698 "Parser.rl"
|
1605
1605
|
|
1606
1606
|
|
1607
1607
|
void parseArray(ParserResult res, int p, int pe) {
|
@@ -1621,14 +1621,14 @@ static final int JSON_array_en_main = 1;
|
|
1621
1621
|
}
|
1622
1622
|
|
1623
1623
|
|
1624
|
-
// line
|
1624
|
+
// line 1626 "Parser.java"
|
1625
1625
|
{
|
1626
1626
|
cs = JSON_array_start;
|
1627
1627
|
}
|
1628
1628
|
|
1629
|
-
// line
|
1629
|
+
// line 717 "Parser.rl"
|
1630
1630
|
|
1631
|
-
// line
|
1631
|
+
// line 1633 "Parser.java"
|
1632
1632
|
{
|
1633
1633
|
int _klen;
|
1634
1634
|
int _trans = 0;
|
@@ -1709,7 +1709,7 @@ case 1:
|
|
1709
1709
|
switch ( _JSON_array_actions[_acts++] )
|
1710
1710
|
{
|
1711
1711
|
case 0:
|
1712
|
-
// line
|
1712
|
+
// line 667 "Parser.rl"
|
1713
1713
|
{
|
1714
1714
|
parseValue(res, p, pe);
|
1715
1715
|
if (res.result == null) {
|
@@ -1726,13 +1726,13 @@ case 1:
|
|
1726
1726
|
}
|
1727
1727
|
break;
|
1728
1728
|
case 1:
|
1729
|
-
// line
|
1729
|
+
// line 682 "Parser.rl"
|
1730
1730
|
{
|
1731
1731
|
p--;
|
1732
1732
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1733
1733
|
}
|
1734
1734
|
break;
|
1735
|
-
// line
|
1735
|
+
// line 1737 "Parser.java"
|
1736
1736
|
}
|
1737
1737
|
}
|
1738
1738
|
}
|
@@ -1752,7 +1752,7 @@ case 5:
|
|
1752
1752
|
break; }
|
1753
1753
|
}
|
1754
1754
|
|
1755
|
-
// line
|
1755
|
+
// line 718 "Parser.rl"
|
1756
1756
|
|
1757
1757
|
if (cs >= JSON_array_first_final) {
|
1758
1758
|
res.update(result, p + 1);
|
@@ -1762,7 +1762,7 @@ case 5:
|
|
1762
1762
|
}
|
1763
1763
|
|
1764
1764
|
|
1765
|
-
// line
|
1765
|
+
// line 1767 "Parser.java"
|
1766
1766
|
private static byte[] init__JSON_object_actions_0()
|
1767
1767
|
{
|
1768
1768
|
return new byte [] {
|
@@ -1885,7 +1885,7 @@ static final int JSON_object_error = 0;
|
|
1885
1885
|
static final int JSON_object_en_main = 1;
|
1886
1886
|
|
1887
1887
|
|
1888
|
-
// line
|
1888
|
+
// line 777 "Parser.rl"
|
1889
1889
|
|
1890
1890
|
|
1891
1891
|
void parseObject(ParserResult res, int p, int pe) {
|
@@ -1910,14 +1910,14 @@ static final int JSON_object_en_main = 1;
|
|
1910
1910
|
}
|
1911
1911
|
|
1912
1912
|
|
1913
|
-
// line
|
1913
|
+
// line 1915 "Parser.java"
|
1914
1914
|
{
|
1915
1915
|
cs = JSON_object_start;
|
1916
1916
|
}
|
1917
1917
|
|
1918
|
-
// line
|
1918
|
+
// line 801 "Parser.rl"
|
1919
1919
|
|
1920
|
-
// line
|
1920
|
+
// line 1922 "Parser.java"
|
1921
1921
|
{
|
1922
1922
|
int _klen;
|
1923
1923
|
int _trans = 0;
|
@@ -1998,7 +1998,7 @@ case 1:
|
|
1998
1998
|
switch ( _JSON_object_actions[_acts++] )
|
1999
1999
|
{
|
2000
2000
|
case 0:
|
2001
|
-
// line
|
2001
|
+
// line 732 "Parser.rl"
|
2002
2002
|
{
|
2003
2003
|
parseValue(res, p, pe);
|
2004
2004
|
if (res.result == null) {
|
@@ -2015,7 +2015,7 @@ case 1:
|
|
2015
2015
|
}
|
2016
2016
|
break;
|
2017
2017
|
case 1:
|
2018
|
-
// line
|
2018
|
+
// line 747 "Parser.rl"
|
2019
2019
|
{
|
2020
2020
|
parseString(res, p, pe);
|
2021
2021
|
if (res.result == null) {
|
@@ -2035,13 +2035,13 @@ case 1:
|
|
2035
2035
|
}
|
2036
2036
|
break;
|
2037
2037
|
case 2:
|
2038
|
-
// line
|
2038
|
+
// line 765 "Parser.rl"
|
2039
2039
|
{
|
2040
2040
|
p--;
|
2041
2041
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
2042
2042
|
}
|
2043
2043
|
break;
|
2044
|
-
// line
|
2044
|
+
// line 2046 "Parser.java"
|
2045
2045
|
}
|
2046
2046
|
}
|
2047
2047
|
}
|
@@ -2061,7 +2061,7 @@ case 5:
|
|
2061
2061
|
break; }
|
2062
2062
|
}
|
2063
2063
|
|
2064
|
-
// line
|
2064
|
+
// line 802 "Parser.rl"
|
2065
2065
|
|
2066
2066
|
if (cs < JSON_object_first_final) {
|
2067
2067
|
res.update(null, p + 1);
|
@@ -2094,7 +2094,7 @@ case 5:
|
|
2094
2094
|
}
|
2095
2095
|
|
2096
2096
|
|
2097
|
-
// line
|
2097
|
+
// line 2099 "Parser.java"
|
2098
2098
|
private static byte[] init__JSON_actions_0()
|
2099
2099
|
{
|
2100
2100
|
return new byte [] {
|
@@ -2198,7 +2198,7 @@ static final int JSON_error = 0;
|
|
2198
2198
|
static final int JSON_en_main = 1;
|
2199
2199
|
|
2200
2200
|
|
2201
|
-
// line
|
2201
|
+
// line 867 "Parser.rl"
|
2202
2202
|
|
2203
2203
|
|
2204
2204
|
public IRubyObject parseStrict() {
|
@@ -2208,16 +2208,16 @@ static final int JSON_en_main = 1;
|
|
2208
2208
|
ParserResult res = new ParserResult();
|
2209
2209
|
|
2210
2210
|
|
2211
|
-
// line
|
2211
|
+
// line 2213 "Parser.java"
|
2212
2212
|
{
|
2213
2213
|
cs = JSON_start;
|
2214
2214
|
}
|
2215
2215
|
|
2216
|
-
// line
|
2216
|
+
// line 876 "Parser.rl"
|
2217
2217
|
p = byteList.begin();
|
2218
2218
|
pe = p + byteList.length();
|
2219
2219
|
|
2220
|
-
// line
|
2220
|
+
// line 2222 "Parser.java"
|
2221
2221
|
{
|
2222
2222
|
int _klen;
|
2223
2223
|
int _trans = 0;
|
@@ -2298,7 +2298,7 @@ case 1:
|
|
2298
2298
|
switch ( _JSON_actions[_acts++] )
|
2299
2299
|
{
|
2300
2300
|
case 0:
|
2301
|
-
// line
|
2301
|
+
// line 839 "Parser.rl"
|
2302
2302
|
{
|
2303
2303
|
currentNesting = 1;
|
2304
2304
|
parseObject(res, p, pe);
|
@@ -2312,7 +2312,7 @@ case 1:
|
|
2312
2312
|
}
|
2313
2313
|
break;
|
2314
2314
|
case 1:
|
2315
|
-
// line
|
2315
|
+
// line 851 "Parser.rl"
|
2316
2316
|
{
|
2317
2317
|
currentNesting = 1;
|
2318
2318
|
parseArray(res, p, pe);
|
@@ -2325,7 +2325,7 @@ case 1:
|
|
2325
2325
|
}
|
2326
2326
|
}
|
2327
2327
|
break;
|
2328
|
-
// line
|
2328
|
+
// line 2330 "Parser.java"
|
2329
2329
|
}
|
2330
2330
|
}
|
2331
2331
|
}
|
@@ -2345,7 +2345,7 @@ case 5:
|
|
2345
2345
|
break; }
|
2346
2346
|
}
|
2347
2347
|
|
2348
|
-
// line
|
2348
|
+
// line 879 "Parser.rl"
|
2349
2349
|
|
2350
2350
|
if (cs >= JSON_first_final && p == pe) {
|
2351
2351
|
return result;
|
@@ -2355,7 +2355,7 @@ case 5:
|
|
2355
2355
|
}
|
2356
2356
|
|
2357
2357
|
|
2358
|
-
// line
|
2358
|
+
// line 2360 "Parser.java"
|
2359
2359
|
private static byte[] init__JSON_quirks_mode_actions_0()
|
2360
2360
|
{
|
2361
2361
|
return new byte [] {
|
@@ -2458,7 +2458,7 @@ static final int JSON_quirks_mode_error = 0;
|
|
2458
2458
|
static final int JSON_quirks_mode_en_main = 1;
|
2459
2459
|
|
2460
2460
|
|
2461
|
-
// line
|
2461
|
+
// line 907 "Parser.rl"
|
2462
2462
|
|
2463
2463
|
|
2464
2464
|
public IRubyObject parseQuirksMode() {
|
@@ -2468,16 +2468,16 @@ static final int JSON_quirks_mode_en_main = 1;
|
|
2468
2468
|
ParserResult res = new ParserResult();
|
2469
2469
|
|
2470
2470
|
|
2471
|
-
// line
|
2471
|
+
// line 2473 "Parser.java"
|
2472
2472
|
{
|
2473
2473
|
cs = JSON_quirks_mode_start;
|
2474
2474
|
}
|
2475
2475
|
|
2476
|
-
// line
|
2476
|
+
// line 916 "Parser.rl"
|
2477
2477
|
p = byteList.begin();
|
2478
2478
|
pe = p + byteList.length();
|
2479
2479
|
|
2480
|
-
// line
|
2480
|
+
// line 2482 "Parser.java"
|
2481
2481
|
{
|
2482
2482
|
int _klen;
|
2483
2483
|
int _trans = 0;
|
@@ -2558,7 +2558,7 @@ case 1:
|
|
2558
2558
|
switch ( _JSON_quirks_mode_actions[_acts++] )
|
2559
2559
|
{
|
2560
2560
|
case 0:
|
2561
|
-
// line
|
2561
|
+
// line 893 "Parser.rl"
|
2562
2562
|
{
|
2563
2563
|
parseValue(res, p, pe);
|
2564
2564
|
if (res.result == null) {
|
@@ -2570,7 +2570,7 @@ case 1:
|
|
2570
2570
|
}
|
2571
2571
|
}
|
2572
2572
|
break;
|
2573
|
-
// line
|
2573
|
+
// line 2575 "Parser.java"
|
2574
2574
|
}
|
2575
2575
|
}
|
2576
2576
|
}
|
@@ -2590,7 +2590,7 @@ case 5:
|
|
2590
2590
|
break; }
|
2591
2591
|
}
|
2592
2592
|
|
2593
|
-
// line
|
2593
|
+
// line 919 "Parser.rl"
|
2594
2594
|
|
2595
2595
|
if (cs >= JSON_quirks_mode_first_final && p == pe) {
|
2596
2596
|
return result;
|