diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-02-27 13:33:51 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-02-27 13:33:51 +0900 |
commit | 229ba1215fa7c8181b9296dff22807fb17442c74 (patch) | |
tree | 450c94c867407b983ee86a44268f1470c839d717 /lib/racc/parser.rb | |
parent | 9a422fc010ab150438ef9dd66fd4c717f03927d9 (diff) | |
download | ruby-229ba1215fa7c8181b9296dff22807fb17442c74.tar.gz |
Merge racc from upstream repository.
* Support Ruby 2.4's frozen string literals.
* Remove VCS revisions headers.
Diffstat (limited to 'lib/racc/parser.rb')
-rw-r--r-- | lib/racc/parser.rb | 15 |
1 files changed, 4 insertions, 11 deletions
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 [-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 # [-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 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 |