json_pure 1.5.5 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +3 -7
- data/Gemfile +0 -4
- data/Rakefile +0 -7
- data/VERSION +1 -1
- data/ext/json/ext/parser/parser.c +18 -18
- data/ext/json/ext/parser/parser.rl +1 -4
- data/install.rb +1 -8
- data/java/src/json/ext/Parser.java +85 -81
- data/java/src/json/ext/Parser.rl +1 -1
- data/json.gemspec +5 -6
- data/json_pure.gemspec +4 -8
- data/lib/json/add/core.rb +9 -244
- data/lib/json/add/date.rb +34 -0
- data/lib/json/add/date_time.rb +50 -0
- data/lib/json/add/exception.rb +31 -0
- data/lib/json/add/range.rb +29 -0
- data/lib/json/add/regexp.rb +30 -0
- data/lib/json/add/struct.rb +30 -0
- data/lib/json/add/symbol.rb +25 -0
- data/lib/json/add/time.rb +35 -0
- data/lib/json/common.rb +5 -12
- data/lib/json/pure/parser.rb +4 -4
- data/lib/json/version.rb +1 -1
- data/tests/test_json.rb +2 -22
- data/tests/test_json_addition.rb +21 -29
- data/tests/test_json_string_matching.rb +6 -5
- data/tools/server.rb +1 -0
- metadata +125 -174
- data/0001-Security-fix-create_additons-JSON-GenericObject.patch +0 -448
- data/0001-Security-fix-create_additons-problem-1.5.5.patch +0 -630
- data/0001-Security-fix-for-create_additions-problem-1.6.8.patch +0 -685
- data/Gemfile.lock +0 -60
- data/bin/edit_json.rb +0 -9
- data/bin/prettify_json.rb +0 -48
- data/lib/json/Array.xpm +0 -21
- data/lib/json/FalseClass.xpm +0 -21
- data/lib/json/Hash.xpm +0 -21
- data/lib/json/Key.xpm +0 -73
- data/lib/json/NilClass.xpm +0 -21
- data/lib/json/Numeric.xpm +0 -28
- data/lib/json/String.xpm +0 -96
- data/lib/json/TrueClass.xpm +0 -21
- data/lib/json/editor.rb +0 -1369
- data/lib/json/json.xpm +0 -1499
data/CHANGES
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
*
|
3
|
-
|
4
|
-
explicitely requested by setting the create_additions argument to true or
|
5
|
-
using the JSON.load/dump interface.
|
6
|
-
* Backport change that corrects Time serialisation/deserialisation on some
|
7
|
-
platforms.
|
1
|
+
2011-09-12 (1.6.0)
|
2
|
+
* Extract utilities (prettifier and GUI-editor) in its own gem json-utils.
|
3
|
+
* Split json/add/core into different files for classes to be serialised.
|
8
4
|
2011-08-31 (1.5.4)
|
9
5
|
* Fix memory leak when used from multiple JRuby. (Patch by
|
10
6
|
jfirebaugh@github).
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -96,10 +96,6 @@ if defined?(Gem) and defined?(Gem::PackageTask)
|
|
96
96
|
s.add_development_dependency 'bullshit'
|
97
97
|
s.add_development_dependency 'sdoc'
|
98
98
|
s.add_development_dependency 'rake', '~>0.9.2'
|
99
|
-
s.add_dependency 'spruz', '~>0.2.8'
|
100
|
-
|
101
|
-
s.bindir = "bin"
|
102
|
-
s.executables = [ "edit_json.rb", "prettify_json.rb" ]
|
103
99
|
|
104
100
|
s.extra_rdoc_files << 'README.rdoc'
|
105
101
|
s.rdoc_options <<
|
@@ -141,9 +137,6 @@ if defined?(Gem) and defined?(Gem::PackageTask)
|
|
141
137
|
s.add_development_dependency 'bullshit'
|
142
138
|
s.add_development_dependency 'sdoc'
|
143
139
|
|
144
|
-
s.bindir = "bin"
|
145
|
-
s.executables = [ "edit_json.rb", "prettify_json.rb" ]
|
146
|
-
|
147
140
|
s.extra_rdoc_files << 'README.rdoc'
|
148
141
|
s.rdoc_options <<
|
149
142
|
'--title' << 'JSON implemention for Ruby' << '--main' << 'README.rdoc'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.6.0
|
@@ -1671,7 +1671,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
|
|
1671
1671
|
if (option_given_p(opts, tmp)) {
|
1672
1672
|
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
|
1673
1673
|
} else {
|
1674
|
-
json->create_additions =
|
1674
|
+
json->create_additions = 1;
|
1675
1675
|
}
|
1676
1676
|
tmp = ID2SYM(i_create_id);
|
1677
1677
|
if (option_given_p(opts, tmp)) {
|
@@ -1718,7 +1718,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
|
|
1718
1718
|
}
|
1719
1719
|
|
1720
1720
|
|
1721
|
-
#line
|
1721
|
+
#line 1719 "parser.c"
|
1722
1722
|
static const int JSON_start = 1;
|
1723
1723
|
static const int JSON_first_final = 10;
|
1724
1724
|
static const int JSON_error = 0;
|
@@ -1726,7 +1726,7 @@ static const int JSON_error = 0;
|
|
1726
1726
|
static const int JSON_en_main = 1;
|
1727
1727
|
|
1728
1728
|
|
1729
|
-
#line
|
1729
|
+
#line 726 "parser.rl"
|
1730
1730
|
|
1731
1731
|
|
1732
1732
|
static VALUE cParser_parse_strict(VALUE self)
|
@@ -1737,16 +1737,16 @@ static VALUE cParser_parse_strict(VALUE self)
|
|
1737
1737
|
GET_PARSER;
|
1738
1738
|
|
1739
1739
|
|
1740
|
-
#line
|
1740
|
+
#line 1738 "parser.c"
|
1741
1741
|
{
|
1742
1742
|
cs = JSON_start;
|
1743
1743
|
}
|
1744
1744
|
|
1745
|
-
#line
|
1745
|
+
#line 736 "parser.rl"
|
1746
1746
|
p = json->source;
|
1747
1747
|
pe = p + json->len;
|
1748
1748
|
|
1749
|
-
#line
|
1749
|
+
#line 1747 "parser.c"
|
1750
1750
|
{
|
1751
1751
|
if ( p == pe )
|
1752
1752
|
goto _test_eof;
|
@@ -1802,7 +1802,7 @@ case 5:
|
|
1802
1802
|
goto st1;
|
1803
1803
|
goto st5;
|
1804
1804
|
tr3:
|
1805
|
-
#line
|
1805
|
+
#line 715 "parser.rl"
|
1806
1806
|
{
|
1807
1807
|
char *np;
|
1808
1808
|
json->current_nesting = 1;
|
@@ -1811,7 +1811,7 @@ tr3:
|
|
1811
1811
|
}
|
1812
1812
|
goto st10;
|
1813
1813
|
tr4:
|
1814
|
-
#line
|
1814
|
+
#line 708 "parser.rl"
|
1815
1815
|
{
|
1816
1816
|
char *np;
|
1817
1817
|
json->current_nesting = 1;
|
@@ -1823,7 +1823,7 @@ st10:
|
|
1823
1823
|
if ( ++p == pe )
|
1824
1824
|
goto _test_eof10;
|
1825
1825
|
case 10:
|
1826
|
-
#line
|
1826
|
+
#line 1824 "parser.c"
|
1827
1827
|
switch( (*p) ) {
|
1828
1828
|
case 13: goto st10;
|
1829
1829
|
case 32: goto st10;
|
@@ -1880,7 +1880,7 @@ case 9:
|
|
1880
1880
|
_out: {}
|
1881
1881
|
}
|
1882
1882
|
|
1883
|
-
#line
|
1883
|
+
#line 739 "parser.rl"
|
1884
1884
|
|
1885
1885
|
if (cs >= JSON_first_final && p == pe) {
|
1886
1886
|
return result;
|
@@ -1892,7 +1892,7 @@ case 9:
|
|
1892
1892
|
|
1893
1893
|
|
1894
1894
|
|
1895
|
-
#line
|
1895
|
+
#line 1893 "parser.c"
|
1896
1896
|
static const int JSON_quirks_mode_start = 1;
|
1897
1897
|
static const int JSON_quirks_mode_first_final = 10;
|
1898
1898
|
static const int JSON_quirks_mode_error = 0;
|
@@ -1900,7 +1900,7 @@ static const int JSON_quirks_mode_error = 0;
|
|
1900
1900
|
static const int JSON_quirks_mode_en_main = 1;
|
1901
1901
|
|
1902
1902
|
|
1903
|
-
#line
|
1903
|
+
#line 764 "parser.rl"
|
1904
1904
|
|
1905
1905
|
|
1906
1906
|
static VALUE cParser_parse_quirks_mode(VALUE self)
|
@@ -1911,16 +1911,16 @@ static VALUE cParser_parse_quirks_mode(VALUE self)
|
|
1911
1911
|
GET_PARSER;
|
1912
1912
|
|
1913
1913
|
|
1914
|
-
#line
|
1914
|
+
#line 1912 "parser.c"
|
1915
1915
|
{
|
1916
1916
|
cs = JSON_quirks_mode_start;
|
1917
1917
|
}
|
1918
1918
|
|
1919
|
-
#line
|
1919
|
+
#line 774 "parser.rl"
|
1920
1920
|
p = json->source;
|
1921
1921
|
pe = p + json->len;
|
1922
1922
|
|
1923
|
-
#line
|
1923
|
+
#line 1921 "parser.c"
|
1924
1924
|
{
|
1925
1925
|
if ( p == pe )
|
1926
1926
|
goto _test_eof;
|
@@ -1954,7 +1954,7 @@ st0:
|
|
1954
1954
|
cs = 0;
|
1955
1955
|
goto _out;
|
1956
1956
|
tr2:
|
1957
|
-
#line
|
1957
|
+
#line 756 "parser.rl"
|
1958
1958
|
{
|
1959
1959
|
char *np = JSON_parse_value(json, p, pe, &result);
|
1960
1960
|
if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
|
@@ -1964,7 +1964,7 @@ st10:
|
|
1964
1964
|
if ( ++p == pe )
|
1965
1965
|
goto _test_eof10;
|
1966
1966
|
case 10:
|
1967
|
-
#line
|
1967
|
+
#line 1965 "parser.c"
|
1968
1968
|
switch( (*p) ) {
|
1969
1969
|
case 13: goto st10;
|
1970
1970
|
case 32: goto st10;
|
@@ -2053,7 +2053,7 @@ case 9:
|
|
2053
2053
|
_out: {}
|
2054
2054
|
}
|
2055
2055
|
|
2056
|
-
#line
|
2056
|
+
#line 777 "parser.rl"
|
2057
2057
|
|
2058
2058
|
if (cs >= JSON_quirks_mode_first_final && p == pe) {
|
2059
2059
|
return result;
|
@@ -602,9 +602,6 @@ static VALUE convert_encoding(VALUE source)
|
|
602
602
|
* defaults to true.
|
603
603
|
* * *object_class*: Defaults to Hash
|
604
604
|
* * *array_class*: Defaults to Array
|
605
|
-
* * *quirks_mode*: Enables quirks_mode for parser, that is for example
|
606
|
-
* parsing single JSON values instead of documents is possible.
|
607
|
-
*
|
608
605
|
*/
|
609
606
|
static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
|
610
607
|
{
|
@@ -655,7 +652,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
|
|
655
652
|
if (option_given_p(opts, tmp)) {
|
656
653
|
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
|
657
654
|
} else {
|
658
|
-
json->create_additions =
|
655
|
+
json->create_additions = 1;
|
659
656
|
}
|
660
657
|
tmp = ID2SYM(i_create_id);
|
661
658
|
if (option_given_p(opts, tmp)) {
|
data/install.rb
CHANGED
@@ -6,21 +6,14 @@ include FileUtils::Verbose
|
|
6
6
|
|
7
7
|
include Config
|
8
8
|
|
9
|
-
bindir = CONFIG["bindir"]
|
10
|
-
cd 'bin' do
|
11
|
-
filename = 'edit_json.rb'
|
12
|
-
#install(filename, bindir)
|
13
|
-
end
|
14
9
|
sitelibdir = CONFIG["sitelibdir"]
|
15
10
|
cd 'lib' do
|
16
11
|
install('json.rb', sitelibdir)
|
17
12
|
mkdir_p File.join(sitelibdir, 'json')
|
18
|
-
for file in Dir['json
|
13
|
+
for file in Dir['json/**/*}']
|
19
14
|
d = File.join(sitelibdir, file)
|
20
15
|
mkdir_p File.dirname(d)
|
21
16
|
install(file, d)
|
22
17
|
end
|
23
|
-
install(File.join('json', 'editor.rb'), File.join(sitelibdir,'json'))
|
24
|
-
install(File.join('json', 'json.xpm'), File.join(sitelibdir,'json'))
|
25
18
|
end
|
26
19
|
warn " *** Installed PURE ruby library."
|
@@ -136,6 +136,10 @@ public class Parser extends RubyObject {
|
|
136
136
|
*
|
137
137
|
* <dt><code>:array_class</code>
|
138
138
|
* <dd>Defaults to Array.
|
139
|
+
*
|
140
|
+
* <dt><code>:quirks_mode</code>
|
141
|
+
* <dd>Enables quirks_mode for parser, that is for example parsing single
|
142
|
+
* JSON values instead of documents is possible.
|
139
143
|
* </dl>
|
140
144
|
*/
|
141
145
|
@JRubyMethod(name = "new", required = 1, optional = 1, meta = true)
|
@@ -160,7 +164,7 @@ public class Parser extends RubyObject {
|
|
160
164
|
this.symbolizeNames = opts.getBool("symbolize_names", false);
|
161
165
|
this.quirksMode = opts.getBool("quirks_mode", false);
|
162
166
|
this.createId = opts.getString("create_id", getCreateId(context));
|
163
|
-
this.createAdditions = opts.getBool("create_additions",
|
167
|
+
this.createAdditions = opts.getBool("create_additions", true);
|
164
168
|
this.objectClass = opts.getClass("object_class", runtime.getHash());
|
165
169
|
this.arrayClass = opts.getClass("array_class", runtime.getArray());
|
166
170
|
this.match_string = opts.getHash("match_string");
|
@@ -327,11 +331,11 @@ public class Parser extends RubyObject {
|
|
327
331
|
}
|
328
332
|
|
329
333
|
|
330
|
-
// line
|
334
|
+
// line 357 "Parser.rl"
|
331
335
|
|
332
336
|
|
333
337
|
|
334
|
-
// line
|
338
|
+
// line 339 "Parser.java"
|
335
339
|
private static byte[] init__JSON_value_actions_0()
|
336
340
|
{
|
337
341
|
return new byte [] {
|
@@ -445,7 +449,7 @@ static final int JSON_value_error = 0;
|
|
445
449
|
static final int JSON_value_en_main = 1;
|
446
450
|
|
447
451
|
|
448
|
-
// line
|
452
|
+
// line 463 "Parser.rl"
|
449
453
|
|
450
454
|
|
451
455
|
ParserResult parseValue(int p, int pe) {
|
@@ -453,14 +457,14 @@ static final int JSON_value_en_main = 1;
|
|
453
457
|
IRubyObject result = null;
|
454
458
|
|
455
459
|
|
456
|
-
// line
|
460
|
+
// line 461 "Parser.java"
|
457
461
|
{
|
458
462
|
cs = JSON_value_start;
|
459
463
|
}
|
460
464
|
|
461
|
-
// line
|
465
|
+
// line 470 "Parser.rl"
|
462
466
|
|
463
|
-
// line
|
467
|
+
// line 468 "Parser.java"
|
464
468
|
{
|
465
469
|
int _klen;
|
466
470
|
int _trans = 0;
|
@@ -486,13 +490,13 @@ case 1:
|
|
486
490
|
while ( _nacts-- > 0 ) {
|
487
491
|
switch ( _JSON_value_actions[_acts++] ) {
|
488
492
|
case 9:
|
489
|
-
// line
|
493
|
+
// line 448 "Parser.rl"
|
490
494
|
{
|
491
495
|
p--;
|
492
496
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
493
497
|
}
|
494
498
|
break;
|
495
|
-
// line
|
499
|
+
// line 500 "Parser.java"
|
496
500
|
}
|
497
501
|
}
|
498
502
|
|
@@ -555,25 +559,25 @@ case 1:
|
|
555
559
|
switch ( _JSON_value_actions[_acts++] )
|
556
560
|
{
|
557
561
|
case 0:
|
558
|
-
// line
|
562
|
+
// line 365 "Parser.rl"
|
559
563
|
{
|
560
564
|
result = getRuntime().getNil();
|
561
565
|
}
|
562
566
|
break;
|
563
567
|
case 1:
|
564
|
-
// line
|
568
|
+
// line 368 "Parser.rl"
|
565
569
|
{
|
566
570
|
result = getRuntime().getFalse();
|
567
571
|
}
|
568
572
|
break;
|
569
573
|
case 2:
|
570
|
-
// line
|
574
|
+
// line 371 "Parser.rl"
|
571
575
|
{
|
572
576
|
result = getRuntime().getTrue();
|
573
577
|
}
|
574
578
|
break;
|
575
579
|
case 3:
|
576
|
-
// line
|
580
|
+
// line 374 "Parser.rl"
|
577
581
|
{
|
578
582
|
if (parser.allowNaN) {
|
579
583
|
result = getConstant(CONST_NAN);
|
@@ -583,7 +587,7 @@ case 1:
|
|
583
587
|
}
|
584
588
|
break;
|
585
589
|
case 4:
|
586
|
-
// line
|
590
|
+
// line 381 "Parser.rl"
|
587
591
|
{
|
588
592
|
if (parser.allowNaN) {
|
589
593
|
result = getConstant(CONST_INFINITY);
|
@@ -593,7 +597,7 @@ case 1:
|
|
593
597
|
}
|
594
598
|
break;
|
595
599
|
case 5:
|
596
|
-
// line
|
600
|
+
// line 388 "Parser.rl"
|
597
601
|
{
|
598
602
|
if (pe > p + 9 - (parser.quirksMode ? 1 : 0) &&
|
599
603
|
absSubSequence(p, p + 9).toString().equals(JSON_MINUS_INFINITY)) {
|
@@ -622,7 +626,7 @@ case 1:
|
|
622
626
|
}
|
623
627
|
break;
|
624
628
|
case 6:
|
625
|
-
// line
|
629
|
+
// line 414 "Parser.rl"
|
626
630
|
{
|
627
631
|
ParserResult res = parseString(p, pe);
|
628
632
|
if (res == null) {
|
@@ -635,7 +639,7 @@ case 1:
|
|
635
639
|
}
|
636
640
|
break;
|
637
641
|
case 7:
|
638
|
-
// line
|
642
|
+
// line 424 "Parser.rl"
|
639
643
|
{
|
640
644
|
currentNesting++;
|
641
645
|
ParserResult res = parseArray(p, pe);
|
@@ -650,7 +654,7 @@ case 1:
|
|
650
654
|
}
|
651
655
|
break;
|
652
656
|
case 8:
|
653
|
-
// line
|
657
|
+
// line 436 "Parser.rl"
|
654
658
|
{
|
655
659
|
currentNesting++;
|
656
660
|
ParserResult res = parseObject(p, pe);
|
@@ -664,7 +668,7 @@ case 1:
|
|
664
668
|
}
|
665
669
|
}
|
666
670
|
break;
|
667
|
-
// line
|
671
|
+
// line 672 "Parser.java"
|
668
672
|
}
|
669
673
|
}
|
670
674
|
}
|
@@ -684,7 +688,7 @@ case 5:
|
|
684
688
|
break; }
|
685
689
|
}
|
686
690
|
|
687
|
-
// line
|
691
|
+
// line 471 "Parser.rl"
|
688
692
|
|
689
693
|
if (cs >= JSON_value_first_final && result != null) {
|
690
694
|
return new ParserResult(result, p);
|
@@ -694,7 +698,7 @@ case 5:
|
|
694
698
|
}
|
695
699
|
|
696
700
|
|
697
|
-
// line
|
701
|
+
// line 702 "Parser.java"
|
698
702
|
private static byte[] init__JSON_integer_actions_0()
|
699
703
|
{
|
700
704
|
return new byte [] {
|
@@ -793,22 +797,22 @@ static final int JSON_integer_error = 0;
|
|
793
797
|
static final int JSON_integer_en_main = 1;
|
794
798
|
|
795
799
|
|
796
|
-
// line
|
800
|
+
// line 490 "Parser.rl"
|
797
801
|
|
798
802
|
|
799
803
|
ParserResult parseInteger(int p, int pe) {
|
800
804
|
int cs = EVIL;
|
801
805
|
|
802
806
|
|
803
|
-
// line
|
807
|
+
// line 808 "Parser.java"
|
804
808
|
{
|
805
809
|
cs = JSON_integer_start;
|
806
810
|
}
|
807
811
|
|
808
|
-
// line
|
812
|
+
// line 496 "Parser.rl"
|
809
813
|
int memo = p;
|
810
814
|
|
811
|
-
// line
|
815
|
+
// line 816 "Parser.java"
|
812
816
|
{
|
813
817
|
int _klen;
|
814
818
|
int _trans = 0;
|
@@ -889,13 +893,13 @@ case 1:
|
|
889
893
|
switch ( _JSON_integer_actions[_acts++] )
|
890
894
|
{
|
891
895
|
case 0:
|
892
|
-
// line
|
896
|
+
// line 484 "Parser.rl"
|
893
897
|
{
|
894
898
|
p--;
|
895
899
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
896
900
|
}
|
897
901
|
break;
|
898
|
-
// line
|
902
|
+
// line 903 "Parser.java"
|
899
903
|
}
|
900
904
|
}
|
901
905
|
}
|
@@ -915,7 +919,7 @@ case 5:
|
|
915
919
|
break; }
|
916
920
|
}
|
917
921
|
|
918
|
-
// line
|
922
|
+
// line 498 "Parser.rl"
|
919
923
|
|
920
924
|
if (cs < JSON_integer_first_final) {
|
921
925
|
return null;
|
@@ -930,7 +934,7 @@ case 5:
|
|
930
934
|
}
|
931
935
|
|
932
936
|
|
933
|
-
// line
|
937
|
+
// line 938 "Parser.java"
|
934
938
|
private static byte[] init__JSON_float_actions_0()
|
935
939
|
{
|
936
940
|
return new byte [] {
|
@@ -1032,22 +1036,22 @@ static final int JSON_float_error = 0;
|
|
1032
1036
|
static final int JSON_float_en_main = 1;
|
1033
1037
|
|
1034
1038
|
|
1035
|
-
// line
|
1039
|
+
// line 526 "Parser.rl"
|
1036
1040
|
|
1037
1041
|
|
1038
1042
|
ParserResult parseFloat(int p, int pe) {
|
1039
1043
|
int cs = EVIL;
|
1040
1044
|
|
1041
1045
|
|
1042
|
-
// line
|
1046
|
+
// line 1047 "Parser.java"
|
1043
1047
|
{
|
1044
1048
|
cs = JSON_float_start;
|
1045
1049
|
}
|
1046
1050
|
|
1047
|
-
// line
|
1051
|
+
// line 532 "Parser.rl"
|
1048
1052
|
int memo = p;
|
1049
1053
|
|
1050
|
-
// line
|
1054
|
+
// line 1055 "Parser.java"
|
1051
1055
|
{
|
1052
1056
|
int _klen;
|
1053
1057
|
int _trans = 0;
|
@@ -1128,13 +1132,13 @@ case 1:
|
|
1128
1132
|
switch ( _JSON_float_actions[_acts++] )
|
1129
1133
|
{
|
1130
1134
|
case 0:
|
1131
|
-
// line
|
1135
|
+
// line 517 "Parser.rl"
|
1132
1136
|
{
|
1133
1137
|
p--;
|
1134
1138
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1135
1139
|
}
|
1136
1140
|
break;
|
1137
|
-
// line
|
1141
|
+
// line 1142 "Parser.java"
|
1138
1142
|
}
|
1139
1143
|
}
|
1140
1144
|
}
|
@@ -1154,7 +1158,7 @@ case 5:
|
|
1154
1158
|
break; }
|
1155
1159
|
}
|
1156
1160
|
|
1157
|
-
// line
|
1161
|
+
// line 534 "Parser.rl"
|
1158
1162
|
|
1159
1163
|
if (cs < JSON_float_first_final) {
|
1160
1164
|
return null;
|
@@ -1169,7 +1173,7 @@ case 5:
|
|
1169
1173
|
}
|
1170
1174
|
|
1171
1175
|
|
1172
|
-
// line
|
1176
|
+
// line 1177 "Parser.java"
|
1173
1177
|
private static byte[] init__JSON_string_actions_0()
|
1174
1178
|
{
|
1175
1179
|
return new byte [] {
|
@@ -1271,7 +1275,7 @@ static final int JSON_string_error = 0;
|
|
1271
1275
|
static final int JSON_string_en_main = 1;
|
1272
1276
|
|
1273
1277
|
|
1274
|
-
// line
|
1278
|
+
// line 578 "Parser.rl"
|
1275
1279
|
|
1276
1280
|
|
1277
1281
|
ParserResult parseString(int p, int pe) {
|
@@ -1279,15 +1283,15 @@ static final int JSON_string_en_main = 1;
|
|
1279
1283
|
IRubyObject result = null;
|
1280
1284
|
|
1281
1285
|
|
1282
|
-
// line
|
1286
|
+
// line 1287 "Parser.java"
|
1283
1287
|
{
|
1284
1288
|
cs = JSON_string_start;
|
1285
1289
|
}
|
1286
1290
|
|
1287
|
-
// line
|
1291
|
+
// line 585 "Parser.rl"
|
1288
1292
|
int memo = p;
|
1289
1293
|
|
1290
|
-
// line
|
1294
|
+
// line 1295 "Parser.java"
|
1291
1295
|
{
|
1292
1296
|
int _klen;
|
1293
1297
|
int _trans = 0;
|
@@ -1368,7 +1372,7 @@ case 1:
|
|
1368
1372
|
switch ( _JSON_string_actions[_acts++] )
|
1369
1373
|
{
|
1370
1374
|
case 0:
|
1371
|
-
// line
|
1375
|
+
// line 553 "Parser.rl"
|
1372
1376
|
{
|
1373
1377
|
int offset = byteList.begin();
|
1374
1378
|
ByteList decoded = decoder.decode(byteList, memo + 1 - offset,
|
@@ -1383,13 +1387,13 @@ case 1:
|
|
1383
1387
|
}
|
1384
1388
|
break;
|
1385
1389
|
case 1:
|
1386
|
-
// line
|
1390
|
+
// line 566 "Parser.rl"
|
1387
1391
|
{
|
1388
1392
|
p--;
|
1389
1393
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1390
1394
|
}
|
1391
1395
|
break;
|
1392
|
-
// line
|
1396
|
+
// line 1397 "Parser.java"
|
1393
1397
|
}
|
1394
1398
|
}
|
1395
1399
|
}
|
@@ -1409,7 +1413,7 @@ case 5:
|
|
1409
1413
|
break; }
|
1410
1414
|
}
|
1411
1415
|
|
1412
|
-
// line
|
1416
|
+
// line 587 "Parser.rl"
|
1413
1417
|
|
1414
1418
|
if (parser.createAdditions) {
|
1415
1419
|
RubyHash match_string = parser.match_string;
|
@@ -1444,7 +1448,7 @@ case 5:
|
|
1444
1448
|
}
|
1445
1449
|
|
1446
1450
|
|
1447
|
-
// line
|
1451
|
+
// line 1452 "Parser.java"
|
1448
1452
|
private static byte[] init__JSON_array_actions_0()
|
1449
1453
|
{
|
1450
1454
|
return new byte [] {
|
@@ -1557,7 +1561,7 @@ static final int JSON_array_error = 0;
|
|
1557
1561
|
static final int JSON_array_en_main = 1;
|
1558
1562
|
|
1559
1563
|
|
1560
|
-
// line
|
1564
|
+
// line 657 "Parser.rl"
|
1561
1565
|
|
1562
1566
|
|
1563
1567
|
ParserResult parseArray(int p, int pe) {
|
@@ -1575,14 +1579,14 @@ static final int JSON_array_en_main = 1;
|
|
1575
1579
|
IRubyObject.NULL_ARRAY, Block.NULL_BLOCK);
|
1576
1580
|
|
1577
1581
|
|
1578
|
-
// line
|
1582
|
+
// line 1583 "Parser.java"
|
1579
1583
|
{
|
1580
1584
|
cs = JSON_array_start;
|
1581
1585
|
}
|
1582
1586
|
|
1583
|
-
// line
|
1587
|
+
// line 674 "Parser.rl"
|
1584
1588
|
|
1585
|
-
// line
|
1589
|
+
// line 1590 "Parser.java"
|
1586
1590
|
{
|
1587
1591
|
int _klen;
|
1588
1592
|
int _trans = 0;
|
@@ -1663,7 +1667,7 @@ case 1:
|
|
1663
1667
|
switch ( _JSON_array_actions[_acts++] )
|
1664
1668
|
{
|
1665
1669
|
case 0:
|
1666
|
-
// line
|
1670
|
+
// line 626 "Parser.rl"
|
1667
1671
|
{
|
1668
1672
|
ParserResult res = parseValue(p, pe);
|
1669
1673
|
if (res == null) {
|
@@ -1680,13 +1684,13 @@ case 1:
|
|
1680
1684
|
}
|
1681
1685
|
break;
|
1682
1686
|
case 1:
|
1683
|
-
// line
|
1687
|
+
// line 641 "Parser.rl"
|
1684
1688
|
{
|
1685
1689
|
p--;
|
1686
1690
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1687
1691
|
}
|
1688
1692
|
break;
|
1689
|
-
// line
|
1693
|
+
// line 1694 "Parser.java"
|
1690
1694
|
}
|
1691
1695
|
}
|
1692
1696
|
}
|
@@ -1706,7 +1710,7 @@ case 5:
|
|
1706
1710
|
break; }
|
1707
1711
|
}
|
1708
1712
|
|
1709
|
-
// line
|
1713
|
+
// line 675 "Parser.rl"
|
1710
1714
|
|
1711
1715
|
if (cs >= JSON_array_first_final) {
|
1712
1716
|
return new ParserResult(result, p + 1);
|
@@ -1716,7 +1720,7 @@ case 5:
|
|
1716
1720
|
}
|
1717
1721
|
|
1718
1722
|
|
1719
|
-
// line
|
1723
|
+
// line 1724 "Parser.java"
|
1720
1724
|
private static byte[] init__JSON_object_actions_0()
|
1721
1725
|
{
|
1722
1726
|
return new byte [] {
|
@@ -1839,7 +1843,7 @@ static final int JSON_object_error = 0;
|
|
1839
1843
|
static final int JSON_object_en_main = 1;
|
1840
1844
|
|
1841
1845
|
|
1842
|
-
// line
|
1846
|
+
// line 734 "Parser.rl"
|
1843
1847
|
|
1844
1848
|
|
1845
1849
|
ParserResult parseObject(int p, int pe) {
|
@@ -1858,14 +1862,14 @@ static final int JSON_object_en_main = 1;
|
|
1858
1862
|
IRubyObject.NULL_ARRAY, Block.NULL_BLOCK);
|
1859
1863
|
|
1860
1864
|
|
1861
|
-
// line
|
1865
|
+
// line 1866 "Parser.java"
|
1862
1866
|
{
|
1863
1867
|
cs = JSON_object_start;
|
1864
1868
|
}
|
1865
1869
|
|
1866
|
-
// line
|
1870
|
+
// line 752 "Parser.rl"
|
1867
1871
|
|
1868
|
-
// line
|
1872
|
+
// line 1873 "Parser.java"
|
1869
1873
|
{
|
1870
1874
|
int _klen;
|
1871
1875
|
int _trans = 0;
|
@@ -1946,7 +1950,7 @@ case 1:
|
|
1946
1950
|
switch ( _JSON_object_actions[_acts++] )
|
1947
1951
|
{
|
1948
1952
|
case 0:
|
1949
|
-
// line
|
1953
|
+
// line 689 "Parser.rl"
|
1950
1954
|
{
|
1951
1955
|
ParserResult res = parseValue(p, pe);
|
1952
1956
|
if (res == null) {
|
@@ -1963,7 +1967,7 @@ case 1:
|
|
1963
1967
|
}
|
1964
1968
|
break;
|
1965
1969
|
case 1:
|
1966
|
-
// line
|
1970
|
+
// line 704 "Parser.rl"
|
1967
1971
|
{
|
1968
1972
|
ParserResult res = parseString(p, pe);
|
1969
1973
|
if (res == null) {
|
@@ -1983,13 +1987,13 @@ case 1:
|
|
1983
1987
|
}
|
1984
1988
|
break;
|
1985
1989
|
case 2:
|
1986
|
-
// line
|
1990
|
+
// line 722 "Parser.rl"
|
1987
1991
|
{
|
1988
1992
|
p--;
|
1989
1993
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
1990
1994
|
}
|
1991
1995
|
break;
|
1992
|
-
// line
|
1996
|
+
// line 1997 "Parser.java"
|
1993
1997
|
}
|
1994
1998
|
}
|
1995
1999
|
}
|
@@ -2009,7 +2013,7 @@ case 5:
|
|
2009
2013
|
break; }
|
2010
2014
|
}
|
2011
2015
|
|
2012
|
-
// line
|
2016
|
+
// line 753 "Parser.rl"
|
2013
2017
|
|
2014
2018
|
if (cs < JSON_object_first_final) {
|
2015
2019
|
return null;
|
@@ -2035,7 +2039,7 @@ case 5:
|
|
2035
2039
|
}
|
2036
2040
|
|
2037
2041
|
|
2038
|
-
// line
|
2042
|
+
// line 2043 "Parser.java"
|
2039
2043
|
private static byte[] init__JSON_actions_0()
|
2040
2044
|
{
|
2041
2045
|
return new byte [] {
|
@@ -2139,7 +2143,7 @@ static final int JSON_error = 0;
|
|
2139
2143
|
static final int JSON_en_main = 1;
|
2140
2144
|
|
2141
2145
|
|
2142
|
-
// line
|
2146
|
+
// line 811 "Parser.rl"
|
2143
2147
|
|
2144
2148
|
|
2145
2149
|
public IRubyObject parseStrict() {
|
@@ -2148,16 +2152,16 @@ static final int JSON_en_main = 1;
|
|
2148
2152
|
IRubyObject result = null;
|
2149
2153
|
|
2150
2154
|
|
2151
|
-
// line
|
2155
|
+
// line 2156 "Parser.java"
|
2152
2156
|
{
|
2153
2157
|
cs = JSON_start;
|
2154
2158
|
}
|
2155
2159
|
|
2156
|
-
// line
|
2160
|
+
// line 819 "Parser.rl"
|
2157
2161
|
p = byteList.begin();
|
2158
2162
|
pe = p + byteList.length();
|
2159
2163
|
|
2160
|
-
// line
|
2164
|
+
// line 2165 "Parser.java"
|
2161
2165
|
{
|
2162
2166
|
int _klen;
|
2163
2167
|
int _trans = 0;
|
@@ -2238,7 +2242,7 @@ case 1:
|
|
2238
2242
|
switch ( _JSON_actions[_acts++] )
|
2239
2243
|
{
|
2240
2244
|
case 0:
|
2241
|
-
// line
|
2245
|
+
// line 783 "Parser.rl"
|
2242
2246
|
{
|
2243
2247
|
currentNesting = 1;
|
2244
2248
|
ParserResult res = parseObject(p, pe);
|
@@ -2252,7 +2256,7 @@ case 1:
|
|
2252
2256
|
}
|
2253
2257
|
break;
|
2254
2258
|
case 1:
|
2255
|
-
// line
|
2259
|
+
// line 795 "Parser.rl"
|
2256
2260
|
{
|
2257
2261
|
currentNesting = 1;
|
2258
2262
|
ParserResult res = parseArray(p, pe);
|
@@ -2265,7 +2269,7 @@ case 1:
|
|
2265
2269
|
}
|
2266
2270
|
}
|
2267
2271
|
break;
|
2268
|
-
// line
|
2272
|
+
// line 2273 "Parser.java"
|
2269
2273
|
}
|
2270
2274
|
}
|
2271
2275
|
}
|
@@ -2285,7 +2289,7 @@ case 5:
|
|
2285
2289
|
break; }
|
2286
2290
|
}
|
2287
2291
|
|
2288
|
-
// line
|
2292
|
+
// line 822 "Parser.rl"
|
2289
2293
|
|
2290
2294
|
if (cs >= JSON_first_final && p == pe) {
|
2291
2295
|
return result;
|
@@ -2295,7 +2299,7 @@ case 5:
|
|
2295
2299
|
}
|
2296
2300
|
|
2297
2301
|
|
2298
|
-
// line
|
2302
|
+
// line 2303 "Parser.java"
|
2299
2303
|
private static byte[] init__JSON_quirks_mode_actions_0()
|
2300
2304
|
{
|
2301
2305
|
return new byte [] {
|
@@ -2398,7 +2402,7 @@ static final int JSON_quirks_mode_error = 0;
|
|
2398
2402
|
static final int JSON_quirks_mode_en_main = 1;
|
2399
2403
|
|
2400
2404
|
|
2401
|
-
// line
|
2405
|
+
// line 850 "Parser.rl"
|
2402
2406
|
|
2403
2407
|
|
2404
2408
|
public IRubyObject parseQuirksMode() {
|
@@ -2407,16 +2411,16 @@ static final int JSON_quirks_mode_en_main = 1;
|
|
2407
2411
|
IRubyObject result = null;
|
2408
2412
|
|
2409
2413
|
|
2410
|
-
// line
|
2414
|
+
// line 2415 "Parser.java"
|
2411
2415
|
{
|
2412
2416
|
cs = JSON_quirks_mode_start;
|
2413
2417
|
}
|
2414
2418
|
|
2415
|
-
// line
|
2419
|
+
// line 858 "Parser.rl"
|
2416
2420
|
p = byteList.begin();
|
2417
2421
|
pe = p + byteList.length();
|
2418
2422
|
|
2419
|
-
// line
|
2423
|
+
// line 2424 "Parser.java"
|
2420
2424
|
{
|
2421
2425
|
int _klen;
|
2422
2426
|
int _trans = 0;
|
@@ -2497,7 +2501,7 @@ case 1:
|
|
2497
2501
|
switch ( _JSON_quirks_mode_actions[_acts++] )
|
2498
2502
|
{
|
2499
2503
|
case 0:
|
2500
|
-
// line
|
2504
|
+
// line 836 "Parser.rl"
|
2501
2505
|
{
|
2502
2506
|
ParserResult res = parseValue(p, pe);
|
2503
2507
|
if (res == null) {
|
@@ -2509,7 +2513,7 @@ case 1:
|
|
2509
2513
|
}
|
2510
2514
|
}
|
2511
2515
|
break;
|
2512
|
-
// line
|
2516
|
+
// line 2517 "Parser.java"
|
2513
2517
|
}
|
2514
2518
|
}
|
2515
2519
|
}
|
@@ -2529,7 +2533,7 @@ case 5:
|
|
2529
2533
|
break; }
|
2530
2534
|
}
|
2531
2535
|
|
2532
|
-
// line
|
2536
|
+
// line 861 "Parser.rl"
|
2533
2537
|
|
2534
2538
|
if (cs >= JSON_quirks_mode_first_final && p == pe) {
|
2535
2539
|
return result;
|