diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-05 02:36:58 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-05 02:36:58 +0000 |
| commit | 1545b20a92fdd1cdd17ac3e91674833ea7e4e40b (patch) | |
| tree | 72c3c0f403662bfe3d7a45b37cb1a2981b043641 | |
| parent | b3be2e3d550aaa6cb1ed18eca6e909567ed47eaa (diff) | |
| download | ruby-1545b20a92fdd1cdd17ac3e91674833ea7e4e40b.tar.gz ruby-1545b20a92fdd1cdd17ac3e91674833ea7e4e40b.tar.xz ruby-1545b20a92fdd1cdd17ac3e91674833ea7e4e40b.zip | |
merges r25209 from trunk into ruby_1_9_1.
--
* parse.y (bv_decls, bvar): fix for block variables.
[ruby-dev:39423]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | parse.y | 6 | ||||
| -rw-r--r-- | test/ripper/test_parser_events.rb | 10 | ||||
| -rw-r--r-- | version.h | 2 |
4 files changed, 19 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Sat Oct 3 22:14:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (bv_decls, bvar): fix for block variables. + [ruby-dev:39423] + Sat Oct 3 00:47:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * test/ripper/dummyparser.rb (DummyParser): improvement by Magnus @@ -3441,7 +3441,7 @@ bv_decls : bvar /*%c%*/ /*%c { - $$ = rb_ary_new2($1); + $$ = rb_ary_new3(1, $1); } %*/ | bv_decls ',' bvar @@ -3455,10 +3455,10 @@ bv_decls : bvar bvar : tIDENTIFIER { - new_bv($1); + new_bv(get_id($1)); /*%%%*/ /*% - $$ = $1; + $$ = get_value($1); %*/ } | f_bad_arg diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index 4a4854b28..80199ecce 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -1,6 +1,7 @@ begin require_relative 'dummyparser' +require_relative '../ruby/envutil' require 'test/unit' class TestRipper_ParserEvents < Test::Unit::TestCase @@ -566,6 +567,15 @@ class TestRipper_ParserEvents < Test::Unit::TestCase assert_equal("[fcall(p,[],&block([w],[#{div}]))]", parse("p{|w|w /25 # /\n}"), bug1939) assert_equal("[def(p,[w],bodystmt([#{div}]))]", parse("def p(w)\nw /25 # /\nend"), bug1939) end + + def test_block_variables + assert_equal("[fcall(proc,[],&block([],[void()]))]", parse("proc{|;y|}")) + if defined?(Process::RLIMIT_AS) + assert_in_out_err(["-I#{File.dirname(__FILE__)}", "-rdummyparser"], + 'Process.setrlimit(Process::RLIMIT_AS,102400); puts DummyParser.new("proc{|;y|}").parse', + ["[fcall(proc,[],&block([],[void()]))]"], [], '[ruby-dev:39423]') + end + end end rescue LoadError @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 359 +#define RUBY_PATCHLEVEL 360 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |
