aboutsummaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-11-09 18:44:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-11-09 18:45:48 +0900
commit95aed94d2aba5ff93425f26ae6181607996d8ca3 (patch)
tree962e14bc487adaee404f1ee9a8a487f1e4411665 /template
parent352096ef6047538bfedb974a7c1b1156f5a0e811 (diff)
downloadruby-95aed94d2aba5ff93425f26ae6181607996d8ca3.tar.gz
Fixed `#line` directives in miniprelude.c
Diffstat (limited to 'template')
-rw-r--r--template/prelude.c.tmpl9
1 files changed, 5 insertions, 4 deletions
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl
index 99dc25fee8..71f015fcee 100644
--- a/template/prelude.c.tmpl
+++ b/template/prelude.c.tmpl
@@ -30,8 +30,8 @@ class Prelude
"<internal:" + prelude_base(filename) + ">"
end
- def initialize(init_name, preludes, vpath)
- @init_name = init_name
+ def initialize(output, preludes, vpath)
+ @output = output
@have_sublib = false
@vpath = vpath
@preludes = {}
@@ -114,7 +114,7 @@ static const struct {
% size += line.size
"<%=c_esc(line)%>"<%if comment%>/* <%=c_esc(comment)%> */<%end%>
% }
-#line <%=_erbout.count("\n")+2%> "<%=@init_name%>.c"
+#line <%=_erbout.count("\n")+2%> "<%=@output%>"
};
% }
@@ -201,8 +201,9 @@ prelude_require(VALUE self, VALUE nth)
% end
%end
+% init_name = @output && @output[/\w+(?=_prelude.c\b)/] || 'prelude'
void
-Init_<%=@init_name%><%=%>(void)
+Init_<%=init_name%><%=%>(void)
{
%unless @preludes.empty?
% if @have_sublib