[前][次][番号順一覧][スレッド一覧]

ruby-changes:60214

From: Hiroshi <ko1@a...>
Date: Thu, 27 Feb 2020 13:36:02 +0900 (JST)
Subject: [ruby-changes:60214] 229ba1215f (master): Merge racc from upstream repository.

https://git.ruby-lang.org/ruby.git/commit/?id=229ba1215f

From 229ba1215fa7c8181b9296dff22807fb17442c74 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Thu, 27 Feb 2020 13:33:51 +0900
Subject: Merge racc from upstream repository.

  * Support Ruby 2.4's frozen string literals.
  * Remove VCS revisions headers.

diff --git a/ext/racc/cparse/extconf.rb b/ext/racc/cparse/extconf.rb
index 47b455d..3b4f594 100644
--- a/ext/racc/cparse/extconf.rb
+++ b/ext/racc/cparse/extconf.rb
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ext/racc/cparse/extconf.rb#L1
 # frozen_string_literal: false
-# $Id: a9187b5bc40e6adf05e7b6ee5b370b39a3429ecd $
+#
 
 require 'mkmf'
 
diff --git a/lib/racc/compat.rb b/lib/racc/compat.rb
index fad0312..e46b0e6 100644
--- a/lib/racc/compat.rb
+++ b/lib/racc/compat.rb
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/compat.rb#L1
 #--
 #
-# $Id: 14fa1118eb3a23e85265e4f7afe2d5a297d69f9c $
+#
 #
 # Copyright (c) 1999-2006 Minero Aoki
 #
diff --git a/lib/racc/debugflags.rb b/lib/racc/debugflags.rb
index 3df96f2..6b7549f 100644
--- a/lib/racc/debugflags.rb
+++ b/lib/racc/debugflags.rb
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/debugflags.rb#L1
 #--
 #
-# $Id: 74ff4369ce53c7f45cfc2644ce907785104ebf6e $
+#
 #
 # Copyright (c) 1999-2006 Minero Aoki
 #
diff --git a/lib/racc/exception.rb b/lib/racc/exception.rb
index 83170b3..c11dc2e 100644
--- a/lib/racc/exception.rb
+++ b/lib/racc/exception.rb
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/exception.rb#L1
 #--
 #
-# $Id: ebb9798ad0b211e031670a12a1ab154678c1c8f3 $
+#
 #
 # Copyright (c) 1999-2006 Minero Aoki
 #
diff --git a/lib/racc/grammar.rb b/lib/racc/grammar.rb
index 1ef3d56..fa81534 100644
--- a/lib/racc/grammar.rb
+++ b/lib/racc/grammar.rb
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/grammar.rb#L1
 #--
 #
-# $Id: 3fcabd58bef02540bf78e8142469681cb9f975c2 $
+#
 #
 # Copyright (c) 1999-2006 Minero Aoki
 #
diff --git a/lib/racc/grammarfileparser.rb b/lib/racc/grammarfileparser.rb
index e85e06c..6d63506 100644
--- a/lib/racc/grammarfileparser.rb
+++ b/lib/racc/grammarfileparser.rb
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/grammarfileparser.rb#L1
 #--
 #
-# $Id: 63bd084db2dce8a2c9760318faae6104717cead7 $
+#
 #
 # Copyright (c) 1999-2006 Minero Aoki
 #
@@ -429,7 +429,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/grammarfileparser.rb#L429
     $raccs_print_type = false
 
     def scan_action
-      buf = ''
+      buf = String.new
       nest = 1
       pre = nil
       @in_block = 'action'
diff --git a/lib/racc/info.rb b/lib/racc/info.rb
index d35ce2d..b55866d 100644
--- a/lib/racc/info.rb
+++ b/lib/racc/info.rb
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/info.rb#L1
 #--
 #
-# $Id: 8ab2cb5341529fe5e35956bb1a1f42ec9b9c6f5a $
+#
 #
 # Copyright (c) 1999-2006 Minero Aoki
 #
