зеркало из https://github.com/github/ruby.git
* parse.y (warn_unused_var): use same format as shadowing local
variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
47fb01e35b
Коммит
14a15f8b7f
|
@ -1,4 +1,7 @@
|
||||||
Sun Jun 20 14:40:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Jun 20 15:14:05 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (warn_unused_var): use same format as shadowing local
|
||||||
|
variable.
|
||||||
|
|
||||||
* parse.y (shadowing_lvar_gen): get rid of adding extra name for
|
* parse.y (shadowing_lvar_gen): get rid of adding extra name for
|
||||||
shadowing local variable. [ruby-dev:41628]
|
shadowing local variable. [ruby-dev:41628]
|
||||||
|
|
2
parse.y
2
parse.y
|
@ -8935,7 +8935,7 @@ warn_unused_var(struct parser_params *parser, struct local_vars *local)
|
||||||
}
|
}
|
||||||
for (i = 0; i < cnt; ++i) {
|
for (i = 0; i < cnt; ++i) {
|
||||||
if (!v[i] || (u[i] & LVAR_USED)) continue;
|
if (!v[i] || (u[i] & LVAR_USED)) continue;
|
||||||
rb_compile_warn(ruby_sourcefile, (int)u[i], "assigned but unused variable %s", rb_id2name(v[i]));
|
rb_compile_warn(ruby_sourcefile, (int)u[i], "assigned but unused variable - %s", rb_id2name(v[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче