summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-21 08:48:07 (GMT)
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-21 08:48:07 (GMT)
commitafa10bd12533b1f42b609a055e94f520005d88c6 (patch)
treee969343b1f2f20a3df56d2c9e1ef72f8c7b2564c /template
parentbca966617e4d765c3cfb8cecf1030f1e3c2fb2db (diff)
Skip comment lines
* template/prelude.c.tmpl (translate): empty (only LF) lines are not necessary. so skip them, but for safety only when they are made from comment line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template')
-rw-r--r--template/prelude.c.tmpl1
1 files changed, 1 insertions, 0 deletions
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl
index ef024fd..34763cc 100644
--- a/template/prelude.c.tmpl
+++ b/template/prelude.c.tmpl
@@ -42,6 +42,7 @@ class Prelude
result = [@preludes.size, @vpath.strip(filename), lines, sub]
@vpath.foreach(filename) do |line|
@preludes[filename] ||= result
+ next if /\A\s*\#.*\n\z/ =~ line
line.sub!(/(?:^|\s+)\#(?:$|[#\s].*)/, '')
line.sub!(/require(_relative)?\s*\(?\s*(["'])(.*?)(?:\.rb)?\2\)?/) do
orig, rel, path = $&, $2, $3