зеркало из https://github.com/github/ruby.git
000919
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
053140491c
Коммит
f1bb1f5848
17
ChangeLog
17
ChangeLog
|
@ -1,12 +1,27 @@
|
||||||
Mon Sep 18 17:46:11 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Sep 19 16:53:06 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* stable version 1.6.0 released.
|
* stable version 1.6.0 released.
|
||||||
|
|
||||||
|
Tue Sep 19 16:24:52 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* marshal.c (Init_marshal): provide marshal.so no more.
|
||||||
|
|
||||||
Tue Sep 19 14:01:01 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
|
Tue Sep 19 14:01:01 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
|
||||||
|
|
||||||
|
* configure.in: include version number in RUBY_SO_NAME.
|
||||||
|
|
||||||
* configure.in, win32/setup.mak: include version number
|
* configure.in, win32/setup.mak: include version number
|
||||||
in RUBY_SO_NAME.
|
in RUBY_SO_NAME.
|
||||||
|
|
||||||
|
Tue Sep 19 13:07:47 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (yylex): was confusing $~ and $_.
|
||||||
|
|
||||||
|
Tue Sep 19 13:06:53 2000 GOTOU YUUZOU <gotoyuzo@notwork.org>
|
||||||
|
|
||||||
|
* signal.c (rb_f_kill): signum may be a negative number, should be
|
||||||
|
treated by signed number.
|
||||||
|
|
||||||
Tue Sep 19 01:14:56 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Sep 19 01:14:56 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (rb_provide): better feature handling.
|
* eval.c (rb_provide): better feature handling.
|
||||||
|
|
13
lib/jcode.rb
13
lib/jcode.rb
|
@ -4,6 +4,11 @@ $vsave, $VERBOSE = $VERBOSE, false
|
||||||
class String
|
class String
|
||||||
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
|
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
|
||||||
|
|
||||||
|
def _regex_quote(str)
|
||||||
|
a = str.gsub(/\W/){|s| if s == "-" then s else "\\\\#{s}" end}
|
||||||
|
end
|
||||||
|
private :_regex_quote
|
||||||
|
|
||||||
PATTERN_SJIS = '[\x81-\x9f\xe0-\xef][\x40-\x7e\x80-\xfc]'
|
PATTERN_SJIS = '[\x81-\x9f\xe0-\xef][\x40-\x7e\x80-\xfc]'
|
||||||
PATTERN_EUC = '[\xa1-\xfe][\xa1-\xfe]'
|
PATTERN_EUC = '[\xa1-\xfe][\xa1-\xfe]'
|
||||||
PATTERN_UTF8 = '[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]'
|
PATTERN_UTF8 = '[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]'
|
||||||
|
@ -118,7 +123,7 @@ class String
|
||||||
def tr!(from, to)
|
def tr!(from, to)
|
||||||
return self.delete!(from) if to.length == 0
|
return self.delete!(from) if to.length == 0
|
||||||
|
|
||||||
pattern = TrPatternCache[from] ||= /[#{Regexp::quote(from)}]/
|
pattern = TrPatternCache[from] ||= /[#{_regex_quote(from)}]/
|
||||||
if from[0] == ?^
|
if from[0] == ?^
|
||||||
last = /.$/.match(to)[0]
|
last = /.$/.match(to)[0]
|
||||||
self.gsub!(pattern, last)
|
self.gsub!(pattern, last)
|
||||||
|
@ -133,7 +138,7 @@ class String
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete!(del)
|
def delete!(del)
|
||||||
self.gsub!(DeletePatternCache[del] ||= /[#{Regexp::quote(del)}]+/, '')
|
self.gsub!(DeletePatternCache[del] ||= /[#{_regex_quote(del)}]+/, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete(del)
|
def delete(del)
|
||||||
|
@ -143,7 +148,7 @@ class String
|
||||||
def squeeze!(del=nil)
|
def squeeze!(del=nil)
|
||||||
pattern =
|
pattern =
|
||||||
if del
|
if del
|
||||||
SqueezePatternCache[del] ||= /([#{Regexp::quote(del)}])\1+/
|
SqueezePatternCache[del] ||= /([#{_regex_quote(del)}])\1+/
|
||||||
else
|
else
|
||||||
/(.|\n)\1+/
|
/(.|\n)\1+/
|
||||||
end
|
end
|
||||||
|
@ -157,7 +162,7 @@ class String
|
||||||
def tr_s!(from, to)
|
def tr_s!(from, to)
|
||||||
return self.delete!(from) if to.length == 0
|
return self.delete!(from) if to.length == 0
|
||||||
|
|
||||||
pattern = SqueezePatternCache[from] ||= /([#{Regexp::quote(from)}])\1+"/ #"
|
pattern = SqueezePatternCache[from] ||= /([#{_regex_quote(from)}])\1+"/
|
||||||
if from[0] == ?^
|
if from[0] == ?^
|
||||||
last = /.$/.match(to)[0]
|
last = /.$/.match(to)[0]
|
||||||
self.gsub!(pattern, last)
|
self.gsub!(pattern, last)
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
# p db["root"]
|
# p db["root"]
|
||||||
# end
|
# end
|
||||||
|
|
||||||
require "marshal"
|
|
||||||
require "ftools"
|
require "ftools"
|
||||||
|
|
||||||
class PStore
|
class PStore
|
||||||
|
|
|
@ -996,6 +996,4 @@ Init_marshal()
|
||||||
rb_define_module_function(rb_mMarshal, "dump", marshal_dump, -1);
|
rb_define_module_function(rb_mMarshal, "dump", marshal_dump, -1);
|
||||||
rb_define_module_function(rb_mMarshal, "load", marshal_load, -1);
|
rb_define_module_function(rb_mMarshal, "load", marshal_load, -1);
|
||||||
rb_define_module_function(rb_mMarshal, "restore", marshal_load, -1);
|
rb_define_module_function(rb_mMarshal, "restore", marshal_load, -1);
|
||||||
|
|
||||||
rb_provide("marshal.so"); /* for backward compatibility */
|
|
||||||
}
|
}
|
||||||
|
|
6
parse.y
6
parse.y
|
@ -3398,8 +3398,6 @@ yylex()
|
||||||
newtok();
|
newtok();
|
||||||
c = nextc();
|
c = nextc();
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '~': /* $~: match-data */
|
|
||||||
/* fall through */
|
|
||||||
case '_': /* $_: last read line string */
|
case '_': /* $_: last read line string */
|
||||||
c = nextc();
|
c = nextc();
|
||||||
if (is_identchar(c)) {
|
if (is_identchar(c)) {
|
||||||
|
@ -3409,7 +3407,9 @@ yylex()
|
||||||
}
|
}
|
||||||
pushback(c);
|
pushback(c);
|
||||||
c = '_';
|
c = '_';
|
||||||
local_cnt('_');
|
/* fall through */
|
||||||
|
case '~': /* $~: match-data */
|
||||||
|
local_cnt(c);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case '*': /* $*: argv */
|
case '*': /* $*: argv */
|
||||||
case '$': /* $$: pid */
|
case '$': /* $$: pid */
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require "marshal"
|
|
||||||
include Marshal
|
include Marshal
|
||||||
a = 25.6;
|
a = 25.6;
|
||||||
pt = Struct.new('Point', :x,:y);
|
pt = Struct.new('Point', :x,:y);
|
||||||
|
|
2
signal.c
2
signal.c
|
@ -205,7 +205,7 @@ rb_f_kill(argc, argv)
|
||||||
rb_raise(rb_eArgError, "wrong # of arguments -- kill(sig, pid...)");
|
rb_raise(rb_eArgError, "wrong # of arguments -- kill(sig, pid...)");
|
||||||
switch (TYPE(argv[0])) {
|
switch (TYPE(argv[0])) {
|
||||||
case T_FIXNUM:
|
case T_FIXNUM:
|
||||||
sig = FIX2UINT(argv[0]);
|
sig = FIX2INT(argv[0]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_SYMBOL:
|
case T_SYMBOL:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче