summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ast.c4
-rw-r--r--test/ruby/test_ast.rb12
-rw-r--r--version.h2
3 files changed, 16 insertions, 2 deletions
diff --git a/ast.c b/ast.c
index 2df4bdd870..f0e8dd2eaf 100644
--- a/ast.c
+++ b/ast.c
@@ -525,7 +525,9 @@ node_children(rb_ast_t *ast, NODE *node)
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:
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 23cd5618a0..1a897ef502 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -257,4 +257,16 @@ class TestAst < Test::Unit::TestCase
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
diff --git a/version.h b/version.h
index 299086f549..294506e617 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#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