[前][次][番号順一覧][スレッド一覧]

ruby-changes:54636

From: naruse <ko1@a...>
Date: Fri, 18 Jan 2019 07:03:19 +0900 (JST)
Subject: [ruby-changes:54636] naruse:r66851 (ruby_2_6): merge revision(s) 66819: [Backport #15532]

naruse	2019-01-18 07:03:14 +0900 (Fri, 18 Jan 2019)

  New Revision: 66851

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66851

  Log:
    merge revision(s) 66819: [Backport #15532]
    
    ast.c: fix missing head part in dynamic literal

  Modified directories:
    branches/ruby_2_6/
  Modified files:
    branches/ruby_2_6/ast.c
    branches/ruby_2_6/test/ruby/test_ast.rb
    branches/ruby_2_6/version.h
Index: ruby_2_6/version.h
===================================================================
--- ruby_2_6/version.h	(revision 66850)
+++ ruby_2_6/version.h	(revision 66851)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_6/version.h#L1
 #define RUBY_VERSION "2.6.0"
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 19
+#define RUBY_PATCHLEVEL 20
 
 #define RUBY_RELEASE_YEAR 2019
 #define RUBY_RELEASE_MONTH 1
Index: ruby_2_6/ast.c
===================================================================
--- ruby_2_6/ast.c	(revision 66850)
+++ ruby_2_6/ast.c	(revision 66851)
@@ -525,7 +525,9 @@ node_children(rb_ast_t *ast, NODE *node) https://github.com/ruby/ruby/blob/trunk/ruby_2_6/ast.c#L525
         goto dlit;
       case NODE_DSYM:
       dlit:
-        return rb_ary_new_from_node_args(ast, 2, node->nd_next->nd_head, node->nd_next->nd_next);
+        return rb_ary_new_from_args(3, node->nd_lit,
+                                    NEW_CHILD(ast, node->nd_next->nd_head),
+                                    NEW_CHILD(ast, node->nd_next->nd_next));
       case NODE_EVSTR:
         return rb_ary_new_from_node_args(ast, 1, node->nd_body);
       case NODE_ARGSCAT:
Index: ruby_2_6/test/ruby/test_ast.rb
===================================================================
--- ruby_2_6/test/ruby/test_ast.rb	(revision 66850)
+++ ruby_2_6/test/ruby/test_ast.rb	(revision 66851)
@@ -257,4 +257,16 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_6/test/ruby/test_ast.rb#L257
     assert_equal(:b, mid)
     assert_equal(:SCOPE, defn.type)
   end
+
+  def test_dstr
+    node = RubyVM::AbstractSyntaxTree.parse('"foo#{1}bar"')
+    _, _, body = *node.children
+    assert_equal(:DSTR, body.type)
+    head, body = body.children
+    assert_equal("foo", head)
+    assert_equal(:EVSTR, body.type)
+    body, = body.children
+    assert_equal(:LIT, body.type)
+    assert_equal([1], body.children)
+  end
 end
Index: ruby_2_6
===================================================================
--- ruby_2_6	(revision 66850)
+++ ruby_2_6	(revision 66851)

Property changes on: ruby_2_6
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r66819

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]