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

ruby-changes:4118

From: ko1@a...
Date: Tue, 26 Feb 2008 15:45:17 +0900 (JST)
Subject: [ruby-changes:4118] akr - Ruby:r15608 (ruby_1_8, trunk): * parse.y (tokadd_escape): refactored.

akr	2008-02-26 15:44:53 +0900 (Tue, 26 Feb 2008)

  New Revision: 15608

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/parse.y
    trunk/ChangeLog
    trunk/parse.y

  Log:
    * parse.y (tokadd_escape): refactored.  [ruby-core:15657]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=15608&r2=15607&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=15608&r2=15607&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15608&r2=15607&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/parse.y?r1=15608&r2=15607&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 15607)
+++ ChangeLog	(revision 15608)
@@ -1,3 +1,7 @@
+Tue Feb 26 15:43:42 2008  Tanaka Akira  <akr@f...>
+
+	* parse.y (tokadd_escape): refactored.  [ruby-core:15657]
+
 Tue Feb 26 15:30:36 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* array.c (rb_ary_eql, rb_ary_cmp): get rid of stack overflow with
Index: parse.y
===================================================================
--- parse.y	(revision 15607)
+++ parse.y	(revision 15608)
@@ -4520,7 +4520,7 @@
 # define tokadd(c)                 parser_tokadd(parser, c)
 # define tok_hex(numlen)           parser_tok_hex(parser, numlen)
 # define read_escape(flags,e)      parser_read_escape(parser, flags, e)
-# define tokadd_escape(t,e)        parser_tokadd_escape(parser, t, e)
+# define tokadd_escape(e)          parser_tokadd_escape(parser, e)
 # define regx_options()            parser_regx_options(parser)
 # define tokadd_string(f,t,p,n,e)  parser_tokadd_string(parser,f,t,p,n,e)
 # define parse_string(n)           parser_parse_string(parser,n)
@@ -5203,8 +5203,7 @@
 }
 
 static int
-parser_tokadd_escape(struct parser_params *parser, int term,
-		     rb_encoding **encp)
+parser_tokadd_escape(struct parser_params *parser, rb_encoding **encp)
 {
     int c;
     int flags = 0;
@@ -5277,8 +5276,7 @@
 	return -1;
 
       default:
-	if (c != '\\' || c != term)
-	    tokadd('\\');
+        tokadd('\\');
 	tokadd(c);
     }
     return 0;
@@ -5416,7 +5414,7 @@
 	      default:
 		if (func & STR_FUNC_REGEXP) {
 		    pushback(c);
-		    if ((c = tokadd_escape(term, &enc)) < 0)
+		    if ((c = tokadd_escape(&enc)) < 0)
 			return -1;
 		    if (has_nonascii && enc != *encp) {
 			mixed_escape(beg, enc, *encp);
Index: ruby_1_8/parse.y
===================================================================
--- ruby_1_8/parse.y	(revision 15607)
+++ ruby_1_8/parse.y	(revision 15608)
@@ -2890,8 +2890,7 @@
 }
 
 static int
-tokadd_escape(term)
-    int term;
+tokadd_escape()
 {
     int c;
 
@@ -2956,7 +2955,7 @@
 	tokadd('\\'); tokadd('c');
       escaped:
 	if ((c = nextc()) == '\\') {
-	    return tokadd_escape(term);
+	    return tokadd_escape();
 	}
 	else if (c == -1) goto eof;
 	tokadd(c);
@@ -2968,8 +2967,7 @@
 	return -1;
 
       default:
-	if (c != '\\' || c != term)
-	    tokadd('\\');
+        tokadd('\\');
 	tokadd(c);
     }
     return 0;
@@ -3089,7 +3087,7 @@
 	      default:
 		if (func & STR_FUNC_REGEXP) {
 		    pushback(c);
-		    if (tokadd_escape(term) < 0)
+		    if (tokadd_escape() < 0)
 			return -1;
 		    continue;
 		}
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 15607)
+++ ruby_1_8/ChangeLog	(revision 15608)
@@ -1,3 +1,7 @@
+Tue Feb 26 15:43:42 2008  Tanaka Akira  <akr@f...>
+
+	* parse.y (tokadd_escape): refactored.  [ruby-core:15657]
+
 Mon Feb 25 17:30:29 2008  Technorama Ltd.  <oss-ruby@t...>
 
 	* ext/openssl/digest.c ext/openssl/lib/openssl/digest.rb:

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

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