diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 05:39:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 05:39:02 +0000 |
commit | b5be3e78938ba17d389df1c8f4bdbcc8b4c73550 (patch) | |
tree | cc65cac1c274e6d186ffa69f4fd1da1b81a9f648 | |
parent | b54f2addaaa69a3f8588200d1e9e933738398c6d (diff) | |
download | ruby-b5be3e78938ba17d389df1c8f4bdbcc8b4c73550.tar.gz |
dsl.rb: ID constants
* ext/ripper/tools/dsl.rb (DSL#method_missing): expand ID
constnats without parentheses.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ext/ripper/tools/dsl.rb | 2 | ||||
-rw-r--r-- | parse.y | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/ext/ripper/tools/dsl.rb b/ext/ripper/tools/dsl.rb index 848bd2fa31..0997a09309 100644 --- a/ext/ripper/tools/dsl.rb +++ b/ext/ripper/tools/dsl.rb @@ -43,6 +43,8 @@ class DSL event = $` @events[event] = args.size "dispatch#{ args.size }(#{ [event, *args].join(", ") })" + elsif args.empty? and /\Aid[A-Z]/ =~ event.to_s + event else "#{ event }(#{ args.join(", ") })" end @@ -1646,7 +1646,7 @@ lhs : user_variable /*%%%*/ $$ = attrset(p, $1, idCOLON2, $3, &@$); /*% %*/ - /*% ripper: field!($1, "ID2VAL(idCOLON2)", $3) %*/ + /*% ripper: field!($1, ID2VAL(idCOLON2), $3) %*/ } | primary_value call_op tCONSTANT { @@ -3613,7 +3613,7 @@ numeric : simple_numeric $$ = $2; add_mark_object(p, $$->nd_lit = negate_lit(p, $$->nd_lit)); /*% %*/ - /*% ripper: unary!("ID2VAL(idUMinus)", $2) %*/ + /*% ripper: unary!(ID2VAL(idUMinus), $2) %*/ } ; |