summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-07 08:44:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-07 08:44:24 +0000
commit1b0f90ca333ddbf7ed57eba28465fbb922daa957 (patch)
tree47b47a035bcad5c857f1d90b41e9c14bf2e9bbf8 /eval.c
parentc4216a26e2c9b3754abc3225de1732c50803433b (diff)
* parse.y (string_content): turn off NODE_NEWLINE flag to avoid
unnecessary line trace for inlined expression. (ruby-bugs PR#1320) * numeric.c (flo_to_s): tweak output string based to preserve decimal point and to remove trailing zeros. [ruby-talk:97891] * string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM search. [ruby-talk:97342] * hash.c (rb_hash_equal): returns true if two hashes have same set of key-value set. [ruby-talk:97559] * hash.c (rb_hash_eql): returns true if two hashes are equal and have same default values. * string.c (rb_str_equal): always returns true or false, never returns nil. [ruby-dev:23404] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 9f099cdca3..faff5e4442 100644
--- a/eval.c
+++ b/eval.c
@@ -2573,14 +2573,14 @@ svalue_to_mrhs(v, lhs)
{
VALUE tmp;
- if (v == Qundef) return rb_ary_new2(0);
+ if (v == Qundef) return rb_values_new2(0, 0);
tmp = rb_check_array_type(v);
if (NIL_P(tmp)) {
- return rb_ary_new3(1, v);
+ return rb_values_new(1, v);
}
/* no lhs means splat lhs only */
if (!lhs) {
- return rb_ary_new3(1, v);
+ return rb_values_new(1, v);
}
return tmp;
}
@@ -2602,8 +2602,11 @@ static VALUE
splat_value(v)
VALUE v;
{
- if (NIL_P(v)) return rb_ary_new3(1, Qnil);
- return rb_Array(v);
+ VALUE val;
+
+ if (NIL_P(v)) val = rb_ary_new3(1, Qnil);
+ else val = rb_Array(v);
+ return rb_values_from_ary(val);
}
static VALUE
@@ -3569,6 +3572,22 @@ rb_eval(self, n)
}
break;
+ case NODE_VALUES:
+ {
+ VALUE val;
+ long i;
+
+ i = node->nd_alen;
+ val = rb_values_new2(i, 0);
+ for (i=0;node;node=node->nd_next) {
+ RARRAY(val)->ptr[i++] = rb_eval(self, node->nd_head);
+ RARRAY(val)->len = i;
+ }
+
+ result = val;
+ }
+ break;
+
case NODE_STR:
result = rb_str_new3(node->nd_lit);
break;