summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-10 16:22:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-10 16:22:52 +0000
commitb40c614b29994fa84d6d1a6bf890a67eec061aae (patch)
treea889c98c36fe74c6ff2b17cebd85ef31332e1370
parent0798cf704290d3060479d531e10ec3beba45e4ab (diff)
downloadruby-b40c614b29994fa84d6d1a6bf890a67eec061aae.tar.gz
ruby-b40c614b29994fa84d6d1a6bf890a67eec061aae.tar.xz
ruby-b40c614b29994fa84d6d1a6bf890a67eec061aae.zip
* parse.y (shadowing_lvar_gen): no duplicate error for "_".
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--parse.y32
-rw-r--r--version.h6
3 files changed, 25 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 96bea66fa..e265aa7fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Dec 11 01:21:21 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (shadowing_lvar_gen): no duplicate error for "_".
+
Mon Dec 10 22:08:47 2007 Akinori MUSHA <knu@iDaemons.org>
* array.c (rb_ary_slice_bang): If an invalid range is given, do
diff --git a/parse.y b/parse.y
index 1d2669c45..2f3a118d1 100644
--- a/parse.y
+++ b/parse.y
@@ -7626,20 +7626,24 @@ assignable_gen(struct parser_params *parser, ID id, NODE *val)
static void
shadowing_lvar_gen(struct parser_params *parser, ID name)
{
- if (dyna_in_block()) {
- if (dvar_curr(name)) {
- yyerror("duplicated argument name");
- }
- else if (dvar_defined(name) || local_id(name)) {
- rb_warningS("shadowing outer local variable - %s", rb_id2name(name));
- vtable_add(lvtbl->vars, name);
- }
- }
- else {
- if (local_id(name)) {
- yyerror("duplicated argument name");
- }
- }
+ static ID uscore;
+
+ if (!uscore) uscore = rb_intern("_");
+ if (uscore == name) return;
+ if (dyna_in_block()) {
+ if (dvar_curr(name)) {
+ yyerror("duplicated argument name");
+ }
+ else if (dvar_defined(name) || local_id(name)) {
+ rb_warningS("shadowing outer local variable - %s", rb_id2name(name));
+ vtable_add(lvtbl->vars, name);
+ }
+ }
+ else {
+ if (local_id(name)) {
+ yyerror("duplicated argument name");
+ }
+ }
}
static void
diff --git a/version.h b/version.h
index 2624e6f27..d1de4cbee 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2007-12-10"
+#define RUBY_RELEASE_DATE "2007-12-11"
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20071210
+#define RUBY_RELEASE_CODE 20071211
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 12
-#define RUBY_RELEASE_DAY 10
+#define RUBY_RELEASE_DAY 11
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];