diff options
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r-- | lib/mkmf.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 1eb52047a3..d801a6ad8b 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -2050,8 +2050,11 @@ RULES suffixes << m[1] << m[2] implicit = [[m[1], m[2]], [m.post_match]] next - elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line - line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2} + elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line + line.sub!(%r'(\s)*\#.*$', '') + comment = $& || '' + line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2} + line = line.chomp + comment + "\n" end depout << line end |