diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-07 19:24:47 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-07 19:24:47 +0000 |
commit | b41a687fe6ba9e2dd898df98018ba59450376603 (patch) | |
tree | 7ba03172aef9e4f2bd3e3f91c3cf866d3702c36f | |
parent | c6d05a63c689dd162c92dc73188a8ba041fef6bc (diff) | |
download | ruby-b41a687fe6ba9e2dd898df98018ba59450376603.tar.gz |
* common.mk: see both $(srcdir)/enc/trans and enc/trans.
* enc/trans/make_transdb.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | common.mk | 2 | ||||
-rw-r--r-- | enc/trans/make_transdb.rb | 34 |
3 files changed, 25 insertions, 17 deletions
@@ -1,3 +1,9 @@ +Fri Aug 8 04:20:14 2008 NARUSE, Yui <naruse@ruby-lang.org> + + * common.mk: see both $(srcdir)/enc/trans and enc/trans. + + * enc/trans/make_transdb.rb: ditto. + Fri Aug 8 00:05:02 2008 TAKAO Kouji <kouji@takao7.net> * ext/.document: added readline/readline.c. @@ -684,7 +684,7 @@ encdb.h: $(PREP) $(IFCHANGE) "$@" "$@.new" transdb.h: $(PREP) transcodes - $(MINIRUBY) $(srcdir)/enc/trans/make_transdb.rb $(srcdir)/enc/trans $@.new + $(MINIRUBY) $(srcdir)/enc/trans/make_transdb.rb $@.new $(srcdir)/enc/trans enc/trans $(IFCHANGE) "$@" "$@.new" miniprelude.c: $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb diff --git a/enc/trans/make_transdb.rb b/enc/trans/make_transdb.rb index 649a6f21a3..ab48c4c940 100644 --- a/enc/trans/make_transdb.rb +++ b/enc/trans/make_transdb.rb @@ -8,22 +8,24 @@ count = 0 converters = {} -transdir = ARGV[0] -outhdr = ARGV[1] || 'transdb.h' -Dir.open(transdir) {|d| d.grep(/.+\.[ch]\z/).reject {|n| /\.erb\.c\z/ =~ n }}.sort_by {|e| - e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten -}.each do |fn| - open(File.join(transdir,fn)) do |f| - f.each_line do |line| - if (/^static const rb_transcoder/ =~ line)..(/"(.*?)"\s*,\s*"(.*?)"/ =~ line) - if $1 && $2 - from_to = "%s to %s" % [$1, $2] - if converters[from_to] - raise ArgumentError, '%s:%d: transcode "%s" is already registered (%s:%d)' % - [fn, $., from_to, *converters[from_to].values_at(2, 3)] - else - converters[from_to] = [$1, $2, fn[0..-3], $.] - end +outhdr = ARGV[0] || 'transdb.h' +transdirs = ARGV[1..-1] || 'enc/trans' +transdirs.each do |transdir| + Dir.open(transdir) {|d| d.grep(/.+\.[ch]\z/).reject {|n| /\.erb\.c\z/ =~ n }}.sort_by {|e| + e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten + }.each do |fn| + open(File.join(transdir,fn)) do |f| + f.each_line do |line| + if (/^static const rb_transcoder/ =~ line)..(/"(.*?)"\s*,\s*"(.*?)"/ =~ line) + if $1 && $2 + from_to = "%s to %s" % [$1, $2] + if converters[from_to] + raise ArgumentError, '%s:%d: transcode "%s" is already registered (%s:%d)' % + [fn, $., from_to, *converters[from_to].values_at(2, 3)] + else + converters[from_to] = [$1, $2, fn[0..-3], $.] + end + end end end end |