summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-26 06:44:53 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-26 06:44:53 +0000
commita0ec9f61d1cff2df36c254fb78bfdaa14b0292a9 (patch)
tree179256e5f291675d9c73196a0787cbd676a3c2c6 /parse.y
parent15c0648d00db24eb55922f9cf7d01031df0385a2 (diff)
* 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
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y10
1 files changed, 4 insertions, 6 deletions
diff --git a/parse.y b/parse.y
index 453d776..bde4c1d 100644
--- a/parse.y
+++ b/parse.y
@@ -2890,8 +2890,7 @@ read_escape()
}
static int
-tokadd_escape(term)
- int term;
+tokadd_escape()
{
int c;
@@ -2956,7 +2955,7 @@ tokadd_escape(term)
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 @@ tokadd_escape(term)
return -1;
default:
- if (c != '\\' || c != term)
- tokadd('\\');
+ tokadd('\\');
tokadd(c);
}
return 0;
@@ -3089,7 +3087,7 @@ tokadd_string(func, term, paren, nest)
default:
if (func & STR_FUNC_REGEXP) {
pushback(c);
- if (tokadd_escape(term) < 0)
+ if (tokadd_escape() < 0)
return -1;
continue;
}