mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1102 from carsonmcdonald/gvarunderscorefix
Allow globals that start with $_
This commit is contained in:
@@ -4729,6 +4729,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 */
|
||||
|
||||
Reference in New Issue
Block a user