From 229ba1215fa7c8181b9296dff22807fb17442c74 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA 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. --- lib/racc/parser.rb | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'lib/racc/parser.rb') diff --git a/lib/racc/parser.rb b/lib/racc/parser.rb index 56b4af9dea..8d30f52d84 100644 --- a/lib/racc/parser.rb +++ b/lib/racc/parser.rb @@ -29,7 +29,7 @@ end # == Command-line Reference # # racc [-ofilename] [--output-file=filename] -# [-erubypath] [--embedded=rubypath] +# [-erubypath] [--executable=rubypath] # [-v] [--verbose] # [-Ofilename] [--log-file=filename] # [-g] [--debug] @@ -41,7 +41,7 @@ end # [-S] [--output-status] # [--version] [--copyright] [--help] grammarfile # -# [+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 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 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 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 -- cgit v1.2.3