summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 0d11c17..3da3ad0 100644
--- a/parse.y
+++ b/parse.y
@@ -9402,6 +9402,8 @@ negate_lit(NODE *node)
node->nd_lit = LONG2FIX(-FIX2LONG(node->nd_lit));
break;
case T_BIGNUM:
+ case T_RATIONAL:
+ case T_COMPLEX:
node->nd_lit = rb_funcall(node->nd_lit,tUMINUS,0,0);
break;
case T_FLOAT:
@@ -9417,6 +9419,7 @@ negate_lit(NODE *node)
#endif
break;
default:
+ rb_bug("unknown literal type passed to negate_lit");
break;
}
return node;