json_pure 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.travis.yml +9 -5
- data/CHANGES +9 -0
- data/Gemfile +0 -1
- 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 +47 -18
- data/ext/json/ext/generator/generator.h +15 -5
- data/ext/json/ext/parser/extconf.rb +0 -10
- data/ext/json/ext/parser/parser.c +25 -6
- data/ext/json/ext/parser/parser.h +11 -4
- data/ext/json/ext/parser/parser.rl +25 -6
- data/ext/json/extconf.rb +3 -0
- data/java/src/json/ext/Parser.java +86 -85
- data/java/src/json/ext/Parser.rl +6 -5
- data/json-java.gemspec +1 -1
- data/json.gemspec +0 -0
- data/json_pure.gemspec +6 -6
- 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/version.rb +1 -1
- data/tests/test_json.rb +8 -0
- data/tests/test_json_generate.rb +23 -8
- metadata +32 -31
@@ -610,8 +610,8 @@ static VALUE convert_encoding(VALUE source)
|
|
610
610
|
* (keys) in a JSON object. Otherwise strings are returned, which is also
|
611
611
|
* the default.
|
612
612
|
* * *create_additions*: If set to false, the Parser doesn't create
|
613
|
-
* additions even if a
|
614
|
-
* defaults to
|
613
|
+
* additions even if a matching class and create_id was found. This option
|
614
|
+
* defaults to false.
|
615
615
|
* * *object_class*: Defaults to Hash
|
616
616
|
* * *array_class*: Defaults to Array
|
617
617
|
*/
|
@@ -815,7 +815,7 @@ static VALUE cParser_parse(VALUE self)
|
|
815
815
|
}
|
816
816
|
|
817
817
|
|
818
|
-
static JSON_Parser *JSON_allocate()
|
818
|
+
static JSON_Parser *JSON_allocate(void)
|
819
819
|
{
|
820
820
|
JSON_Parser *json = ALLOC(JSON_Parser);
|
821
821
|
MEMZERO(json, JSON_Parser, 1);
|
@@ -823,8 +823,9 @@ static JSON_Parser *JSON_allocate()
|
|
823
823
|
return json;
|
824
824
|
}
|
825
825
|
|
826
|
-
static void JSON_mark(
|
826
|
+
static void JSON_mark(void *ptr)
|
827
827
|
{
|
828
|
+
JSON_Parser *json = ptr;
|
828
829
|
rb_gc_mark_maybe(json->Vsource);
|
829
830
|
rb_gc_mark_maybe(json->create_id);
|
830
831
|
rb_gc_mark_maybe(json->object_class);
|
@@ -832,16 +833,34 @@ static void JSON_mark(JSON_Parser *json)
|
|
832
833
|
rb_gc_mark_maybe(json->match_string);
|
833
834
|
}
|
834
835
|
|
835
|
-
static void JSON_free(
|
836
|
+
static void JSON_free(void *ptr)
|
836
837
|
{
|
838
|
+
JSON_Parser *json = ptr;
|
837
839
|
fbuffer_free(json->fbuffer);
|
838
840
|
ruby_xfree(json);
|
839
841
|
}
|
840
842
|
|
843
|
+
static size_t JSON_memsize(const void *ptr)
|
844
|
+
{
|
845
|
+
const JSON_Parser *json = ptr;
|
846
|
+
return sizeof(*json) + FBUFFER_CAPA(json->fbuffer);
|
847
|
+
}
|
848
|
+
|
849
|
+
#ifdef NEW_TYPEDDATA_WRAPPER
|
850
|
+
static const rb_data_type_t JSON_Parser_type = {
|
851
|
+
"JSON/Parser",
|
852
|
+
{JSON_mark, JSON_free, JSON_memsize,},
|
853
|
+
#ifdef RUBY_TYPED_FREE_IMMEDIATELY
|
854
|
+
0, 0,
|
855
|
+
RUBY_TYPED_FREE_IMMEDIATELY,
|
856
|
+
#endif
|
857
|
+
};
|
858
|
+
#endif
|
859
|
+
|
841
860
|
static VALUE cJSON_parser_s_allocate(VALUE klass)
|
842
861
|
{
|
843
862
|
JSON_Parser *json = JSON_allocate();
|
844
|
-
return
|
863
|
+
return TypedData_Wrap_Struct(klass, &JSON_Parser_type, json);
|
845
864
|
}
|
846
865
|
|
847
866
|
/*
|
data/ext/json/extconf.rb
ADDED
@@ -130,7 +130,7 @@ public class Parser extends RubyObject {
|
|
130
130
|
*
|
131
131
|
* <dt><code>:create_additions</code>
|
132
132
|
* <dd>If set to <code>false</code>, the Parser doesn't create additions
|
133
|
-
* even if a
|
133
|
+
* even if a matching class and <code>create_id</code> was found. This option
|
134
134
|
* defaults to <code>true</code>.
|
135
135
|
*
|
136
136
|
* <dt><code>:object_class</code>
|
@@ -248,7 +248,7 @@ public class Parser extends RubyObject {
|
|
248
248
|
*/
|
249
249
|
@JRubyMethod
|
250
250
|
public IRubyObject parse(ThreadContext context) {
|
251
|
-
return new ParserSession(this, context).parse();
|
251
|
+
return new ParserSession(this, context, info).parse();
|
252
252
|
}
|
253
253
|
|
254
254
|
/**
|
@@ -304,6 +304,7 @@ public class Parser extends RubyObject {
|
|
304
304
|
private static class ParserSession {
|
305
305
|
private final Parser parser;
|
306
306
|
private final ThreadContext context;
|
307
|
+
private final RuntimeInfo info;
|
307
308
|
private final ByteList byteList;
|
308
309
|
private final ByteList view;
|
309
310
|
private final byte[] data;
|
@@ -315,9 +316,10 @@ public class Parser extends RubyObject {
|
|
315
316
|
// no idea about the origins of this value, ask Flori ;)
|
316
317
|
private static final int EVIL = 0x666;
|
317
318
|
|
318
|
-
private ParserSession(Parser parser, ThreadContext context) {
|
319
|
+
private ParserSession(Parser parser, ThreadContext context, RuntimeInfo info) {
|
319
320
|
this.parser = parser;
|
320
321
|
this.context = context;
|
322
|
+
this.info = info;
|
321
323
|
this.byteList = parser.checkAndGetSource().getByteList();
|
322
324
|
this.data = byteList.unsafeBytes();
|
323
325
|
this.view = new ByteList(data, false);
|
@@ -337,11 +339,11 @@ public class Parser extends RubyObject {
|
|
337
339
|
}
|
338
340
|
|
339
341
|
|
340
|
-
// line
|
342
|
+
// line 365 "Parser.rl"
|
341
343
|
|
342
344
|
|
343
345
|
|
344
|
-
// line
|
346
|
+
// line 347 "Parser.java"
|
345
347
|
private static byte[] init__JSON_value_actions_0()
|
346
348
|
{
|
347
349
|
return new byte [] {
|
@@ -455,7 +457,7 @@ static final int JSON_value_error = 0;
|
|
455
457
|
static final int JSON_value_en_main = 1;
|
456
458
|
|
457
459
|
|
458
|
-
// line
|
460
|
+
// line 471 "Parser.rl"
|
459
461
|
|
460
462
|
|
461
463
|
void parseValue(ParserResult res, int p, int pe) {
|
@@ -463,14 +465,14 @@ static final int JSON_value_en_main = 1;
|
|
463
465
|
IRubyObject result = null;
|
464
466
|
|
465
467
|
|
466
|
-
// line
|
468
|
+
// line 469 "Parser.java"
|
467
469
|
{
|
468
470
|
cs = JSON_value_start;
|
469
471
|
}
|
470
472
|
|
471
|
-
// line
|
473
|
+
// line 478 "Parser.rl"
|
472
474
|
|
473
|
-
// line
|
475
|
+
// line 476 "Parser.java"
|
474
476
|
{
|
475
477
|
int _klen;
|
476
478
|
int _trans = 0;
|
@@ -496,13 +498,13 @@ case 1:
|
|
496
498
|
while ( _nacts-- > 0 ) {
|
497
499
|
switch ( _JSON_value_actions[_acts++] ) {
|
498
500
|
case 9:
|
499
|
-
// line
|
501
|
+
// line 456 "Parser.rl"
|
500
502
|
{
|
501
503
|
p--;
|
502
504
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
503
505
|
}
|
504
506
|
break;
|
505
|
-
// line
|
507
|
+
// line 508 "Parser.java"
|
506
508
|
}
|
507
509
|
}
|
508
510
|
|
@@ -565,25 +567,25 @@ case 1:
|
|
565
567
|
switch ( _JSON_value_actions[_acts++] )
|
566
568
|
{
|
567
569
|
case 0:
|
568
|
-
// line
|
570
|
+
// line 373 "Parser.rl"
|
569
571
|
{
|
570
572
|
result = getRuntime().getNil();
|
571
573
|
}
|
572
574
|
break;
|
573
575
|
case 1:
|
574
|
-
// line
|
576
|
+
// line 376 "Parser.rl"
|
575
577
|
{
|
576
578
|
result = getRuntime().getFalse();
|
577
579
|
}
|
578
580
|
break;
|
579
581
|
case 2:
|
580
|
-
// line
|
582
|
+
// line 379 "Parser.rl"
|
581
583
|
{
|
582
584
|
result = getRuntime().getTrue();
|
583
585
|
}
|
584
586
|
break;
|
585
587
|
case 3:
|
586
|
-
// line
|
588
|
+
// line 382 "Parser.rl"
|
587
589
|
{
|
588
590
|
if (parser.allowNaN) {
|
589
591
|
result = getConstant(CONST_NAN);
|
@@ -593,7 +595,7 @@ case 1:
|
|
593
595
|
}
|
594
596
|
break;
|
595
597
|
case 4:
|
596
|
-
// line
|
598
|
+
// line 389 "Parser.rl"
|
597
599
|
{
|
598
600
|
if (parser.allowNaN) {
|
599
601
|
result = getConstant(CONST_INFINITY);
|
@@ -603,7 +605,7 @@ case 1:
|
|
603
605
|
}
|
604
606
|
break;
|
605
607
|
case 5:
|
606
|
-
// line
|
608
|
+
// line 396 "Parser.rl"
|
607
609
|
{
|
608
610
|
if (pe > p + 9 - (parser.quirksMode ? 1 : 0) &&
|
609
611
|
absSubSequence(p, p + 9).equals(JSON_MINUS_INFINITY)) {
|
@@ -632,7 +634,7 @@ case 1:
|
|
632
634
|
}
|
633
635
|
break;
|
634
636
|
case 6:
|
635
|
-
// line
|
637
|
+
// line 422 "Parser.rl"
|
636
638
|
{
|
637
639
|
parseString(res, p, pe);
|
638
640
|
if (res.result == null) {
|
@@ -645,7 +647,7 @@ case 1:
|
|
645
647
|
}
|
646
648
|
break;
|
647
649
|
case 7:
|
648
|
-
// line
|
650
|
+
// line 432 "Parser.rl"
|
649
651
|
{
|
650
652
|
currentNesting++;
|
651
653
|
parseArray(res, p, pe);
|
@@ -660,7 +662,7 @@ case 1:
|
|
660
662
|
}
|
661
663
|
break;
|
662
664
|
case 8:
|
663
|
-
// line
|
665
|
+
// line 444 "Parser.rl"
|
664
666
|
{
|
665
667
|
currentNesting++;
|
666
668
|
parseObject(res, p, pe);
|
@@ -674,7 +676,7 @@ case 1:
|
|
674
676
|
}
|
675
677
|
}
|
676
678
|
break;
|
677
|
-
// line
|
679
|
+
// line 680 "Parser.java"
|
678
680
|
}
|
679
681
|
}
|
680
682
|
}
|
@@ -694,7 +696,7 @@ case 5:
|
|
694
696
|
break; }
|
695
697
|
}
|
696
698
|
|
697
|
-
// line
|
699
|
+
// line 479 "Parser.rl"
|
698
700
|
|
699
701
|
if (cs >= JSON_value_first_final && result != null) {
|
700
702
|
res.update(result, p);
|
@@ -704,7 +706,7 @@ case 5:
|
|
704
706
|
}
|
705
707
|
|
706
708
|
|
707
|
-
// line
|
709
|
+
// line 710 "Parser.java"
|
708
710
|
private static byte[] init__JSON_integer_actions_0()
|
709
711
|
{
|
710
712
|
return new byte [] {
|
@@ -803,7 +805,7 @@ static final int JSON_integer_error = 0;
|
|
803
805
|
static final int JSON_integer_en_main = 1;
|
804
806
|
|
805
807
|
|
806
|
-
// line
|
808
|
+
// line 498 "Parser.rl"
|
807
809
|
|
808
810
|
|
809
811
|
void parseInteger(ParserResult res, int p, int pe) {
|
@@ -821,15 +823,15 @@ static final int JSON_integer_en_main = 1;
|
|
821
823
|
int cs = EVIL;
|
822
824
|
|
823
825
|
|
824
|
-
// line
|
826
|
+
// line 827 "Parser.java"
|
825
827
|
{
|
826
828
|
cs = JSON_integer_start;
|
827
829
|
}
|
828
830
|
|
829
|
-
// line
|
831
|
+
// line 515 "Parser.rl"
|
830
832
|
int memo = p;
|
831
833
|
|
832
|
-
// line
|
834
|
+
// line 835 "Parser.java"
|
833
835
|
{
|
834
836
|
int _klen;
|
835
837
|
int _trans = 0;
|
@@ -910,13 +912,13 @@ case 1:
|
|
910
912
|
switch ( _JSON_integer_actions[_acts++] )
|
911
913
|
{
|
912
914
|
case 0:
|
913
|
-
// line
|
915
|
+
// line 492 "Parser.rl"
|
914
916
|
{
|
915
917
|
p--;
|
916
918
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
917
919
|
}
|
918
920
|
break;
|
919
|
-
// line
|
921
|
+
// line 922 "Parser.java"
|
920
922
|
}
|
921
923
|
}
|
922
924
|
}
|
@@ -936,7 +938,7 @@ case 5:
|
|
936
938
|
break; }
|
937
939
|
}
|
938
940
|
|
939
|
-
// line
|
941
|
+
// line 517 "Parser.rl"
|
940
942
|
|
941
943
|
if (cs < JSON_integer_first_final) {
|
942
944
|
return -1;
|
@@ -958,7 +960,7 @@ case 5:
|
|
958
960
|
}
|
959
961
|
|
960
962
|
|
961
|
-
// line
|
963
|
+
// line 964 "Parser.java"
|
962
964
|
private static byte[] init__JSON_float_actions_0()
|
963
965
|
{
|
964
966
|
return new byte [] {
|
@@ -1060,7 +1062,7 @@ static final int JSON_float_error = 0;
|
|
1060
1062
|
static final int JSON_float_en_main = 1;
|
1061
1063
|
|
1062
1064
|
|
1063
|
-
// line
|
1065
|
+
// line 552 "Parser.rl"
|
1064
1066
|
|
1065
1067
|
|
1066
1068
|
void parseFloat(ParserResult res, int p, int pe) {
|
@@ -1078,15 +1080,15 @@ static final int JSON_float_en_main = 1;
|
|
1078
1080
|
int cs = EVIL;
|
1079
1081
|
|
1080
1082
|
|
1081
|
-
// line
|
1083
|
+
// line 1084 "Parser.java"
|
1082
1084
|
{
|
1083
1085
|
cs = JSON_float_start;
|
1084
1086
|
}
|
1085
1087
|
|
1086
|
-
// line
|
1088
|
+
// line 569 "Parser.rl"
|
1087
1089
|
int memo = p;
|
1088
1090
|
|
1089
|
-
// line
|
1091
|
+
// line 1092 "Parser.java"
|
1090
1092
|
{
|
1091
1093
|
int _klen;
|
1092
1094
|
int _trans = 0;
|
@@ -1167,13 +1169,13 @@ case 1:
|
|
1167
1169
|
switch ( _JSON_float_actions[_acts++] )
|
1168
1170
|
{
|
1169
1171
|
case 0:
|
1170
|
-
// line
|
1172
|
+
// line 543 "Parser.rl"
|
1171
1173
|
{
|
1172
1174
|
p--;
|
1173
1175
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1174
1176
|
}
|
1175
1177
|
break;
|
1176
|
-
// line
|
1178
|
+
// line 1179 "Parser.java"
|
1177
1179
|
}
|
1178
1180
|
}
|
1179
1181
|
}
|
@@ -1193,7 +1195,7 @@ case 5:
|
|
1193
1195
|
break; }
|
1194
1196
|
}
|
1195
1197
|
|
1196
|
-
// line
|
1198
|
+
// line 571 "Parser.rl"
|
1197
1199
|
|
1198
1200
|
if (cs < JSON_float_first_final) {
|
1199
1201
|
return -1;
|
@@ -1209,7 +1211,7 @@ case 5:
|
|
1209
1211
|
}
|
1210
1212
|
|
1211
1213
|
|
1212
|
-
// line
|
1214
|
+
// line 1215 "Parser.java"
|
1213
1215
|
private static byte[] init__JSON_string_actions_0()
|
1214
1216
|
{
|
1215
1217
|
return new byte [] {
|
@@ -1311,7 +1313,7 @@ static final int JSON_string_error = 0;
|
|
1311
1313
|
static final int JSON_string_en_main = 1;
|
1312
1314
|
|
1313
1315
|
|
1314
|
-
// line
|
1316
|
+
// line 616 "Parser.rl"
|
1315
1317
|
|
1316
1318
|
|
1317
1319
|
void parseString(ParserResult res, int p, int pe) {
|
@@ -1319,15 +1321,15 @@ static final int JSON_string_en_main = 1;
|
|
1319
1321
|
IRubyObject result = null;
|
1320
1322
|
|
1321
1323
|
|
1322
|
-
// line
|
1324
|
+
// line 1325 "Parser.java"
|
1323
1325
|
{
|
1324
1326
|
cs = JSON_string_start;
|
1325
1327
|
}
|
1326
1328
|
|
1327
|
-
// line
|
1329
|
+
// line 623 "Parser.rl"
|
1328
1330
|
int memo = p;
|
1329
1331
|
|
1330
|
-
// line
|
1332
|
+
// line 1333 "Parser.java"
|
1331
1333
|
{
|
1332
1334
|
int _klen;
|
1333
1335
|
int _trans = 0;
|
@@ -1408,7 +1410,7 @@ case 1:
|
|
1408
1410
|
switch ( _JSON_string_actions[_acts++] )
|
1409
1411
|
{
|
1410
1412
|
case 0:
|
1411
|
-
// line
|
1413
|
+
// line 591 "Parser.rl"
|
1412
1414
|
{
|
1413
1415
|
int offset = byteList.begin();
|
1414
1416
|
ByteList decoded = decoder.decode(byteList, memo + 1 - offset,
|
@@ -1423,13 +1425,13 @@ case 1:
|
|
1423
1425
|
}
|
1424
1426
|
break;
|
1425
1427
|
case 1:
|
1426
|
-
// line
|
1428
|
+
// line 604 "Parser.rl"
|
1427
1429
|
{
|
1428
1430
|
p--;
|
1429
1431
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1430
1432
|
}
|
1431
1433
|
break;
|
1432
|
-
// line
|
1434
|
+
// line 1435 "Parser.java"
|
1433
1435
|
}
|
1434
1436
|
}
|
1435
1437
|
}
|
@@ -1449,7 +1451,7 @@ case 5:
|
|
1449
1451
|
break; }
|
1450
1452
|
}
|
1451
1453
|
|
1452
|
-
// line
|
1454
|
+
// line 625 "Parser.rl"
|
1453
1455
|
|
1454
1456
|
if (parser.createAdditions) {
|
1455
1457
|
RubyHash match_string = parser.match_string;
|
@@ -1476,8 +1478,7 @@ case 5:
|
|
1476
1478
|
}
|
1477
1479
|
}
|
1478
1480
|
|
1479
|
-
if (cs >= JSON_string_first_final && result != null) {
|
1480
|
-
RuntimeInfo info = RuntimeInfo.forRuntime(context.getRuntime());
|
1481
|
+
if (cs >= JSON_string_first_final && result != null) {
|
1481
1482
|
if (info.encodingsSupported() && result instanceof RubyString) {
|
1482
1483
|
((RubyString)result).force_encoding(context, info.utf8.get());
|
1483
1484
|
}
|
@@ -1488,7 +1489,7 @@ case 5:
|
|
1488
1489
|
}
|
1489
1490
|
|
1490
1491
|
|
1491
|
-
// line
|
1492
|
+
// line 1493 "Parser.java"
|
1492
1493
|
private static byte[] init__JSON_array_actions_0()
|
1493
1494
|
{
|
1494
1495
|
return new byte [] {
|
@@ -1601,7 +1602,7 @@ static final int JSON_array_error = 0;
|
|
1601
1602
|
static final int JSON_array_en_main = 1;
|
1602
1603
|
|
1603
1604
|
|
1604
|
-
// line
|
1605
|
+
// line 698 "Parser.rl"
|
1605
1606
|
|
1606
1607
|
|
1607
1608
|
void parseArray(ParserResult res, int p, int pe) {
|
@@ -1621,14 +1622,14 @@ static final int JSON_array_en_main = 1;
|
|
1621
1622
|
}
|
1622
1623
|
|
1623
1624
|
|
1624
|
-
// line
|
1625
|
+
// line 1626 "Parser.java"
|
1625
1626
|
{
|
1626
1627
|
cs = JSON_array_start;
|
1627
1628
|
}
|
1628
1629
|
|
1629
|
-
// line
|
1630
|
+
// line 717 "Parser.rl"
|
1630
1631
|
|
1631
|
-
// line
|
1632
|
+
// line 1633 "Parser.java"
|
1632
1633
|
{
|
1633
1634
|
int _klen;
|
1634
1635
|
int _trans = 0;
|
@@ -1709,7 +1710,7 @@ case 1:
|
|
1709
1710
|
switch ( _JSON_array_actions[_acts++] )
|
1710
1711
|
{
|
1711
1712
|
case 0:
|
1712
|
-
// line
|
1713
|
+
// line 667 "Parser.rl"
|
1713
1714
|
{
|
1714
1715
|
parseValue(res, p, pe);
|
1715
1716
|
if (res.result == null) {
|
@@ -1726,13 +1727,13 @@ case 1:
|
|
1726
1727
|
}
|
1727
1728
|
break;
|
1728
1729
|
case 1:
|
1729
|
-
// line
|
1730
|
+
// line 682 "Parser.rl"
|
1730
1731
|
{
|
1731
1732
|
p--;
|
1732
1733
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1733
1734
|
}
|
1734
1735
|
break;
|
1735
|
-
// line
|
1736
|
+
// line 1737 "Parser.java"
|
1736
1737
|
}
|
1737
1738
|
}
|
1738
1739
|
}
|
@@ -1752,7 +1753,7 @@ case 5:
|
|
1752
1753
|
break; }
|
1753
1754
|
}
|
1754
1755
|
|
1755
|
-
// line
|
1756
|
+
// line 718 "Parser.rl"
|
1756
1757
|
|
1757
1758
|
if (cs >= JSON_array_first_final) {
|
1758
1759
|
res.update(result, p + 1);
|
@@ -1762,7 +1763,7 @@ case 5:
|
|
1762
1763
|
}
|
1763
1764
|
|
1764
1765
|
|
1765
|
-
// line
|
1766
|
+
// line 1767 "Parser.java"
|
1766
1767
|
private static byte[] init__JSON_object_actions_0()
|
1767
1768
|
{
|
1768
1769
|
return new byte [] {
|
@@ -1885,7 +1886,7 @@ static final int JSON_object_error = 0;
|
|
1885
1886
|
static final int JSON_object_en_main = 1;
|
1886
1887
|
|
1887
1888
|
|
1888
|
-
// line
|
1889
|
+
// line 777 "Parser.rl"
|
1889
1890
|
|
1890
1891
|
|
1891
1892
|
void parseObject(ParserResult res, int p, int pe) {
|
@@ -1910,14 +1911,14 @@ static final int JSON_object_en_main = 1;
|
|
1910
1911
|
}
|
1911
1912
|
|
1912
1913
|
|
1913
|
-
// line
|
1914
|
+
// line 1915 "Parser.java"
|
1914
1915
|
{
|
1915
1916
|
cs = JSON_object_start;
|
1916
1917
|
}
|
1917
1918
|
|
1918
|
-
// line
|
1919
|
+
// line 801 "Parser.rl"
|
1919
1920
|
|
1920
|
-
// line
|
1921
|
+
// line 1922 "Parser.java"
|
1921
1922
|
{
|
1922
1923
|
int _klen;
|
1923
1924
|
int _trans = 0;
|
@@ -1998,7 +1999,7 @@ case 1:
|
|
1998
1999
|
switch ( _JSON_object_actions[_acts++] )
|
1999
2000
|
{
|
2000
2001
|
case 0:
|
2001
|
-
// line
|
2002
|
+
// line 732 "Parser.rl"
|
2002
2003
|
{
|
2003
2004
|
parseValue(res, p, pe);
|
2004
2005
|
if (res.result == null) {
|
@@ -2015,7 +2016,7 @@ case 1:
|
|
2015
2016
|
}
|
2016
2017
|
break;
|
2017
2018
|
case 1:
|
2018
|
-
// line
|
2019
|
+
// line 747 "Parser.rl"
|
2019
2020
|
{
|
2020
2021
|
parseString(res, p, pe);
|
2021
2022
|
if (res.result == null) {
|
@@ -2035,13 +2036,13 @@ case 1:
|
|
2035
2036
|
}
|
2036
2037
|
break;
|
2037
2038
|
case 2:
|
2038
|
-
// line
|
2039
|
+
// line 765 "Parser.rl"
|
2039
2040
|
{
|
2040
2041
|
p--;
|
2041
2042
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
2042
2043
|
}
|
2043
2044
|
break;
|
2044
|
-
// line
|
2045
|
+
// line 2046 "Parser.java"
|
2045
2046
|
}
|
2046
2047
|
}
|
2047
2048
|
}
|
@@ -2061,7 +2062,7 @@ case 5:
|
|
2061
2062
|
break; }
|
2062
2063
|
}
|
2063
2064
|
|
2064
|
-
// line
|
2065
|
+
// line 802 "Parser.rl"
|
2065
2066
|
|
2066
2067
|
if (cs < JSON_object_first_final) {
|
2067
2068
|
res.update(null, p + 1);
|
@@ -2094,7 +2095,7 @@ case 5:
|
|
2094
2095
|
}
|
2095
2096
|
|
2096
2097
|
|
2097
|
-
// line
|
2098
|
+
// line 2099 "Parser.java"
|
2098
2099
|
private static byte[] init__JSON_actions_0()
|
2099
2100
|
{
|
2100
2101
|
return new byte [] {
|
@@ -2198,7 +2199,7 @@ static final int JSON_error = 0;
|
|
2198
2199
|
static final int JSON_en_main = 1;
|
2199
2200
|
|
2200
2201
|
|
2201
|
-
// line
|
2202
|
+
// line 867 "Parser.rl"
|
2202
2203
|
|
2203
2204
|
|
2204
2205
|
public IRubyObject parseStrict() {
|
@@ -2208,16 +2209,16 @@ static final int JSON_en_main = 1;
|
|
2208
2209
|
ParserResult res = new ParserResult();
|
2209
2210
|
|
2210
2211
|
|
2211
|
-
// line
|
2212
|
+
// line 2213 "Parser.java"
|
2212
2213
|
{
|
2213
2214
|
cs = JSON_start;
|
2214
2215
|
}
|
2215
2216
|
|
2216
|
-
// line
|
2217
|
+
// line 876 "Parser.rl"
|
2217
2218
|
p = byteList.begin();
|
2218
2219
|
pe = p + byteList.length();
|
2219
2220
|
|
2220
|
-
// line
|
2221
|
+
// line 2222 "Parser.java"
|
2221
2222
|
{
|
2222
2223
|
int _klen;
|
2223
2224
|
int _trans = 0;
|
@@ -2298,7 +2299,7 @@ case 1:
|
|
2298
2299
|
switch ( _JSON_actions[_acts++] )
|
2299
2300
|
{
|
2300
2301
|
case 0:
|
2301
|
-
// line
|
2302
|
+
// line 839 "Parser.rl"
|
2302
2303
|
{
|
2303
2304
|
currentNesting = 1;
|
2304
2305
|
parseObject(res, p, pe);
|
@@ -2312,7 +2313,7 @@ case 1:
|
|
2312
2313
|
}
|
2313
2314
|
break;
|
2314
2315
|
case 1:
|
2315
|
-
// line
|
2316
|
+
// line 851 "Parser.rl"
|
2316
2317
|
{
|
2317
2318
|
currentNesting = 1;
|
2318
2319
|
parseArray(res, p, pe);
|
@@ -2325,7 +2326,7 @@ case 1:
|
|
2325
2326
|
}
|
2326
2327
|
}
|
2327
2328
|
break;
|
2328
|
-
// line
|
2329
|
+
// line 2330 "Parser.java"
|
2329
2330
|
}
|
2330
2331
|
}
|
2331
2332
|
}
|
@@ -2345,7 +2346,7 @@ case 5:
|
|
2345
2346
|
break; }
|
2346
2347
|
}
|
2347
2348
|
|
2348
|
-
// line
|
2349
|
+
// line 879 "Parser.rl"
|
2349
2350
|
|
2350
2351
|
if (cs >= JSON_first_final && p == pe) {
|
2351
2352
|
return result;
|
@@ -2355,7 +2356,7 @@ case 5:
|
|
2355
2356
|
}
|
2356
2357
|
|
2357
2358
|
|
2358
|
-
// line
|
2359
|
+
// line 2360 "Parser.java"
|
2359
2360
|
private static byte[] init__JSON_quirks_mode_actions_0()
|
2360
2361
|
{
|
2361
2362
|
return new byte [] {
|
@@ -2458,7 +2459,7 @@ static final int JSON_quirks_mode_error = 0;
|
|
2458
2459
|
static final int JSON_quirks_mode_en_main = 1;
|
2459
2460
|
|
2460
2461
|
|
2461
|
-
// line
|
2462
|
+
// line 907 "Parser.rl"
|
2462
2463
|
|
2463
2464
|
|
2464
2465
|
public IRubyObject parseQuirksMode() {
|
@@ -2468,16 +2469,16 @@ static final int JSON_quirks_mode_en_main = 1;
|
|
2468
2469
|
ParserResult res = new ParserResult();
|
2469
2470
|
|
2470
2471
|
|
2471
|
-
// line
|
2472
|
+
// line 2473 "Parser.java"
|
2472
2473
|
{
|
2473
2474
|
cs = JSON_quirks_mode_start;
|
2474
2475
|
}
|
2475
2476
|
|
2476
|
-
// line
|
2477
|
+
// line 916 "Parser.rl"
|
2477
2478
|
p = byteList.begin();
|
2478
2479
|
pe = p + byteList.length();
|
2479
2480
|
|
2480
|
-
// line
|
2481
|
+
// line 2482 "Parser.java"
|
2481
2482
|
{
|
2482
2483
|
int _klen;
|
2483
2484
|
int _trans = 0;
|
@@ -2558,7 +2559,7 @@ case 1:
|
|
2558
2559
|
switch ( _JSON_quirks_mode_actions[_acts++] )
|
2559
2560
|
{
|
2560
2561
|
case 0:
|
2561
|
-
// line
|
2562
|
+
// line 893 "Parser.rl"
|
2562
2563
|
{
|
2563
2564
|
parseValue(res, p, pe);
|
2564
2565
|
if (res.result == null) {
|
@@ -2570,7 +2571,7 @@ case 1:
|
|
2570
2571
|
}
|
2571
2572
|
}
|
2572
2573
|
break;
|
2573
|
-
// line
|
2574
|
+
// line 2575 "Parser.java"
|
2574
2575
|
}
|
2575
2576
|
}
|
2576
2577
|
}
|
@@ -2590,7 +2591,7 @@ case 5:
|
|
2590
2591
|
break; }
|
2591
2592
|
}
|
2592
2593
|
|
2593
|
-
// line
|
2594
|
+
// line 919 "Parser.rl"
|
2594
2595
|
|
2595
2596
|
if (cs >= JSON_quirks_mode_first_final && p == pe) {
|
2596
2597
|
return result;
|