summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-05 06:23:20 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-05 06:23:20 +0000
commit406f6a23d5f2f5bb8a454038b3e2100a9da44a5b (patch)
treee16a4f4b6c0c705e5d41067152463b9143e4aff4 /parse.y
parentd4e2cb1564030010e54d367223cc261894a4414f (diff)
* parse.y (rb_warn4): added as a rb_warn variant to warn with explicit
source file name and line in parse.y. * parse.y (warn_unused_var): use rb_warn4 to suppress warning on ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 67bd7108be..230faa3dc9 100644
--- a/parse.y
+++ b/parse.y
@@ -596,12 +596,14 @@ new_args_tail_gen(struct parser_params *parser, VALUE k, VALUE kr, VALUE b)
# define rb_warn0(fmt) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt))
# define rb_warnI(fmt,a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a))
# define rb_warnS(fmt,a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a))
+# define rb_warn4(file,line,fmt,a) rb_compile_warn((file), (line), (fmt), (a))
# define rb_warning0(fmt) rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt))
# define rb_warningS(fmt,a) rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt), (a))
#else
# define rb_warn0(fmt) ripper_warn0(parser, (fmt))
# define rb_warnI(fmt,a) ripper_warnI(parser, (fmt), (a))
# define rb_warnS(fmt,a) ripper_warnS(parser, (fmt), (a))
+# define rb_warn4(file,line,fmt,a) ripper_warnI(parser, (fmt), (a))
# define rb_warning0(fmt) ripper_warning0(parser, (fmt))
# define rb_warningS(fmt,a) ripper_warningS(parser, (fmt), (a))
static void ripper_warn0(struct parser_params*, const char*);
@@ -9446,7 +9448,7 @@ warn_unused_var(struct parser_params *parser, struct local_vars *local)
for (i = 0; i < cnt; ++i) {
if (!v[i] || (u[i] & LVAR_USED)) 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]));
+ rb_warn4(ruby_sourcefile, (int)u[i], "assigned but unused variable - %s", rb_id2name(v[i]));
}
}