mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
[prism] Remove escaping C source files
This commit is contained in:
parent
3d908a41ab
commit
7174c62f6b
1 changed files with 0 additions and 4 deletions
|
@ -360,7 +360,6 @@ module Prism
|
||||||
=end
|
=end
|
||||||
HEADING
|
HEADING
|
||||||
else
|
else
|
||||||
escape = true
|
|
||||||
<<~HEADING
|
<<~HEADING
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* This file is generated by the templates/template.rb script and should not */
|
/* This file is generated by the templates/template.rb script and should not */
|
||||||
|
@ -374,9 +373,6 @@ module Prism
|
||||||
|
|
||||||
write_to ||= File.expand_path("../#{name}", __dir__)
|
write_to ||= File.expand_path("../#{name}", __dir__)
|
||||||
contents = heading + erb.result_with_hash(locals)
|
contents = heading + erb.result_with_hash(locals)
|
||||||
if escape
|
|
||||||
(contents = contents.b).gsub!(/[^\t-~]/) {|c| "\\x%.2x" % c.ord}
|
|
||||||
end
|
|
||||||
|
|
||||||
if (extension == ".c" || extension == ".h") && !contents.ascii_only?
|
if (extension == ".c" || extension == ".h") && !contents.ascii_only?
|
||||||
# Enforce that we only have ASCII characters here. This is necessary
|
# Enforce that we only have ASCII characters here. This is necessary
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue