summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-17 07:11:22 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-17 07:11:22 +0000
commit96b40dff450df701200ea5edceb07f2ed847e3fd (patch)
treea2c90999001ebcb8fd2fd67ffb3d5911a8e98f81 /parse.y
parent7dd3853eac98396d3b5abee16d7f680d941eae82 (diff)
2000-02-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y17
1 files changed, 8 insertions, 9 deletions
diff --git a/parse.y b/parse.y
index 5c8e07058c..254c974fcf 100644
--- a/parse.y
+++ b/parse.y
@@ -2430,7 +2430,7 @@ parse_quotedwords(term, paren)
strstart = ruby_sourceline;
newtok();
- while ((c = nextc()) == ' ')
+ while (c = nextc(),ISSPACE(c))
; /* skip preceding spaces */
pushback(c);
while ((c = nextc()) != term || nest > 0) {
@@ -2455,14 +2455,13 @@ parse_quotedwords(term, paren)
case '\\':
c = '\\';
break;
- case ' ':
- tokadd(' ');
- break;
default:
- tokadd('\\');
+ if (ISSPACE(c))
+ tokadd('\\');
+ tokadd(c);
}
}
- else if (c == ' ') {
+ else if (ISSPACE(c)) {
NODE *str;
tokfix();
@@ -2470,7 +2469,7 @@ parse_quotedwords(term, paren)
newtok();
if (!qwords) qwords = NEW_LIST(str);
else list_append(qwords, str);
- while ((c = nextc()) == ' ')
+ while (c = nextc(),ISSPACE(c))
; /* skip continuous spaces */
pushback(c);
continue;
@@ -3414,8 +3413,8 @@ yylex()
result = tFID;
}
else {
- if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
- if ((c = nextc()) == '=' && !peek('=')) {
+ if (lex_state == EXPR_FNAME) {
+ if ((c = nextc()) == '=' && !peek('=') && !peek('~')) {
result = tIDENTIFIER;
tokadd(c);
}