Skip to content
Browse files

* node.c (dump_node): add today's knowledge. "init arguments (m)" and

  "init arguments (p)" of compile.c indicates a Ruby code that
  evaluates multiple assignments that is in method or block
  parameters:  def foo((m1,m2), (m3,m4), *r, (p1,p2), (p3,p4)); end
  The former (init arguments (m)) evaluates the multiple assignments
  before rest argument, that are (m1,m2) and (m3,m4).  The letter
  (init arguments (p)) does ones after rest argument, that are
  (p1,p2) and (p3, p4).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 579f2a0 commit e98c84519f117825017769825e6303ffb9dd4f7f @mame mame committed Jul 21, 2011
Showing with 14 additions and 0 deletions.
  1. +11 −0 ChangeLog
  2. +3 −0 node.c
View
11 ChangeLog
@@ -1,3 +1,14 @@
+Thu Jul 21 19:27:19 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * node.c (dump_node): add today's knowledge. "init arguments (m)" and
+ "init arguments (p)" of compile.c indicates a Ruby code that
+ evaluates multiple assignments that is in method or block
+ parameters: def foo((m1,m2), (m3,m4), *r, (p1,p2), (p3,p4)); end
+ The former (init arguments (m)) evaluates the multiple assignments
+ before rest argument, that are (m1,m2) and (m3,m4). The letter
+ (init arguments (p)) does ones after rest argument, that are
+ (p1,p2) and (p3, p4).
+
Thu Jul 21 18:11:07 2011 NARUSE, Yui <naruse@ruby-lang.org>
* enum.c (enum_inject): remove empty line to notify rdoc
View
3 node.c
@@ -866,6 +866,9 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
else {
D_NODE_HEADER(node);
ANN("method parameters (cont'd)");
+ ANN("\"init arguments (m)\" evaluates multiple assignments before rest argument");
+ ANN("\"init arguments (p)\" evaluates multiple assignments after rest argument");
+ ANN("example: def foo((m1, m2), *r, (p1, p2))");
F_NODE(nd_1st, "init arguments (m)");
LAST_NODE;
F_NODE(nd_2nd, "init arguments (p)");

0 comments on commit e98c845

Please sign in to comment.
Something went wrong with that request. Please try again.