[ruby/json] Get rid of the remaining tabs.
https://github.com/ruby/json/commit/1a9af430d2
This commit is contained in:
parent
e0f8732023
commit
618085f48d
@ -61,7 +61,7 @@ typedef struct JSON_Generator_StateStruct {
|
|||||||
\
|
\
|
||||||
rb_scan_args(argc, argv, "01", &Vstate); \
|
rb_scan_args(argc, argv, "01", &Vstate); \
|
||||||
Vstate = cState_from_state_s(cState, Vstate); \
|
Vstate = cState_from_state_s(cState, Vstate); \
|
||||||
TypedData_Get_Struct(Vstate, JSON_Generator_State, &JSON_Generator_State_type, state); \
|
TypedData_Get_Struct(Vstate, JSON_Generator_State, &JSON_Generator_State_type, state); \
|
||||||
buffer = cState_prepare_buffer(Vstate); \
|
buffer = cState_prepare_buffer(Vstate); \
|
||||||
generate_json_##type(buffer, Vstate, state, self); \
|
generate_json_##type(buffer, Vstate, state, self); \
|
||||||
return fbuffer_to_s(buffer)
|
return fbuffer_to_s(buffer)
|
||||||
|
@ -1834,78 +1834,78 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!NIL_P(opts)) {
|
if (!NIL_P(opts)) {
|
||||||
VALUE tmp = ID2SYM(i_max_nesting);
|
VALUE tmp = ID2SYM(i_max_nesting);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
VALUE max_nesting = rb_hash_aref(opts, tmp);
|
VALUE max_nesting = rb_hash_aref(opts, tmp);
|
||||||
if (RTEST(max_nesting)) {
|
if (RTEST(max_nesting)) {
|
||||||
Check_Type(max_nesting, T_FIXNUM);
|
Check_Type(max_nesting, T_FIXNUM);
|
||||||
json->max_nesting = FIX2INT(max_nesting);
|
json->max_nesting = FIX2INT(max_nesting);
|
||||||
} else {
|
} else {
|
||||||
json->max_nesting = 0;
|
json->max_nesting = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
json->max_nesting = 100;
|
json->max_nesting = 100;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_allow_nan);
|
tmp = ID2SYM(i_allow_nan);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->allow_nan = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
json->allow_nan = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
json->allow_nan = 0;
|
json->allow_nan = 0;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_symbolize_names);
|
tmp = ID2SYM(i_symbolize_names);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->symbolize_names = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
json->symbolize_names = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
json->symbolize_names = 0;
|
json->symbolize_names = 0;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_freeze);
|
tmp = ID2SYM(i_freeze);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->freeze = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
json->freeze = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
json->freeze = 0;
|
json->freeze = 0;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_create_additions);
|
tmp = ID2SYM(i_create_additions);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
|
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
|
||||||
} else {
|
} else {
|
||||||
json->create_additions = 0;
|
json->create_additions = 0;
|
||||||
}
|
}
|
||||||
if (json->symbolize_names && json->create_additions) {
|
if (json->symbolize_names && json->create_additions) {
|
||||||
rb_raise(rb_eArgError,
|
rb_raise(rb_eArgError,
|
||||||
"options :symbolize_names and :create_additions cannot be "
|
"options :symbolize_names and :create_additions cannot be "
|
||||||
" used in conjunction");
|
" used in conjunction");
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_create_id);
|
tmp = ID2SYM(i_create_id);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->create_id = rb_hash_aref(opts, tmp);
|
json->create_id = rb_hash_aref(opts, tmp);
|
||||||
} else {
|
} else {
|
||||||
json->create_id = rb_funcall(mJSON, i_create_id, 0);
|
json->create_id = rb_funcall(mJSON, i_create_id, 0);
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_object_class);
|
tmp = ID2SYM(i_object_class);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->object_class = rb_hash_aref(opts, tmp);
|
json->object_class = rb_hash_aref(opts, tmp);
|
||||||
} else {
|
} else {
|
||||||
json->object_class = Qnil;
|
json->object_class = Qnil;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_array_class);
|
tmp = ID2SYM(i_array_class);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->array_class = rb_hash_aref(opts, tmp);
|
json->array_class = rb_hash_aref(opts, tmp);
|
||||||
} else {
|
} else {
|
||||||
json->array_class = Qnil;
|
json->array_class = Qnil;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_decimal_class);
|
tmp = ID2SYM(i_decimal_class);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->decimal_class = rb_hash_aref(opts, tmp);
|
json->decimal_class = rb_hash_aref(opts, tmp);
|
||||||
} else {
|
} else {
|
||||||
json->decimal_class = Qnil;
|
json->decimal_class = Qnil;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_match_string);
|
tmp = ID2SYM(i_match_string);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
VALUE match_string = rb_hash_aref(opts, tmp);
|
VALUE match_string = rb_hash_aref(opts, tmp);
|
||||||
json->match_string = RTEST(match_string) ? match_string : Qnil;
|
json->match_string = RTEST(match_string) ? match_string : Qnil;
|
||||||
} else {
|
} else {
|
||||||
json->match_string = Qnil;
|
json->match_string = Qnil;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
json->max_nesting = 100;
|
json->max_nesting = 100;
|
||||||
json->allow_nan = 0;
|
json->allow_nan = 0;
|
||||||
|
@ -729,78 +729,78 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!NIL_P(opts)) {
|
if (!NIL_P(opts)) {
|
||||||
VALUE tmp = ID2SYM(i_max_nesting);
|
VALUE tmp = ID2SYM(i_max_nesting);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
VALUE max_nesting = rb_hash_aref(opts, tmp);
|
VALUE max_nesting = rb_hash_aref(opts, tmp);
|
||||||
if (RTEST(max_nesting)) {
|
if (RTEST(max_nesting)) {
|
||||||
Check_Type(max_nesting, T_FIXNUM);
|
Check_Type(max_nesting, T_FIXNUM);
|
||||||
json->max_nesting = FIX2INT(max_nesting);
|
json->max_nesting = FIX2INT(max_nesting);
|
||||||
} else {
|
} else {
|
||||||
json->max_nesting = 0;
|
json->max_nesting = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
json->max_nesting = 100;
|
json->max_nesting = 100;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_allow_nan);
|
tmp = ID2SYM(i_allow_nan);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->allow_nan = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
json->allow_nan = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
json->allow_nan = 0;
|
json->allow_nan = 0;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_symbolize_names);
|
tmp = ID2SYM(i_symbolize_names);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->symbolize_names = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
json->symbolize_names = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
json->symbolize_names = 0;
|
json->symbolize_names = 0;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_freeze);
|
tmp = ID2SYM(i_freeze);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->freeze = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
json->freeze = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
json->freeze = 0;
|
json->freeze = 0;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_create_additions);
|
tmp = ID2SYM(i_create_additions);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
|
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
|
||||||
} else {
|
} else {
|
||||||
json->create_additions = 0;
|
json->create_additions = 0;
|
||||||
}
|
}
|
||||||
if (json->symbolize_names && json->create_additions) {
|
if (json->symbolize_names && json->create_additions) {
|
||||||
rb_raise(rb_eArgError,
|
rb_raise(rb_eArgError,
|
||||||
"options :symbolize_names and :create_additions cannot be "
|
"options :symbolize_names and :create_additions cannot be "
|
||||||
" used in conjunction");
|
" used in conjunction");
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_create_id);
|
tmp = ID2SYM(i_create_id);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->create_id = rb_hash_aref(opts, tmp);
|
json->create_id = rb_hash_aref(opts, tmp);
|
||||||
} else {
|
} else {
|
||||||
json->create_id = rb_funcall(mJSON, i_create_id, 0);
|
json->create_id = rb_funcall(mJSON, i_create_id, 0);
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_object_class);
|
tmp = ID2SYM(i_object_class);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->object_class = rb_hash_aref(opts, tmp);
|
json->object_class = rb_hash_aref(opts, tmp);
|
||||||
} else {
|
} else {
|
||||||
json->object_class = Qnil;
|
json->object_class = Qnil;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_array_class);
|
tmp = ID2SYM(i_array_class);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->array_class = rb_hash_aref(opts, tmp);
|
json->array_class = rb_hash_aref(opts, tmp);
|
||||||
} else {
|
} else {
|
||||||
json->array_class = Qnil;
|
json->array_class = Qnil;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_decimal_class);
|
tmp = ID2SYM(i_decimal_class);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
json->decimal_class = rb_hash_aref(opts, tmp);
|
json->decimal_class = rb_hash_aref(opts, tmp);
|
||||||
} else {
|
} else {
|
||||||
json->decimal_class = Qnil;
|
json->decimal_class = Qnil;
|
||||||
}
|
}
|
||||||
tmp = ID2SYM(i_match_string);
|
tmp = ID2SYM(i_match_string);
|
||||||
if (option_given_p(opts, tmp)) {
|
if (option_given_p(opts, tmp)) {
|
||||||
VALUE match_string = rb_hash_aref(opts, tmp);
|
VALUE match_string = rb_hash_aref(opts, tmp);
|
||||||
json->match_string = RTEST(match_string) ? match_string : Qnil;
|
json->match_string = RTEST(match_string) ? match_string : Qnil;
|
||||||
} else {
|
} else {
|
||||||
json->match_string = Qnil;
|
json->match_string = Qnil;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
json->max_nesting = 100;
|
json->max_nesting = 100;
|
||||||
json->allow_nan = 0;
|
json->allow_nan = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user