[前][次][番号順一覧][スレッド一覧]

ruby-changes:24860

From: naruse <ko1@a...>
Date: Wed, 5 Sep 2012 15:23:29 +0900 (JST)
Subject: [ruby-changes:24860] naruse:r36911 (trunk): * parse.y (rb_warn4): added as a rb_warn variant to warn with explicit

naruse	2012-09-05 15:23:20 +0900 (Wed, 05 Sep 2012)

  New Revision: 36911

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36911

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/parse.y

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 36910)
+++ ChangeLog	(revision 36911)
@@ -1,3 +1,10 @@
+Wed Sep  5 15:21:12 2012  NARUSE, Yui  <naruse@r...>
+
+	* 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.
+
 Wed Sep  5 13:30:04 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* dir.c (glob_make_pattern): names under recursive need to be single
Index: parse.y
===================================================================
--- parse.y	(revision 36910)
+++ parse.y	(revision 36911)
@@ -596,12 +596,14 @@
 # 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 @@
     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]));
     }
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]