Skip to content

Commit 618085f

Browse files
byroothsbt
authored andcommitted
[ruby/json] Get rid of the remaining tabs.
ruby/json@1a9af430d2
1 parent e0f8732 commit 618085f

File tree

3 files changed

+145
-145
lines changed

3 files changed

+145
-145
lines changed

ext/json/generator/generator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ typedef struct JSON_Generator_StateStruct {
6161
\
6262
rb_scan_args(argc, argv, "01", &Vstate); \
6363
Vstate = cState_from_state_s(cState, Vstate); \
64-
TypedData_Get_Struct(Vstate, JSON_Generator_State, &JSON_Generator_State_type, state); \
64+
TypedData_Get_Struct(Vstate, JSON_Generator_State, &JSON_Generator_State_type, state); \
6565
buffer = cState_prepare_buffer(Vstate); \
6666
generate_json_##type(buffer, Vstate, state, self); \
6767
return fbuffer_to_s(buffer)

ext/json/parser/parser.c

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

ext/json/parser/parser.rl

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -729,78 +729,78 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
729729
}
730730

731731
if (!NIL_P(opts)) {
732-
VALUE tmp = ID2SYM(i_max_nesting);
733-
if (option_given_p(opts, tmp)) {
734-
VALUE max_nesting = rb_hash_aref(opts, tmp);
735-
if (RTEST(max_nesting)) {
736-
Check_Type(max_nesting, T_FIXNUM);
737-
json->max_nesting = FIX2INT(max_nesting);
738-
} else {
739-
json->max_nesting = 0;
740-
}
741-
} else {
742-
json->max_nesting = 100;
743-
}
744-
tmp = ID2SYM(i_allow_nan);
745-
if (option_given_p(opts, tmp)) {
746-
json->allow_nan = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
747-
} else {
748-
json->allow_nan = 0;
749-
}
750-
tmp = ID2SYM(i_symbolize_names);
751-
if (option_given_p(opts, tmp)) {
752-
json->symbolize_names = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
753-
} else {
754-
json->symbolize_names = 0;
755-
}
756-
tmp = ID2SYM(i_freeze);
757-
if (option_given_p(opts, tmp)) {
758-
json->freeze = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
759-
} else {
760-
json->freeze = 0;
761-
}
762-
tmp = ID2SYM(i_create_additions);
763-
if (option_given_p(opts, tmp)) {
764-
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
765-
} else {
766-
json->create_additions = 0;
767-
}
768-
if (json->symbolize_names && json->create_additions) {
769-
rb_raise(rb_eArgError,
770-
"options :symbolize_names and :create_additions cannot be "
771-
" used in conjunction");
772-
}
773-
tmp = ID2SYM(i_create_id);
774-
if (option_given_p(opts, tmp)) {
775-
json->create_id = rb_hash_aref(opts, tmp);
776-
} else {
777-
json->create_id = rb_funcall(mJSON, i_create_id, 0);
778-
}
779-
tmp = ID2SYM(i_object_class);
780-
if (option_given_p(opts, tmp)) {
781-
json->object_class = rb_hash_aref(opts, tmp);
782-
} else {
783-
json->object_class = Qnil;
784-
}
785-
tmp = ID2SYM(i_array_class);
786-
if (option_given_p(opts, tmp)) {
787-
json->array_class = rb_hash_aref(opts, tmp);
788-
} else {
789-
json->array_class = Qnil;
790-
}
791-
tmp = ID2SYM(i_decimal_class);
792-
if (option_given_p(opts, tmp)) {
793-
json->decimal_class = rb_hash_aref(opts, tmp);
794-
} else {
795-
json->decimal_class = Qnil;
796-
}
797-
tmp = ID2SYM(i_match_string);
798-
if (option_given_p(opts, tmp)) {
799-
VALUE match_string = rb_hash_aref(opts, tmp);
800-
json->match_string = RTEST(match_string) ? match_string : Qnil;
801-
} else {
802-
json->match_string = Qnil;
803-
}
732+
VALUE tmp = ID2SYM(i_max_nesting);
733+
if (option_given_p(opts, tmp)) {
734+
VALUE max_nesting = rb_hash_aref(opts, tmp);
735+
if (RTEST(max_nesting)) {
736+
Check_Type(max_nesting, T_FIXNUM);
737+
json->max_nesting = FIX2INT(max_nesting);
738+
} else {
739+
json->max_nesting = 0;
740+
}
741+
} else {
742+
json->max_nesting = 100;
743+
}
744+
tmp = ID2SYM(i_allow_nan);
745+
if (option_given_p(opts, tmp)) {
746+
json->allow_nan = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
747+
} else {
748+
json->allow_nan = 0;
749+
}
750+
tmp = ID2SYM(i_symbolize_names);
751+
if (option_given_p(opts, tmp)) {
752+
json->symbolize_names = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
753+
} else {
754+
json->symbolize_names = 0;
755+
}
756+
tmp = ID2SYM(i_freeze);
757+
if (option_given_p(opts, tmp)) {
758+
json->freeze = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
759+
} else {
760+
json->freeze = 0;
761+
}
762+
tmp = ID2SYM(i_create_additions);
763+
if (option_given_p(opts, tmp)) {
764+
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
765+
} else {
766+
json->create_additions = 0;
767+
}
768+
if (json->symbolize_names && json->create_additions) {
769+
rb_raise(rb_eArgError,
770+
"options :symbolize_names and :create_additions cannot be "
771+
" used in conjunction");
772+
}
773+
tmp = ID2SYM(i_create_id);
774+
if (option_given_p(opts, tmp)) {
775+
json->create_id = rb_hash_aref(opts, tmp);
776+
} else {
777+
json->create_id = rb_funcall(mJSON, i_create_id, 0);
778+
}
779+
tmp = ID2SYM(i_object_class);
780+
if (option_given_p(opts, tmp)) {
781+
json->object_class = rb_hash_aref(opts, tmp);
782+
} else {
783+
json->object_class = Qnil;
784+
}
785+
tmp = ID2SYM(i_array_class);
786+
if (option_given_p(opts, tmp)) {
787+
json->array_class = rb_hash_aref(opts, tmp);
788+
} else {
789+
json->array_class = Qnil;
790+
}
791+
tmp = ID2SYM(i_decimal_class);
792+
if (option_given_p(opts, tmp)) {
793+
json->decimal_class = rb_hash_aref(opts, tmp);
794+
} else {
795+
json->decimal_class = Qnil;
796+
}
797+
tmp = ID2SYM(i_match_string);
798+
if (option_given_p(opts, tmp)) {
799+
VALUE match_string = rb_hash_aref(opts, tmp);
800+
json->match_string = RTEST(match_string) ? match_string : Qnil;
801+
} else {
802+
json->match_string = Qnil;
803+
}
804804
} else {
805805
json->max_nesting = 100;
806806
json->allow_nan = 0;

0 commit comments

Comments
 (0)