From 1b0f90ca333ddbf7ed57eba28465fbb922daa957 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 7 May 2004 08:44:24 +0000 Subject: * 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 --- parse.y | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 09d2a67a55..03369ea242 100644 --- a/parse.y +++ b/parse.y @@ -1455,7 +1455,8 @@ primary : literal } | tLPAREN compstmt ')' { - $$ = $2; + if (!$2) $$ = NEW_NIL(); + else $$ = $2; } | primary_value tCOLON2 tCONSTANT { @@ -2090,6 +2091,7 @@ string_content : tSTRING_CONTENT lex_strterm = $2; COND_LEXPOP(); CMDARG_LEXPOP(); + FL_UNSET($3, NODE_NEWLINE); $$ = new_evstr($3); } ; @@ -5432,10 +5434,15 @@ ret_args(node) { if (node) { no_blockarg(node); - if (nd_type(node) == NODE_ARRAY && node->nd_next == 0) { - node = node->nd_head; + if (nd_type(node) == NODE_ARRAY) { + if (node->nd_next == 0) { + node = node->nd_head; + } + else { + nd_set_type(node, NODE_VALUES); + } } - else if (node && nd_type(node) == NODE_SPLAT) { + else if (nd_type(node) == NODE_SPLAT) { node = NEW_SVALUE(node); } } -- cgit v1.2.3