diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-11-14 16:37:25 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-11-14 16:37:25 +0900 |
commit | 4d615a0c8f4759ce4f6b96b643ef957837bdf20e (patch) | |
tree | 8db2bd9558454edd2b0c3d7f58aab987e7ca54a1 | |
parent | 703e05b0eee3017a63690155e55a97d678f073cb (diff) | |
download | ruby-4d615a0c8f4759ce4f6b96b643ef957837bdf20e.tar.gz |
`#@1` is no longer an embedded variable
-rw-r--r-- | parse.y | 3 | ||||
-rw-r--r-- | test/ripper/test_scanner_events.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_parse.rb | 1 |
3 files changed, 2 insertions, 4 deletions
@@ -7013,9 +7013,6 @@ parser_peek_variable_name(struct parser_params *p) if (++ptr >= p->lex.pend) return 0; c = *ptr; } - else if (ISDIGIT(c)) { - return tSTRING_DVAR; - } break; case '{': p->lex.pcur = ptr; diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index d2f8479a33..ffe2ea1e37 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -269,7 +269,7 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase scan('embvar', '"#@ivar"') assert_equal ['#'], scan('embvar', '"#@@cvar"') - assert_equal ['#'], + assert_equal [], scan('embvar', '"#@1"') assert_equal [], scan('embvar', '"#lvar"') diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 2622ec529c..cb379ebe18 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -358,6 +358,7 @@ class TestParse < Test::Unit::TestCase assert_equal("foo 1 bar", "foo #@@foo bar") "1" =~ /(.)/ assert_equal("foo 1 bar", "foo #$1 bar") + assert_equal('foo #@1 bar', eval('"foo #@1 bar"')) end def test_dstr_disallowed_variable |