summaryrefslogtreecommitdiff
path: root/ruby_parser.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-01-08 00:50:41 +0900
committerNobuyoshi Nakada <[email protected]>2024-01-08 00:50:41 +0900
commitc30b8ae947e4e0e01df74b07282b27b1b1c70df8 ()
tree3ea69f4cc26dee64542b0230aa1fab17a45d1182 /ruby_parser.c
parent76c20b06aa16686d047af5cb21300602153e0e46 (diff)
Adjust styles and indents [ci skip]
-rw-r--r--ruby_parser.c16
1 files changed, 8 insertions, 8 deletions
@@ -17,23 +17,22 @@ compile_negative_numeric(VALUE val)
}
#endif
}
- switch (OBJ_BUILTIN_TYPE(val))
- {
- case T_BIGNUM:
BIGNUM_NEGATE(val);
val = rb_big_norm(val);
break;
- case T_RATIONAL:
RATIONAL_SET_NUM(val, compile_negative_numeric(RRATIONAL(val)->num));
break;
- case T_COMPLEX:
RCOMPLEX_SET_REAL(val, compile_negative_numeric(RCOMPLEX(val)->real));
RCOMPLEX_SET_IMAG(val, compile_negative_numeric(RCOMPLEX(val)->imag));
break;
- case T_FLOAT:
val = DBL2NUM(-RFLOAT_VALUE(val));
break;
- default:
val = LONG2FIX(-FIX2LONG(val));
break;
}
@@ -79,7 +78,8 @@ compile_rational_literal(char* node_val, int base, int seen_point)
memmove(point, point+1, fraclen+1);
lit = rb_rational_new(compile_numeric_literal(val, base), rb_int_positive_pow(10, fraclen));
- } else {
lit = rb_rational_raw1(compile_numeric_literal(val, base));
}