From 9f99760dafac6eaa53287470b8ff59b1be0bf6d6 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Mon, 20 Jan 2020 16:53:31 +0900 Subject: Get rid of use of special variables Use `"\n"` and `IO#fileno` instead of `$/` and `$.` respectively. [Feature #14240] --- ext/ripper/tools/preproc.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ext/ripper') diff --git a/ext/ripper/tools/preproc.rb b/ext/ripper/tools/preproc.rb index 7639a901df..b838a78db7 100644 --- a/ext/ripper/tools/preproc.rb +++ b/ext/ripper/tools/preproc.rb @@ -45,7 +45,7 @@ def prelude(f, out) while line = f.gets case line when /\A%%/ - out << '%%' << $/ + out << "%%\n" return when /\A%token/ out << line.sub(/<\w+>/, '') @@ -79,15 +79,15 @@ def grammar(f, out) while line = f.gets case line when %r - out << DSL.new($2, ($1 || "").split(",")).generate << $/ + out << DSL.new($2, ($1 || "").split(",")).generate << "\n" when %r - out << '#if 0' << $/ + out << "#if 0\n" when %r - out << '#endif' << $/ + out << "#endif\n" when %r<%\*/> - out << $/ + out << "\n" when /\A%%/ - out << '%%' << $/ + out << "%%\n" return else out << line -- cgit v1.2.3