@@ -1834,78 +1834,78 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
18341834 }
18351835
18361836 if (!NIL_P (opts )) {
1837- VALUE tmp = ID2SYM (i_max_nesting );
1838- if (option_given_p (opts , tmp )) {
1839- VALUE max_nesting = rb_hash_aref (opts , tmp );
1840- if (RTEST (max_nesting )) {
1841- Check_Type (max_nesting , T_FIXNUM );
1842- json -> max_nesting = FIX2INT (max_nesting );
1843- } else {
1844- json -> max_nesting = 0 ;
1845- }
1846- } else {
1847- json -> max_nesting = 100 ;
1848- }
1849- tmp = ID2SYM (i_allow_nan );
1850- if (option_given_p (opts , tmp )) {
1851- json -> allow_nan = RTEST (rb_hash_aref (opts , tmp )) ? 1 : 0 ;
1852- } else {
1853- json -> allow_nan = 0 ;
1854- }
1855- tmp = ID2SYM (i_symbolize_names );
1856- if (option_given_p (opts , tmp )) {
1857- json -> symbolize_names = RTEST (rb_hash_aref (opts , tmp )) ? 1 : 0 ;
1858- } else {
1859- json -> symbolize_names = 0 ;
1860- }
1861- tmp = ID2SYM (i_freeze );
1862- if (option_given_p (opts , tmp )) {
1863- json -> freeze = RTEST (rb_hash_aref (opts , tmp )) ? 1 : 0 ;
1864- } else {
1865- json -> freeze = 0 ;
1866- }
1867- tmp = ID2SYM (i_create_additions );
1868- if (option_given_p (opts , tmp )) {
1869- json -> create_additions = RTEST (rb_hash_aref (opts , tmp ));
1870- } else {
1871- json -> create_additions = 0 ;
1872- }
1873- if (json -> symbolize_names && json -> create_additions ) {
1874- rb_raise (rb_eArgError ,
1875- "options :symbolize_names and :create_additions cannot be "
1876- " used in conjunction" );
1877- }
1878- tmp = ID2SYM (i_create_id );
1879- if (option_given_p (opts , tmp )) {
1880- json -> create_id = rb_hash_aref (opts , tmp );
1881- } else {
1882- json -> create_id = rb_funcall (mJSON , i_create_id , 0 );
1883- }
1884- tmp = ID2SYM (i_object_class );
1885- if (option_given_p (opts , tmp )) {
1886- json -> object_class = rb_hash_aref (opts , tmp );
1887- } else {
1888- json -> object_class = Qnil ;
1889- }
1890- tmp = ID2SYM (i_array_class );
1891- if (option_given_p (opts , tmp )) {
1892- json -> array_class = rb_hash_aref (opts , tmp );
1893- } else {
1894- json -> array_class = Qnil ;
1895- }
1896- tmp = ID2SYM (i_decimal_class );
1897- if (option_given_p (opts , tmp )) {
1898- json -> decimal_class = rb_hash_aref (opts , tmp );
1899- } else {
1900- json -> decimal_class = Qnil ;
1901- }
1902- tmp = ID2SYM (i_match_string );
1903- if (option_given_p (opts , tmp )) {
1904- VALUE match_string = rb_hash_aref (opts , tmp );
1905- json -> match_string = RTEST (match_string ) ? match_string : Qnil ;
1906- } else {
1907- json -> match_string = Qnil ;
1908- }
1837+ VALUE tmp = ID2SYM (i_max_nesting );
1838+ if (option_given_p (opts , tmp )) {
1839+ VALUE max_nesting = rb_hash_aref (opts , tmp );
1840+ if (RTEST (max_nesting )) {
1841+ Check_Type (max_nesting , T_FIXNUM );
1842+ json -> max_nesting = FIX2INT (max_nesting );
1843+ } else {
1844+ json -> max_nesting = 0 ;
1845+ }
1846+ } else {
1847+ json -> max_nesting = 100 ;
1848+ }
1849+ tmp = ID2SYM (i_allow_nan );
1850+ if (option_given_p (opts , tmp )) {
1851+ json -> allow_nan = RTEST (rb_hash_aref (opts , tmp )) ? 1 : 0 ;
1852+ } else {
1853+ json -> allow_nan = 0 ;
1854+ }
1855+ tmp = ID2SYM (i_symbolize_names );
1856+ if (option_given_p (opts , tmp )) {
1857+ json -> symbolize_names = RTEST (rb_hash_aref (opts , tmp )) ? 1 : 0 ;
1858+ } else {
1859+ json -> symbolize_names = 0 ;
1860+ }
1861+ tmp = ID2SYM (i_freeze );
1862+ if (option_given_p (opts , tmp )) {
1863+ json -> freeze = RTEST (rb_hash_aref (opts , tmp )) ? 1 : 0 ;
1864+ } else {
1865+ json -> freeze = 0 ;
1866+ }
1867+ tmp = ID2SYM (i_create_additions );
1868+ if (option_given_p (opts , tmp )) {
1869+ json -> create_additions = RTEST (rb_hash_aref (opts , tmp ));
1870+ } else {
1871+ json -> create_additions = 0 ;
1872+ }
1873+ if (json -> symbolize_names && json -> create_additions ) {
1874+ rb_raise (rb_eArgError ,
1875+ "options :symbolize_names and :create_additions cannot be "
1876+ " used in conjunction" );
1877+ }
1878+ tmp = ID2SYM (i_create_id );
1879+ if (option_given_p (opts , tmp )) {
1880+ json -> create_id = rb_hash_aref (opts , tmp );
1881+ } else {
1882+ json -> create_id = rb_funcall (mJSON , i_create_id , 0 );
1883+ }
1884+ tmp = ID2SYM (i_object_class );
1885+ if (option_given_p (opts , tmp )) {
1886+ json -> object_class = rb_hash_aref (opts , tmp );
1887+ } else {
1888+ json -> object_class = Qnil ;
1889+ }
1890+ tmp = ID2SYM (i_array_class );
1891+ if (option_given_p (opts , tmp )) {
1892+ json -> array_class = rb_hash_aref (opts , tmp );
1893+ } else {
1894+ json -> array_class = Qnil ;
1895+ }
1896+ tmp = ID2SYM (i_decimal_class );
1897+ if (option_given_p (opts , tmp )) {
1898+ json -> decimal_class = rb_hash_aref (opts , tmp );
1899+ } else {
1900+ json -> decimal_class = Qnil ;
1901+ }
1902+ tmp = ID2SYM (i_match_string );
1903+ if (option_given_p (opts , tmp )) {
1904+ VALUE match_string = rb_hash_aref (opts , tmp );
1905+ json -> match_string = RTEST (match_string ) ? match_string : Qnil ;
1906+ } else {
1907+ json -> match_string = Qnil ;
1908+ }
19091909 } else {
19101910 json -> max_nesting = 100 ;
19111911 json -> allow_nan = 0 ;
0 commit comments