diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-19 00:22:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-19 00:22:56 +0000 |
commit | 50f7d64f415aa2fa5767749e1076965308dfca05 (patch) | |
tree | f9c3a9a06b67bd863b22fd51253c01af964a674f /test/ruby | |
parent | 698f2db2240c81a21b9cad56d46fbc1ea02c7042 (diff) | |
download | ruby-50f7d64f415aa2fa5767749e1076965308dfca05.tar.gz |
parse.y: lex by lvar
* parse.y (parse_ident): disable tLPAREN_ARG state by local
variable. [ruby-list:50578]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_parse.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index f92bb49e05..36ff776db9 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -1054,6 +1054,17 @@ x = __ENCODING__ assert_not_match(/unexpected tSTRING_END/, e) end + def test_lparenarg + o = Struct.new(:x).new + def o.i(x) + self.x = x + end + o.instance_eval {i (-1.3).abs} + assert_equal(1.3, o.x) + o.instance_eval {i = 0; i (-1.3).abs} + assert_equal(1.3, o.x) + end + =begin def test_past_scope_variable assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}} |