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

* enc/trans/make_transdb.rb: error message improved.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-09-02 10:20:11 +00:00
parent 298d66296d
commit 797faf92d9
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,7 @@
Tue Sep 2 19:19:55 2008 Tanaka Akira <akr@fsij.org>
* enc/trans/make_transdb.rb: error message improved.
Tue Sep 2 14:05:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* enc/trans/utf_16_32.trans (from_UTF_8): rename from to_UTF_16BE

View file

@ -19,16 +19,17 @@ transdirs.each do |transdir|
}.each do |fn|
next if files[fn]
files[fn] = true
open(File.join(transdir,fn)) do |f|
path = File.join(transdir,fn)
open(path) 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)]
raise ArgumentError, '%s:%d: transcode "%s" is already registered at %s:%d' %
[path, $., from_to, *converters[from_to].values_at(3, 4)]
else
converters[from_to] = [$1, $2, fn[0..-3], $.]
converters[from_to] = [$1, $2, fn[0..-3], path, $.]
end
end
end