1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

tool/prelude.c.tmpl: use RubyVM::CEscape

Do not repeat yourself.
This commit is contained in:
卜部昌平 2020-08-11 11:40:37 +09:00
parent b0eb5aa344
commit acd8ee8dbc
Notes: git 2020-08-11 16:51:33 +09:00
2 changed files with 8 additions and 20 deletions

View file

@ -17,7 +17,7 @@ module RubyVM::CEscape
# generate comment, with escaps.
def commentify str
return "/* #{str.strip.b.gsub '*/', '*\\/'} */"
return "/* #{str.b.gsub '*/', '*\\/'} */"
end
# Mimic gensym of CL.