diff --git a/lib/racc/iset.rb b/lib/racc/iset.rb
index cfe3657..91ca932 100644
--- a/lib/racc/iset.rb
+++ b/lib/racc/iset.rb
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/iset.rb#L1
 #--
 #
-# $Id: 31aa4331c08dfd4609c06eb5f94b7ef38dc708e1 $
+#
 #
 # Copyright (c) 1999-2006 Minero Aoki
 #
diff --git a/lib/racc/logfilegenerator.rb b/lib/racc/logfilegenerator.rb
index e54af87..18991c5 100644
--- a/lib/racc/logfilegenerator.rb
+++ b/lib/racc/logfilegenerator.rb
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/logfilegenerator.rb#L1
 #--
 #
-# $Id: 5e9d0a01b5d56fd9cdc3d5cb078b1a3e1bbaf779 $
+#
 #
 # Copyright (c) 1999-2006 Minero Aoki
 #
diff --git a/lib/racc/parser-text.rb b/lib/racc/parser-text.rb
index 31b8e2c..118b1a1 100644
--- a/lib/racc/parser-text.rb
+++ b/lib/racc/parser-text.rb
@@ -31,7 +31,7 @@ end https://github.com/ruby/ruby/blob/trunk/lib/racc/parser-text.rb#L31
 # == Command-line Reference
 #
 #     racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
-#          [-e<var>rubypath</var>] [--embedded=<var>rubypath</var>]
+#          [-e<var>rubypath</var>] [--executable=<var>rubypath</var>]
 #          [-v] [--verbose]
 #          [-O<var>filename</var>] [--log-file=<var>filename</var>]
 #          [-g] [--debug]
@@ -43,7 +43,7 @@ end https://github.com/ruby/ruby/blob/trunk/lib/racc/parser-text.rb#L43
 #          [-S] [--output-status]
 #          [--version] [--copyright] [--help] <var>grammarfile</var>
 #
-# [+filename+]
+# [+grammarfile+]
 #   Racc grammar file. Any extension is permitted.
 # [-o+outfile+, --output-file=+outfile+]
 #   A filename for output. default is <+filename+>.tab.rb
@@ -188,10 +188,8 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parser-text.rb#L188
   class Parser
 
     Racc_Runtime_Version = ::Racc::VERSION
-    Racc_Runtime_Revision = '$Id: 7adc21ee7a5690f10b7ff399b8af4e2717b9d94c $'
-
     Racc_Runtime_Core_Version_R = ::Racc::VERSION
-    Racc_Runtime_Core_Revision_R = '$Id: 7adc21ee7a5690f10b7ff399b8af4e2717b9d94c $'.split[1]
+
     begin
       if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
         require 'racc/cparse-jruby.jar'
@@ -199,8 +197,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parser-text.rb#L197
       else
         require 'racc/cparse'
       end
-    # Racc_Runtime_Core_Version_C  = (defined in extension)
-      Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
+
       unless new.respond_to?(:_racc_do_parse_c, true)
         raise LoadError, 'old cparse.so'
       end
@@ -211,15 +208,11 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parser-text.rb#L208
       Racc_Main_Parsing_Routine    = :_racc_do_parse_c # :nodoc:
       Racc_YY_Parse_Method         = :_racc_yyparse_c # :nodoc:
       Racc_Runtime_Core_Version    = Racc_Runtime_Core_Version_C # :nodoc:
-      Racc_Runtime_Core_Revision   = Racc_Runtime_Core_Revision_C # :nodoc:
       Racc_Runtime_Type            = 'c' # :nodoc:
     rescue LoadError
-puts $!
-puts $!.backtrace
       Racc_Main_Parsing_Routine    = :_racc_do_parse_rb
       Racc_YY_Parse_Method         = :_racc_yyparse_rb
       Racc_Runtime_Core_Version    = Racc_Runtime_Core_Version_R
-      Racc_Runtime_Core_Revision   = Racc_Runtime_Core_Revision_R
       Racc_Runtime_Type            = 'ruby'
     end
 
