1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Merge racc from upstream repository.

* Support Ruby 2.4's frozen string literals.
  * Remove VCS revisions headers.
This commit is contained in:
Hiroshi SHIBATA 2020-02-27 13:33:51 +09:00
parent 9a422fc010
commit 229ba1215f
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
16 changed files with 36 additions and 48 deletions

View file

@ -1,5 +1,5 @@
# frozen_string_literal: false
# $Id: a9187b5bc40e6adf05e7b6ee5b370b39a3429ecd $
#
require 'mkmf'

View file

@ -1,6 +1,6 @@
#--
#
# $Id: 14fa1118eb3a23e85265e4f7afe2d5a297d69f9c $
#
#
# Copyright (c) 1999-2006 Minero Aoki
#

View file

@ -1,6 +1,6 @@
#--
#
# $Id: 74ff4369ce53c7f45cfc2644ce907785104ebf6e $
#
#
# Copyright (c) 1999-2006 Minero Aoki
#

View file

@ -1,6 +1,6 @@
#--
#
# $Id: ebb9798ad0b211e031670a12a1ab154678c1c8f3 $
#
#
# Copyright (c) 1999-2006 Minero Aoki
#

View file

@ -1,6 +1,6 @@
#--
#
# $Id: 3fcabd58bef02540bf78e8142469681cb9f975c2 $
#
#
# Copyright (c) 1999-2006 Minero Aoki
#

View file

@ -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'

View file

@ -1,6 +1,6 @@
#--
#
# $Id: 8ab2cb5341529fe5e35956bb1a1f42ec9b9c6f5a $
#
#
# Copyright (c) 1999-2006 Minero Aoki
#

View file

@ -1,6 +1,6 @@
#--
#
# $Id: 31aa4331c08dfd4609c06eb5f94b7ef38dc708e1 $
#
#
# Copyright (c) 1999-2006 Minero Aoki
#

View file

@ -1,6 +1,6 @@
#--
#
# $Id: 5e9d0a01b5d56fd9cdc3d5cb078b1a3e1bbaf779 $
#
#
# Copyright (c) 1999-2006 Minero Aoki
#

View file

@ -31,7 +31,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]
@ -43,7 +43,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
@ -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

View file

@ -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

View file

@ -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

View file

@ -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"])

View file

@ -1,6 +1,6 @@
#--
#
# $Id: 3b2d89d9ada2f5fcb043837dcc5c9631856d5b70 $
#
#
# Copyright (c) 1999-2006 Minero Aoki
#

View file

@ -1,6 +1,6 @@
#--
#
# $Id: 6bd3136439c94cb8d928917f5e0de9c593181527 $
#
#
# Copyright (c) 1999-2006 Minero Aoki
#

View file

@ -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