summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCarson McDonald <[email protected]>2013-03-28 17:20:28 -0400
committerCarson McDonald <[email protected]>2013-03-28 22:21:37 -0400
commit06d7bd69a34d52042c5b9631cc5a1ebbf5af7f32 (patch)
treeb64104c4b631d82662b8547ed1204bcb62046935
parentd5021172ee149b4fc0cc382e954faa50086103ad (diff)
downloadmruby-06d7bd69a34d52042c5b9631cc5a1ebbf5af7f32.tar.gz
mruby-06d7bd69a34d52042c5b9631cc5a1ebbf5af7f32.zip
Allow globals that start with $_
-rw-r--r--src/parse.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parse.y b/src/parse.y
index 4826f4336..1bc28283d 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -4730,6 +4730,11 @@ parser_yylex(parser_state *p)
switch (c) {
case '_': /* $_: last read line string */
c = nextc(p);
+ if (c != -1 && identchar(c)) { /* if there is more after _ it is a variable */
+ tokadd(p, '$');
+ tokadd(p, c);
+ break;
+ }
pushback(p, c);
c = '_';
/* fall through */