diff --git a/lib/racc/parser.rb b/lib/racc/parser.rb
index 56b4af9..8d30f52 100644
--- a/lib/racc/parser.rb
+++ b/lib/racc/parser.rb
@@ -29,7 +29,7 @@ end https://github.com/ruby/ruby/blob/trunk/lib/racc/parser.rb#L29
 # == Command-line Reference
 #
 #     racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
-#          [-e<var>rubypath</var>] [--embedded=<var>rubypath</var>]
+#          [-e<var>rubypath</var>] [--executable=<var>rubypath</var>]
 #          [-v] [--verbose]
 #          [-O<var>filename</var>] [--log-file=<var>filename</var>]
 #          [-g] [--debug]
@@ -41,7 +41,7 @@ end https://github.com/ruby/ruby/blob/trunk/lib/racc/parser.rb#L41
 #          [-S] [--output-status]
 #          [--version] [--copyright] [--help] <var>grammarfile</var>
 #
-# [+filename+]
+# [+grammarfile+]
 #   Racc grammar file. Any extension is permitted.
 # [-o+outfile+, --output-file=+outfile+]
 #   A filename for output. default is <+filename+>.tab.rb
@@ -186,10 +186,8 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parser.rb#L186
   class Parser
 
     Racc_Runtime_Version = ::Racc::VERSION
-    Racc_Runtime_Revision = '$Id: e754525bd317344c4284fca6fdce0a425979ade1 $'
-
     Racc_Runtime_Core_Version_R = ::Racc::VERSION
-    Racc_Runtime_Core_Revision_R = '$Id: e754525bd317344c4284fca6fdce0a425979ade1 $'.split[1]
+
     begin
       if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
         require 'racc/cparse-jruby.jar'
@@ -197,8 +195,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parser.rb#L195
       else
         require 'racc/cparse'
       end
-    # Racc_Runtime_Core_Version_C  = (defined in extension)
-      Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
+
       unless new.respond_to?(:_racc_do_parse_c, true)
         raise LoadError, 'old cparse.so'
       end
@@ -209,15 +206,11 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parser.rb#L206
       Racc_Main_Parsing_Routine    = :_racc_do_parse_c # :nodoc:
       Racc_YY_Parse_Method         = :_racc_yyparse_c # :nodoc:
       Racc_Runtime_Core_Version    = Racc_Runtime_Core_Version_C # :nodoc:
-      Racc_Runtime_Core_Revision   = Racc_Runtime_Core_Revision_C # :nodoc:
       Racc_Runtime_Type            = 'c' # :nodoc:
     rescue LoadError
-puts $!
-puts $!.backtrace
       Racc_Main_Parsing_Routine    = :_racc_do_parse_rb
       Racc_YY_Parse_Method         = :_racc_yyparse_rb
       Racc_Runtime_Core_Version    = Racc_Runtime_Core_Version_R
-      Racc_Runtime_Core_Revision   = Racc_Runtime_Core_Revision_R
       Racc_Runtime_Type            = 'ruby'
     end
 
diff --git a/lib/racc/parserfilegenerator.rb b/lib/racc/parserfilegenerator.rb
index 068c902..1caac10 100644
--- a/lib/racc/parserfilegenerator.rb
+++ b/lib/racc/parserfilegenerator.rb
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/parserfilegenerator.rb#L1
 #--
 #
-# $Id: fff07ebfd582f8dbc845e424908cb9f41f8bf42f $
+#
 #
 # Copyright (c) 1999-2006 Minero Aoki
 #
@@ -238,7 +238,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parserfilegenerator.rb#L238
     end
 
     def unique_separator(id)
-      sep = "...end #{id}/module_eval..."
+      sep = String.new "...end #{id}/module_eval..."
       while @used_separator.key?(sep)
         sep.concat sprintf('%02x', rand(255))
       end
@@ -332,7 +332,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parserfilegenerator.rb#L332
       # TODO: this can be made a LOT more clean with a simple split/map
       sep  = "\n"
       nsep = ",\n"
-      buf  = ''
+      buf  = String.new
       com  = ''
       ncom = ','
       co   = com
@@ -342,7 +342,7 @@ module  (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]