diff --git a/ext/racc/cparse/extconf.rb b/ext/racc/cparse/extconf.rb index 47b455d992..3b4f594b9d 100644 --- a/ext/racc/cparse/extconf.rb +++ b/ext/racc/cparse/extconf.rb @@ -1,5 +1,5 @@ # frozen_string_literal: false -# $Id: a9187b5bc40e6adf05e7b6ee5b370b39a3429ecd $ +# require 'mkmf' diff --git a/lib/racc/compat.rb b/lib/racc/compat.rb index fad03128aa..e46b0e648c 100644 --- a/lib/racc/compat.rb +++ b/lib/racc/compat.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 14fa1118eb3a23e85265e4f7afe2d5a297d69f9c $ +# # # Copyright (c) 1999-2006 Minero Aoki # diff --git a/lib/racc/debugflags.rb b/lib/racc/debugflags.rb index 3df96f294d..6b7549fc8d 100644 --- a/lib/racc/debugflags.rb +++ b/lib/racc/debugflags.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 74ff4369ce53c7f45cfc2644ce907785104ebf6e $ +# # # Copyright (c) 1999-2006 Minero Aoki # diff --git a/lib/racc/exception.rb b/lib/racc/exception.rb index 83170b3adf..c11dc2e43e 100644 --- a/lib/racc/exception.rb +++ b/lib/racc/exception.rb @@ -1,6 +1,6 @@ #-- # -# $Id: ebb9798ad0b211e031670a12a1ab154678c1c8f3 $ +# # # Copyright (c) 1999-2006 Minero Aoki # diff --git a/lib/racc/grammar.rb b/lib/racc/grammar.rb index 1ef3d56a03..fa81534338 100644 --- a/lib/racc/grammar.rb +++ b/lib/racc/grammar.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 3fcabd58bef02540bf78e8142469681cb9f975c2 $ +# # # Copyright (c) 1999-2006 Minero Aoki # diff --git a/lib/racc/grammarfileparser.rb b/lib/racc/grammarfileparser.rb index e85e06ca22..6d63506edf 100644 --- a/lib/racc/grammarfileparser.rb +++ b/lib/racc/grammarfileparser.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 63bd084db2dce8a2c9760318faae6104717cead7 $ +# # # Copyright (c) 1999-2006 Minero Aoki # @@ -429,7 +429,7 @@ module Racc $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 d35ce2dcea..b55866d3c8 100644 --- a/lib/racc/info.rb +++ b/lib/racc/info.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 8ab2cb5341529fe5e35956bb1a1f42ec9b9c6f5a $ +# # # Copyright (c) 1999-2006 Minero Aoki # diff --git a/lib/racc/iset.rb b/lib/racc/iset.rb index cfe3657724..91ca9320f0 100644 --- a/lib/racc/iset.rb +++ b/lib/racc/iset.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 31aa4331c08dfd4609c06eb5f94b7ef38dc708e1 $ +# # # Copyright (c) 1999-2006 Minero Aoki # diff --git a/lib/racc/logfilegenerator.rb b/lib/racc/logfilegenerator.rb index e54af8786d..18991c51ae 100644 --- a/lib/racc/logfilegenerator.rb +++ b/lib/racc/logfilegenerator.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 5e9d0a01b5d56fd9cdc3d5cb078b1a3e1bbaf779 $ +# # # Copyright (c) 1999-2006 Minero Aoki # diff --git a/lib/racc/parser-text.rb b/lib/racc/parser-text.rb index 31b8e2c01f..118b1a11a0 100644 --- a/lib/racc/parser-text.rb +++ b/lib/racc/parser-text.rb @@ -31,7 +31,7 @@ end # == Command-line Reference # # racc [-ofilename] [--output-file=filename] -# [-erubypath] [--embedded=rubypath] +# [-erubypath] [--executable=rubypath] # [-v] [--verbose] # [-Ofilename] [--log-file=filename] # [-g] [--debug] @@ -43,7 +43,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 @@ -188,10 +188,8 @@ module Racc 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 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 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 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 diff --git a/lib/racc/parserfilegenerator.rb b/lib/racc/parserfilegenerator.rb index 068c902e9c..1caac10d9e 100644 --- a/lib/racc/parserfilegenerator.rb +++ b/lib/racc/parserfilegenerator.rb @@ -1,6 +1,6 @@ #-- # -# $Id: fff07ebfd582f8dbc845e424908cb9f41f8bf42f $ +# # # Copyright (c) 1999-2006 Minero Aoki # @@ -238,7 +238,7 @@ module Racc 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 # 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 Racc if buf.size > 66 @f.print sep; sep = nsep @f.print "'", buf, "'" - buf = '' + buf = String.new co = com end end diff --git a/lib/racc/racc.gemspec b/lib/racc/racc.gemspec index 6ed031bfe1..8442ef14e0 100644 --- a/lib/racc/racc.gemspec +++ b/lib/racc/racc.gemspec @@ -18,12 +18,12 @@ DESC s.licenses = ["MIT"] s.executables = ["racc"] s.files = [ - "COPYING", "ChangeLog", "DEPENDS", "Manifest.txt", + "COPYING", "ChangeLog", "DEPENDS", "README.ja.rdoc", "README.rdoc", "Rakefile", "TODO", "bin/racc", "ext/racc/MANIFEST", - "ext/racc/com/headius/racc/Cparse.java", "ext/racc/cparse.c", - "ext/racc/depend", "ext/racc/extconf.rb", "fastcache/extconf.rb", - "fastcache/fastcache.c", "lib/racc.rb", "lib/racc/compat.rb", + "ext/racc/com/headius/racc/Cparse.java", "ext/racc/cparse/cparse.c", + "ext/racc/cparse/extconf.rb", + "lib/racc.rb", "lib/racc/compat.rb", "lib/racc/debugflags.rb", "lib/racc/exception.rb", "lib/racc/grammar.rb", "lib/racc/grammarfileparser.rb", "lib/racc/info.rb", "lib/racc/iset.rb", @@ -31,7 +31,7 @@ DESC "lib/racc/parser.rb", "lib/racc/parserfilegenerator.rb", "lib/racc/pre-setup", "lib/racc/sourcetext.rb", "lib/racc/state.rb", "lib/racc/statetransitiontable.rb", - "lib/racc/static.rb", "misc/dist.sh", "rdoc/en/NEWS.en.rdoc", + "lib/racc/static.rb", "rdoc/en/NEWS.en.rdoc", "rdoc/en/grammar.en.rdoc", "rdoc/ja/NEWS.ja.rdoc", "rdoc/ja/command.ja.html", "rdoc/ja/debug.ja.rdoc", "rdoc/ja/grammar.ja.rdoc", "rdoc/ja/index.ja.html", @@ -39,7 +39,7 @@ DESC "sample/array.y", "sample/array2.y", "sample/calc-ja.y", "sample/calc.y", "sample/conflict.y", "sample/hash.y", "sample/lalr.y", "sample/lists.y", "sample/syntax.y", - "sample/yyerr.y", "setup.rb", "tasks/doc.rb", "tasks/email.rb", + "sample/yyerr.y", "test/assets/cadenza.y", "test/assets/cast.y", "test/assets/chk.y", "test/assets/conf.y", "test/assets/csspool.y", "test/assets/digraph.y", @@ -84,10 +84,9 @@ DESC s.require_paths = ["lib"] s.rubygems_version = "3.1.0.pre1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.extensions = ["ext/racc/extconf.rb"] s.rdoc_options = ["--main", "README.rdoc"] s.extra_rdoc_files = [ - "Manifest.txt", "README.ja.rdoc", "README.rdoc", + "README.ja.rdoc", "README.rdoc", "rdoc/en/NEWS.en.rdoc", "rdoc/en/grammar.en.rdoc", "rdoc/ja/NEWS.ja.rdoc", "rdoc/ja/debug.ja.rdoc", "rdoc/ja/grammar.ja.rdoc", "rdoc/ja/parser.ja.rdoc", @@ -96,6 +95,9 @@ DESC if RUBY_PLATFORM =~ /java/ s.files << 'lib/racc/cparse-jruby.jar' + s.platform = 'java' + else + s.extensions = ["ext/racc/cparse/extconf.rb"] end s.add_development_dependency("rake-compiler", [">= 0.4.1"]) diff --git a/lib/racc/sourcetext.rb b/lib/racc/sourcetext.rb index 6944ac7541..ba0b0d248b 100644 --- a/lib/racc/sourcetext.rb +++ b/lib/racc/sourcetext.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 3b2d89d9ada2f5fcb043837dcc5c9631856d5b70 $ +# # # Copyright (c) 1999-2006 Minero Aoki # diff --git a/lib/racc/state.rb b/lib/racc/state.rb index 50852d9130..f85809fbeb 100644 --- a/lib/racc/state.rb +++ b/lib/racc/state.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 6bd3136439c94cb8d928917f5e0de9c593181527 $ +# # # Copyright (c) 1999-2006 Minero Aoki # diff --git a/lib/racc/statetransitiontable.rb b/lib/racc/statetransitiontable.rb index dc525bbafa..5d1288ca58 100644 --- a/lib/racc/statetransitiontable.rb +++ b/lib/racc/statetransitiontable.rb @@ -1,6 +1,6 @@ #-- # -# $Id: 4c5f4311663b6d03050953d64d6a0e7905ff2216 $ +# # # Copyright (c) 1999-2006 Minero Aoki # @@ -198,7 +198,7 @@ module Racc def mkmapexp(arr) i = ii = 0 as = arr.size - map = '' + map = String.new maxdup = RE_DUP_MAX curr = nil while i < as