mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
2000-04-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bb1321b4e5
commit
12e1ee3abd
15 changed files with 165 additions and 118 deletions
32
ChangeLog
32
ChangeLog
|
|
@ -1,3 +1,35 @@
|
|||
Thu Apr 6 20:10:47 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
|
||||
|
||||
* ext/extmk.rb.in (create_makefile): BeOS --program-suffix support.
|
||||
* lib/mkmf.rb (create_makefile): ditto.
|
||||
|
||||
Thu Apr 6 09:55:26 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
|
||||
|
||||
* error.c (rb_sys_fail): need rb_exc_new2() call on BeOS.
|
||||
|
||||
Mon Apr 3 17:22:27 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* eval.c (catch_i): should supply argument.
|
||||
|
||||
Sat Apr 1 21:30:53 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
|
||||
|
||||
* io.c(rb_io_printf, rb_f_printf): should use rb_io_write.
|
||||
|
||||
Sat Apr 1 00:16:05 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* gc.c (rb_gc_call_finalizer_at_exit): should be clear flags
|
||||
before calling finalizers.
|
||||
|
||||
Thu Mar 30 12:19:44 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
|
||||
|
||||
* enum.c (enum_find): rb_eval_cmd() should be called with array.
|
||||
|
||||
Tue Mar 28 13:57:05 2000 Clemens Hintze <c.hintze@gmx.net>
|
||||
|
||||
* ext/dbm/dbm.c (fdbm_invert): should return new hash.
|
||||
|
||||
* ext/gdbm/gdbm.c (fgdbm_invert): ditto.
|
||||
|
||||
Fri Mar 24 18:26:51 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* file.c (test_check): should have checked exact number of arguments.
|
||||
|
|
|
|||
2
enum.c
2
enum.c
|
|
@ -92,7 +92,7 @@ enum_find(argc, argv, obj)
|
|||
return arg.val;
|
||||
}
|
||||
if (!NIL_P(if_none)) {
|
||||
rb_eval_cmd(if_none, Qnil);
|
||||
rb_eval_cmd(if_none, rb_ary_new2(0));
|
||||
}
|
||||
return Qnil;
|
||||
}
|
||||
|
|
|
|||
2
error.c
2
error.c
|
|
@ -663,8 +663,8 @@ rb_sys_fail(mesg)
|
|||
else {
|
||||
ee = syserr_list[n];
|
||||
}
|
||||
ee = rb_exc_new2(ee, buf);
|
||||
#endif
|
||||
ee = rb_exc_new2(ee, buf);
|
||||
rb_iv_set(ee, "errno", INT2FIX(n));
|
||||
rb_exc_raise(ee);
|
||||
}
|
||||
|
|
|
|||
9
eval.c
9
eval.c
|
|
@ -393,11 +393,13 @@ rb_attr(klass, id, read, write, ex)
|
|||
attriv = rb_intern(buf);
|
||||
if (read) {
|
||||
rb_add_method(klass, id, NEW_IVAR(attriv), noex);
|
||||
rb_funcall(klass, rb_intern("method_added"), 1, INT2FIX(id));
|
||||
}
|
||||
sprintf(buf, "%s=", name);
|
||||
id = rb_intern(buf);
|
||||
if (write) {
|
||||
rb_add_method(klass, id, NEW_ATTRSET(attriv), noex);
|
||||
rb_funcall(klass, rb_intern("method_added"), 1, INT2FIX(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5072,6 +5074,7 @@ rb_mod_modfunc(argc, argv, module)
|
|||
}
|
||||
rb_clear_cache_by_id(id);
|
||||
rb_add_method(rb_singleton_class(module), id, body->nd_body, NOEX_PUBLIC);
|
||||
rb_funcall(module, rb_intern("singleton_method_added"), 1, INT2FIX(id));
|
||||
}
|
||||
return module;
|
||||
}
|
||||
|
|
@ -6253,6 +6256,10 @@ thread_free(th)
|
|||
if (th->stk_ptr) free(th->stk_ptr);
|
||||
th->stk_ptr = 0;
|
||||
if (th->locals) st_free_table(th->locals);
|
||||
if (th->status != THREAD_KILLED) {
|
||||
th->prev->next = th->next;
|
||||
th->next->prev = th->prev;
|
||||
}
|
||||
if (th != main_thread) free(th);
|
||||
}
|
||||
|
||||
|
|
@ -7605,7 +7612,7 @@ static VALUE
|
|||
catch_i(tag)
|
||||
ID tag;
|
||||
{
|
||||
return rb_funcall(Qnil, rb_intern("catch"), 0, INT2FIX(tag));
|
||||
return rb_funcall(Qnil, rb_intern("catch"), 1, INT2FIX(tag));
|
||||
}
|
||||
|
||||
VALUE
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ fdbm_invert(obj)
|
|||
valstr = rb_tainted_str_new(val.dptr, val.dsize);
|
||||
rb_hash_aset(hash, valstr, keystr);
|
||||
}
|
||||
return obj;
|
||||
return hash;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
|
|||
|
|
@ -329,8 +329,8 @@ def create_makefile(target)
|
|||
|
||||
$DLDFLAGS = '@DLDFLAGS@'
|
||||
|
||||
if RUBY_PLATFORM =~ /beos/
|
||||
$libs = $libs + " -lruby"
|
||||
if RUBY_PLATFORM =~ /beos/ and not $static
|
||||
$libs = $libs + " @LIBRUBYARG@"
|
||||
$DLDFLAGS = $DLDFLAGS + " -L" + $topdir
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ fgdbm_invert(obj)
|
|||
valstr = rb_tainted_str_new(val.dptr, val.dsize);
|
||||
rb_hash_aset(hash, valstr, keystr);
|
||||
}
|
||||
return obj;
|
||||
return hash;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
|
|||
|
|
@ -427,6 +427,98 @@ class TkText<TkTextWin
|
|||
def rsearch(pat,start,stop=None)
|
||||
rsearch_with_length(pat,start,stop)[0]
|
||||
end
|
||||
|
||||
def _dump(type, *index)
|
||||
str = tk_send('dump', type, *index)
|
||||
result = []
|
||||
sel = nil
|
||||
i = 0
|
||||
while i < str.size
|
||||
# retrieve key
|
||||
idx = str.index(/ /, i)
|
||||
result.push str[i..(idx-1)]
|
||||
i = idx + 1
|
||||
|
||||
# retrieve value
|
||||
case result[-1]
|
||||
when 'text'
|
||||
if str[i] == ?{
|
||||
# text formed as {...}
|
||||
val, i = _retrieve_braced_text(str, i)
|
||||
result.push val
|
||||
else
|
||||
# text which may contain backslahes
|
||||
val, i = _retrieve_backslashed_text(str, i)
|
||||
result.push val
|
||||
end
|
||||
else
|
||||
idx = str.index(/ /, i)
|
||||
val = str[i..(idx-1)]
|
||||
case result[-1]
|
||||
when 'mark'
|
||||
case val
|
||||
when 'insert'
|
||||
result.push TkTextMarkInsert.new(self)
|
||||
when 'current'
|
||||
result.push TkTextMarkCurrent.new(self)
|
||||
when 'anchor'
|
||||
result.push TkTextMarkAnchor.new(self)
|
||||
else
|
||||
result.push tk_tcl2rb(val)
|
||||
end
|
||||
when 'tagon'
|
||||
if val == 'sel'
|
||||
if sel
|
||||
result.push sel
|
||||
else
|
||||
result.push TkTextTagSel.new(self)
|
||||
end
|
||||
else
|
||||
result.push tk_tcl2rb val
|
||||
end
|
||||
when 'tagoff'
|
||||
result.push tk_tcl2rb sel
|
||||
when 'window'
|
||||
result.push tk_tcl2rb val
|
||||
end
|
||||
i = idx + 1
|
||||
end
|
||||
|
||||
# retrieve index
|
||||
idx = str.index(/ /, i)
|
||||
if idx
|
||||
result.push str[i..(idx-1)]
|
||||
i = idx + 1
|
||||
else
|
||||
result.push str[i..-1]
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
kvis = []
|
||||
until result.empty?
|
||||
kvis.push [result.shift, result.shift, result.shift]
|
||||
end
|
||||
kvis # result is [[key1, value1, index1], [key2, value2, index2], ...]
|
||||
end
|
||||
private :_dump
|
||||
|
||||
def dump_all(*index)
|
||||
_dump('-all', *index)
|
||||
end
|
||||
def dump_mark(*index)
|
||||
_dump('-mark', *index)
|
||||
end
|
||||
def dump_tag(*index)
|
||||
_dump('-tag', *index)
|
||||
end
|
||||
def dump_text(*index)
|
||||
_dump('-text', *index)
|
||||
end
|
||||
def dump_window(*index)
|
||||
_dump('-window', *index)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class TkTextTag<TkObject
|
||||
|
|
@ -739,81 +831,6 @@ class TkTextWindow<TkObject
|
|||
end
|
||||
end
|
||||
|
||||
def _dump(type, *index)
|
||||
str = tk_send('dump', type, *index)
|
||||
result = []
|
||||
sel = nil
|
||||
i = 0
|
||||
while i < str.size
|
||||
# retrieve key
|
||||
idx = str.index(/ /, i)
|
||||
result.push str[i..(idx-1)]
|
||||
i = idx + 1
|
||||
|
||||
# retrieve value
|
||||
case result[-1]
|
||||
when 'text'
|
||||
if str[i] == ?{
|
||||
# text formed as {...}
|
||||
val, i = _retrieve_braced_text(str, i)
|
||||
result.push val
|
||||
else
|
||||
# text which may contain backslahes
|
||||
val, i = _retrieve_backslashed_text(str, i)
|
||||
result.push val
|
||||
end
|
||||
else
|
||||
idx = str.index(/ /, i)
|
||||
val = str[i..(idx-1)]
|
||||
case result[-1]
|
||||
when 'mark'
|
||||
case val
|
||||
when 'insert'
|
||||
result.push TkTextMarkInsert.new(self)
|
||||
when 'current'
|
||||
result.push TkTextMarkCurrent.new(self)
|
||||
when 'anchor'
|
||||
result.push TkTextMarkAnchor.new(self)
|
||||
else
|
||||
result.push tk_tcl2rb(val)
|
||||
end
|
||||
when 'tagon'
|
||||
if val == 'sel'
|
||||
if sel
|
||||
result.push sel
|
||||
else
|
||||
result.push TkTextTagSel.new(self)
|
||||
end
|
||||
else
|
||||
result.push tk_tcl2rb val
|
||||
end
|
||||
when 'tagoff'
|
||||
result.push tk_tcl2rb sel
|
||||
when 'window'
|
||||
result.push tk_tcl2rb val
|
||||
end
|
||||
i = idx + 1
|
||||
end
|
||||
|
||||
# retrieve index
|
||||
idx = str.index(/ /, i)
|
||||
if idx
|
||||
result.push str[i..(idx-1)]
|
||||
i = idx + 1
|
||||
else
|
||||
result.push str[i..-1]
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
kvis = []
|
||||
until result.empty?
|
||||
kvis.push [result.shift, result.shift, result.shift]
|
||||
end
|
||||
kvis # result is [[key1, value1, index1], [key2, value2, index2], ...]
|
||||
end
|
||||
private :_dump
|
||||
|
||||
def _retrieve_braced_text(str, i)
|
||||
cnt = 0
|
||||
idx = i
|
||||
|
|
@ -850,21 +867,6 @@ class TkTextWindow<TkObject
|
|||
end
|
||||
private :_retrieve_backslashed_text
|
||||
|
||||
def dump_all(*index)
|
||||
_dump('-all', *index)
|
||||
end
|
||||
def dump_mark(*index)
|
||||
_dump('-mark', *index)
|
||||
end
|
||||
def dump_tag(*index)
|
||||
_dump('-tag', *index)
|
||||
end
|
||||
def dump_text(*index)
|
||||
_dump('-text', *index)
|
||||
end
|
||||
def dump_window(*index)
|
||||
_dump('-window', *index)
|
||||
end
|
||||
end
|
||||
|
||||
class TkTextImage<TkObject
|
||||
|
|
|
|||
4
gc.c
4
gc.c
|
|
@ -1134,8 +1134,10 @@ rb_gc_call_finalizer_at_exit()
|
|||
for (i = 0; i < heaps_used; i++) {
|
||||
p = heaps[i]; pend = p + HEAP_SLOTS;
|
||||
while (p < pend) {
|
||||
if (FL_TEST(p, FL_FINALIZE))
|
||||
if (FL_TEST(p, FL_FINALIZE)) {
|
||||
p->as.free.flag = 0;
|
||||
run_final((VALUE)p);
|
||||
}
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
io.c
4
io.c
|
|
@ -1857,7 +1857,7 @@ rb_io_printf(argc, argv, out)
|
|||
VALUE argv[];
|
||||
VALUE out;
|
||||
{
|
||||
io_write(out, rb_f_sprintf(argc, argv));
|
||||
rb_io_write(out, rb_f_sprintf(argc, argv));
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
|
@ -1877,7 +1877,7 @@ rb_f_printf(argc, argv)
|
|||
argv++;
|
||||
argc--;
|
||||
}
|
||||
io_write(out, rb_f_sprintf(argc, argv));
|
||||
rb_io_write(out, rb_f_sprintf(argc, argv));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# ftplib.rb
|
||||
#
|
||||
|
||||
$stderr.puts 'Warning: ftplib.rb is obsolute: use net/ftp'
|
||||
$stderr.puts 'Warning: ftplib.rb is obsolete: use net/ftp'
|
||||
|
||||
require 'net/ftp'
|
||||
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ def create_makefile(target)
|
|||
$DLDFLAGS = CONFIG["DLDFLAGS"]
|
||||
|
||||
if RUBY_PLATFORM =~ /beos/
|
||||
$libs = $libs + " -lruby"
|
||||
$libs = $libs + " " + CONFIG["LIBRUBYARG"]
|
||||
$DLDFLAGS = $DLDFLAGS + " -L" + CONFIG["prefix"] + "/lib"
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,43 +2,46 @@
|
|||
# original is shellwords.pl
|
||||
#
|
||||
# Usage:
|
||||
# require 'shellwords.rb'
|
||||
# require 'shellwords'
|
||||
# words = Shellwords.shellwords(line)
|
||||
#
|
||||
# or
|
||||
#
|
||||
# require 'shellwords'
|
||||
# include Shellwords
|
||||
# words = shellwords(line)
|
||||
|
||||
module Shellwords
|
||||
def shellwords(line)
|
||||
return '' unless line
|
||||
line.sub! /^\s+/, ''
|
||||
unless line.kind_of?(String)
|
||||
raise ArgumentError, "Argument must be String class object."
|
||||
end
|
||||
line.sub!(/^\s+/, '')
|
||||
words = []
|
||||
while line != ''
|
||||
field = ''
|
||||
while true
|
||||
if line.sub! /^"(([^"\\]|\\.)*)"/, '' then #"
|
||||
if line.sub!(/^"(([^"\\]|\\.)*)"/, '') then #"
|
||||
snippet = $1
|
||||
snippet.gsub! /\\(.)/, '\1'
|
||||
snippet.gsub!(/\\(.)/, '\1')
|
||||
elsif line =~ /^"/ then #"
|
||||
raise ArgError, "Unmatched double quote: #{line}"
|
||||
elsif line.sub! /^'(([^'\\]|\\.)*)'/, '' then #'
|
||||
raise ArgumentError, "Unmatched double quote: #{line}"
|
||||
elsif line.sub!(/^'(([^'\\]|\\.)*)'/, '') then #'
|
||||
snippet = $1
|
||||
snippet.gsub! /\\(.)/, '\1'
|
||||
snippet.gsub!(/\\(.)/, '\1')
|
||||
elsif line =~ /^'/ then #'
|
||||
raise ArgError, "Unmatched single quote: #{line}"
|
||||
elsif line.sub! /^\\(.)/, '' then
|
||||
raise ArgumentError, "Unmatched single quote: #{line}"
|
||||
elsif line.sub!(/^\\(.)/, '') then
|
||||
snippet = $1
|
||||
elsif line.sub! /^([^\s\\'"]+)/, '' then #'
|
||||
elsif line.sub!(/^([^\s\\'"]+)/, '') then #'
|
||||
snippet = $1
|
||||
else
|
||||
line.sub! /^\s+/, ''
|
||||
line.sub!(/^\s+/, '')
|
||||
break
|
||||
end
|
||||
field += snippet
|
||||
field.concat(snippet)
|
||||
end
|
||||
words += field
|
||||
words.push(field)
|
||||
end
|
||||
words
|
||||
end
|
||||
|
|
|
|||
1
ruby.h
1
ruby.h
|
|
@ -192,6 +192,7 @@ int rb_fix2int _((VALUE));
|
|||
#define FIX2INT(x) FIX2LONG(x)
|
||||
#define FIX2UINT(x) FIX2ULONG(x)
|
||||
#endif
|
||||
#define ID2SYM(x) INT2FIX(x)
|
||||
#define SYM2ID(x) FIX2INT(x)
|
||||
|
||||
double rb_num2dbl _((VALUE));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#define RUBY_VERSION "1.4.4"
|
||||
#define RUBY_RELEASE_DATE "2000-03-24"
|
||||
#define RUBY_RELEASE_DATE "2000-04-10"
|
||||
#define RUBY_VERSION_CODE 144
|
||||
#define RUBY_RELEASE_CODE 20000324
|
||||
#define RUBY_RELEASE_CODE 20000410
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue