summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-15 06:00:30 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-15 06:00:30 +0000
commitbbf2ad4ed8a142c5fba8b5e56293006b359f9b18 (patch)
tree5cd9ec18d5f68c4092ffb4b29004289bd9fad895 /parse.y
parentf57e5b0dc61aab42d2913029080d7e93cc75f71a (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y10
1 files changed, 9 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 0cf9194f36..3a273da94e 100644
--- a/parse.y
+++ b/parse.y
@@ -3397,7 +3397,15 @@ yylex()
case '~': /* $~: match-data */
/* fall through */
case '_': /* $_: last read line string */
- local_cnt(c);
+ c = nextc();
+ if (is_identchar(c)) {
+ tokadd('$');
+ tokadd('_');
+ break;
+ }
+ pushback(c);
+ c = '_';
+ local_cnt('_');
/* fall through */
case '*': /* $*: argv */
case '$': /* $$: pid */