1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-02-26 06:44:53 +00:00
parent 15c0648d00
commit a0ec9f61d1
2 changed files with 8 additions and 6 deletions

View file

@ -1,3 +1,7 @@
Tue Feb 26 15:43:42 2008 Tanaka Akira <akr@fsij.org>
* parse.y (tokadd_escape): refactored. [ruby-core:15657]
Mon Feb 25 17:30:29 2008 Technorama Ltd. <oss-ruby@technorama.net> Mon Feb 25 17:30:29 2008 Technorama Ltd. <oss-ruby@technorama.net>
* ext/openssl/digest.c ext/openssl/lib/openssl/digest.rb: * ext/openssl/digest.c ext/openssl/lib/openssl/digest.rb:

10
parse.y
View file

@ -2890,8 +2890,7 @@ read_escape()
} }
static int static int
tokadd_escape(term) tokadd_escape()
int term;
{ {
int c; int c;
@ -2956,7 +2955,7 @@ tokadd_escape(term)
tokadd('\\'); tokadd('c'); tokadd('\\'); tokadd('c');
escaped: escaped:
if ((c = nextc()) == '\\') { if ((c = nextc()) == '\\') {
return tokadd_escape(term); return tokadd_escape();
} }
else if (c == -1) goto eof; else if (c == -1) goto eof;
tokadd(c); tokadd(c);
@ -2968,8 +2967,7 @@ tokadd_escape(term)
return -1; return -1;
default: default:
if (c != '\\' || c != term) tokadd('\\');
tokadd('\\');
tokadd(c); tokadd(c);
} }
return 0; return 0;
@ -3089,7 +3087,7 @@ tokadd_string(func, term, paren, nest)
default: default:
if (func & STR_FUNC_REGEXP) { if (func & STR_FUNC_REGEXP) {
pushback(c); pushback(c);
if (tokadd_escape(term) < 0) if (tokadd_escape() < 0)
return -1; return -1;
continue; continue;
} }