Expression results

Hi,

···

At Sat, 22 Mar 2003 21:00:27 +0900, ts wrote:

% ruby -v -e ‘x = (1; 2)’
ruby 1.8.0 (2003-03-21) [i686-linux]

The node is removed before ruby make the test.
1.6 create a block, 1.8 can simplify the block.

Yes, tried to optimize slightly. Should it be warned?

Index: parse.y

RCS file: /pub/cvs/ruby/src/ruby/parse.y,v
retrieving revision 1.263
diff -u -2 -p -r1.263 parse.y
— parse.y 20 Mar 2003 07:03:22 -0000 1.263
+++ parse.y 23 Mar 2003 03:40:59 -0000
@@ -4492,4 +4492,5 @@ block_append(head, tail)
case NODE_LIT:
case NODE_STR:

  • rb_warning(“unused literal ignored”);
    return tail;
    default:


Nobu Nakada

Hi,

···

In message “Re: Expression results” on 03/03/23, nobu.nokada@softhome.net nobu.nokada@softhome.net writes:

The node is removed before ruby make the test.
1.6 create a block, 1.8 can simplify the block.

Yes, tried to optimize slightly. Should it be warned?

I hacked void_stmts(), but your fix seems better. Will you commit?

						matz.