diff options
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -525,6 +525,10 @@ mlhs_node : variable { $$ = attrset($1, $3); } + | primary '.' tCONSTANT + { + $$ = attrset($1, $3); + } | backref { rb_backref_error($1); @@ -547,6 +551,10 @@ lhs : variable { $$ = attrset($1, $3); } + | primary '.' tCONSTANT + { + $$ = attrset($1, $3); + } | backref { rb_backref_error($1); @@ -3319,13 +3327,16 @@ yylex() case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': + tokadd('$'); while (ISDIGIT(c)) { tokadd(c); c = nextc(); } + if (is_identchar(c)) + break; pushback(c); tokfix(); - yylval.node = NEW_NTH_REF(atoi(tok())); + yylval.node = NEW_NTH_REF(atoi(tok()+1)); return tNTH_REF; default: |