summaryrefslogtreecommitdiff
path: root/ext/ripper/lib/ripper/sexp.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-01 02:01:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-01 02:01:05 +0000
commitf2d18484417fdc6e9ae4970fed7eda0de1027e91 (patch)
tree9f5586a5e6d5538834c4683b293b8c06874f1b83 /ext/ripper/lib/ripper/sexp.rb
parent844ca35a924ed2ff0de48f0e4680f05f8da234bf (diff)
parse.y: f_margs parser events
* parse.y (f_margs): implemented parser events for massign formal arguments. [ruby-core:81848] [Bug #13701] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/ripper/lib/ripper/sexp.rb')
-rw-r--r--ext/ripper/lib/ripper/sexp.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/ripper/lib/ripper/sexp.rb b/ext/ripper/lib/ripper/sexp.rb
index d7bf530..b52dd30 100644
--- a/ext/ripper/lib/ripper/sexp.rb
+++ b/ext/ripper/lib/ripper/sexp.rb
@@ -134,6 +134,18 @@ class Ripper
list
end
+ def on_mlhs_paren(list)
+ [:mlhs, *list]
+ end
+
+ def on_mlhs_add_star(list, star)
+ list.push([:rest_param, star])
+ end
+
+ def on_mlhs_add_post(list, post)
+ list.concat(post)
+ end
+
PARSER_EVENT_TABLE.each do |event, arity|
if /_new\z/ =~ event and arity == 0
alias_method "on_#{event}", :_dispatch_event_new