diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-17 07:11:22 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-17 07:11:22 +0000 |
commit | 96b40dff450df701200ea5edceb07f2ed847e3fd (patch) | |
tree | a2c90999001ebcb8fd2fd67ffb3d5911a8e98f81 /parse.y | |
parent | 7dd3853eac98396d3b5abee16d7f680d941eae82 (diff) | |
download | ruby-96b40dff450df701200ea5edceb07f2ed847e3fd.tar.gz |
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.y | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -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); } |