[#45906] ' failures. — Tanaka Akira <akr@...>
' の扱いが変化したことで、テストが失敗しているようです。
9 messages
2012/07/04
[#45910] [ruby-trunk - Bug #6694][Open] Thread.new without block. — "ko1 (Koichi Sasada)" <redmine@...>
24 messages
2012/07/04
[#45928] Re: [ruby-cvs:43524] kosaki:r36348 (trunk): * include/ruby/ruby.h: Removed RUBY_GLOBAL_SETUP complely. It is — SASADA Koichi <ko1@...>
ささだです.
3 messages
2012/07/09
[#45973] [ruby-trunk - Bug #6751][Assigned] remove tempfiles early. — "akr (Akira Tanaka)" <akr@...>
4 messages
2012/07/18
[#45976] [ruby-trunk - Bug #6756][Open] FileUtils.rm_rf がアクセス権のない空ディレクトリを削除しない — "fumiyas (Fumiyasu SATOH)" <fumiyas@...>
9 messages
2012/07/20
[#45977] [ruby-trunk - Feature #6757][Open] [PATCH] Add Process.getsid — "fumiyas (Fumiyasu SATOH)" <fumiyas@...>
6 messages
2012/07/20
[#46012] [ruby-trunk - Feature #6812][Open] Refactor gc.c — "authorNari (Narihiro Nakamura)" <authorNari@...>
13 messages
2012/07/30
[ruby-dev:45925] Re: [ruby-changes:24286] nobu:r36337 (trunk): [Feature #6693]
From:
SASADA Koichi <ko1@...>
Date:
2012-07-08 21:32:58 UTC
List:
ruby-dev #45925
これって入れるって決まったんでしたっけ.
(2012/07/08 7:42), nobu wrote:
> nobu 2012-07-08 07:36:25 +0900 (Sun, 08 Jul 2012)
>
> New Revision: 36337
>
> http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36337
>
> Log:
> [Feature #6693]
>
> * parse.y (shadowing_lvar_gen, warn_unused_var): no warnings for
> variables starting with _. [ruby-core:46160][Feature #6693]
>
> Modified files:
> trunk/ChangeLog
> trunk/parse.y
> trunk/test/ruby/test_rubyoptions.rb
>
> Index: ChangeLog
> ===================================================================
> --- ChangeLog (revision 36336)
> +++ ChangeLog (revision 36337)
> @@ -1,3 +1,8 @@
> +Sun Jul 8 07:36:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
> +
> + * parse.y (shadowing_lvar_gen, warn_unused_var): no warnings for
> + variables starting with _. [ruby-core:46160][Feature #6693]
> +
> Sat Jul 7 23:07:30 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
>
> * test/csv/test_features.rb: add require for Tempfile.
> Index: parse.y
> ===================================================================
> --- parse.y (revision 36336)
> +++ parse.y (revision 36337)
> @@ -8595,12 +8595,23 @@
> #undef parser_yyerror
> }
>
> +static int
> +is_private_local_id(ID name)
> +{
> + VALUE s;
> + if (name == idUScore) return 1;
> + if (!is_local_id(name)) return 0;
> + s = rb_id2str(name);
> + if (!s) return 0;
> + return RSTRING_PTR(s)[0] == '_';
> +}
> +
> #define LVAR_USED ((int)1 << (sizeof(int) * CHAR_BIT - 1))
>
> static ID
> shadowing_lvar_gen(struct parser_params *parser, ID name)
> {
> - if (idUScore == name) return name;
> + if (is_private_local_id(name)) return name;
> if (dyna_in_block()) {
> if (dvar_curr(name)) {
> yyerror("duplicated argument name");
> @@ -9324,7 +9335,7 @@
> }
> for (i = 0; i < cnt; ++i) {
> if (!v[i] || (u[i] & LVAR_USED)) continue;
> - if (idUScore == v[i]) continue;
> + if (is_private_local_id(v[i])) continue;
> rb_compile_warn(ruby_sourcefile, (int)u[i], "assigned but unused variable - %s", rb_id2name(v[i]));
> }
> }
> Index: test/ruby/test_rubyoptions.rb
> ===================================================================
> --- test/ruby/test_rubyoptions.rb (revision 36336)
> +++ test/ruby/test_rubyoptions.rb (revision 36337)
> @@ -497,7 +497,8 @@
> assert_in_out_err(["-we", "1.times do\n a=1\nend"], "", [], [], feature3446)
> assert_in_out_err(["-we", "def foo\n 1.times do\n a=1\n end\nend"], "", [], ["-e:3: warning: assigned but unused variable - a"], feature3446)
> assert_in_out_err(["-we", "def foo\n"" 1.times do |a| end\n""end"], "", [], [])
> - assert_in_out_err(["-we", "def foo\n _a=1\nend"], "", [], ["-e:2: warning: assigned but unused variable - _a"], feature3446)
> + feature6693 = '[ruby-core:46160]'
> + assert_in_out_err(["-we", "def foo\n _a=1\nend"], "", [], [], feature6693)
> end
>
> def test_shadowing_variable
> @@ -509,11 +510,9 @@
> ["-e:3: warning: shadowing outer local variable - a",
> "-e:2: warning: assigned but unused variable - a",
> ], bug4130)
> + feature6693 = '[ruby-core:46160]'
> assert_in_out_err(["-we", "def foo\n"" _a=1\n"" 1.times do |_a| end\n""end"],
> - "", [],
> - ["-e:3: warning: shadowing outer local variable - _a",
> - "-e:2: warning: assigned but unused variable - _a",
> - ], bug4130)
> + "", [], [], feature6693)
> end
>
> def test_script_from_stdin
>
> --
> ML: ruby-changes@quickml.atdot.net
> Info: http://www.atdot.net/~ko1/quickml/
>
--
// SASADA Koichi at atdot dot net