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

ruby-changes:36421

From: nobu <ko1@a...>
Date: Thu, 20 Nov 2014 01:01:12 +0900 (JST)
Subject: [ruby-changes:36421] nobu:r48502 (trunk): parse.y: predefined ID

nobu	2014-11-20 01:01:02 +0900 (Thu, 20 Nov 2014)

  New Revision: 48502

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

  Log:
    parse.y: predefined ID
    
    * parse.y (reg_named_capture_assign_gen): use predefined ID
      instead of rb_intern.

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48501)
+++ ChangeLog	(revision 48502)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Nov 20 01:00:59 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (reg_named_capture_assign_gen): use predefined ID
+	  instead of rb_intern.
+
 Thu Nov 20 00:54:57 2014  Tanaka Akira  <akr@f...>
 
 	* internal.h (ruby_init_setproctitle): Declare here.
Index: parse.y
===================================================================
--- parse.y	(revision 48501)
+++ parse.y	(revision 48502)
@@ -10219,11 +10219,10 @@ reg_compile_gen(struct parser_params* pa https://github.com/ruby/ruby/blob/trunk/parse.y#L10219
     err = rb_errinfo();
     re = rb_reg_compile(str, options & RE_OPTION_MASK, ruby_sourcefile, ruby_sourceline);
     if (NIL_P(re)) {
-	ID mesg = rb_intern("mesg");
-	VALUE m = rb_attr_get(rb_errinfo(), mesg);
+	VALUE m = rb_attr_get(rb_errinfo(), idMesg);
 	rb_set_errinfo(err);
 	if (!NIL_P(err)) {
-	    rb_str_append(rb_str_cat(rb_attr_get(err, mesg), "\n", 1), m);
+	    rb_str_append(rb_str_cat(rb_attr_get(err, idMesg), "\n", 1), m);
 	}
 	else {
 	    compile_error(PARSER_ARG "%"PRIsVALUE, m);

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

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