summaryrefslogtreecommitdiff
path: root/prism/templates/ext/prism/api_node.c.erb
diff options
context:
space:
mode:
Diffstat (limited to 'prism/templates/ext/prism/api_node.c.erb')
-rw-r--r--prism/templates/ext/prism/api_node.c.erb3
1 files changed, 1 insertions, 2 deletions
diff --git a/prism/templates/ext/prism/api_node.c.erb b/prism/templates/ext/prism/api_node.c.erb
index 419236ef78..0e3e4d63cc 100644
--- a/prism/templates/ext/prism/api_node.c.erb
+++ b/prism/templates/ext/prism/api_node.c.erb
@@ -76,8 +76,7 @@ pm_source_new(const pm_parser_t *parser, rb_encoding *encoding) {
rb_ary_push(offsets, ULONG2NUM(parser->newline_list.offsets[index]));
}
- VALUE source_argv[] = { source_string, LONG2NUM(parser->start_line), offsets };
- return rb_class_new_instance(3, source_argv, rb_cPrismSource);
+ return rb_funcall(rb_cPrismSource, rb_intern("for"), 3, source_string, LONG2NUM(parser->start_line), offsets);
}
typedef struct pm_node_stack_node {