mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* tool/transcode-tblgen.rb: add prefix for byte_array and word_array.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5cea1b07f4
commit
39f172f9d7
2 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Sep 2 21:22:22 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* tool/transcode-tblgen.rb: add prefix for byte_array and word_array.
|
||||||
|
|
||||||
Tue Sep 2 20:57:14 2008 Tanaka Akira <akr@fsij.org>
|
Tue Sep 2 20:57:14 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* enc/trans/make_transdb.rb: check foo.c only if foo.trans exists.
|
* enc/trans/make_transdb.rb: check foo.c only if foo.trans exists.
|
||||||
|
|
|
@ -328,7 +328,7 @@ class ActionMap
|
||||||
if bytes_code.empty?
|
if bytes_code.empty?
|
||||||
bytes_code << <<"End"
|
bytes_code << <<"End"
|
||||||
static const unsigned char
|
static const unsigned char
|
||||||
byte_array[0] = {
|
#{OUTPUT_PREFIX}byte_array[0] = {
|
||||||
};
|
};
|
||||||
End
|
End
|
||||||
end
|
end
|
||||||
|
@ -345,7 +345,7 @@ End
|
||||||
if words_code.empty?
|
if words_code.empty?
|
||||||
words_code << <<"End"
|
words_code << <<"End"
|
||||||
static const uintptr_t
|
static const uintptr_t
|
||||||
word_array[0] = {
|
#{OUTPUT_PREFIX}word_array[0] = {
|
||||||
};
|
};
|
||||||
End
|
End
|
||||||
end
|
end
|
||||||
|
@ -609,7 +609,7 @@ end
|
||||||
def transcode_generated_code
|
def transcode_generated_code
|
||||||
TRANSCODE_GENERATED_BYTES_CODE +
|
TRANSCODE_GENERATED_BYTES_CODE +
|
||||||
TRANSCODE_GENERATED_WORDS_CODE +
|
TRANSCODE_GENERATED_WORDS_CODE +
|
||||||
"\#define TRANSCODE_TABLE_INFO byte_array, word_array, sizeof(uintptr_t)\n" +
|
"\#define TRANSCODE_TABLE_INFO #{OUTPUT_PREFIX}byte_array, #{OUTPUT_PREFIX}word_array, sizeof(uintptr_t)\n" +
|
||||||
TRANSCODE_GENERATED_TRANSCODER_CODE
|
TRANSCODE_GENERATED_TRANSCODER_CODE
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -716,6 +716,11 @@ op.parse!
|
||||||
|
|
||||||
VERBOSE_MODE = verbose_mode
|
VERBOSE_MODE = verbose_mode
|
||||||
|
|
||||||
|
OUTPUT_FILENAME = output_filename
|
||||||
|
OUTPUT_PREFIX = output_filename ? File.basename(output_filename)[/\A[A-Za-z0-9_]*/] : ""
|
||||||
|
OUTPUT_PREFIX.sub!(/\A_+/, '')
|
||||||
|
OUTPUT_PREFIX.sub!(/_*\z/, '_')
|
||||||
|
|
||||||
arg = ARGV.shift
|
arg = ARGV.shift
|
||||||
$srcdir = File.dirname(arg)
|
$srcdir = File.dirname(arg)
|
||||||
$:.unshift $srcdir unless $:.include? $srcdir
|
$:.unshift $srcdir unless $:.include? $srcdir
|
||||||
|
|
Loading…
Reference in a new issue