1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-09-19 07:54:28 +00:00
parent 053140491c
commit f1bb1f5848
7 changed files with 29 additions and 13 deletions

View file

@ -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.
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>
* configure.in: include version number in RUBY_SO_NAME.
* configure.in, win32/setup.mak: include version number
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>
* eval.c (rb_provide): better feature handling.

View file

@ -4,6 +4,11 @@ $vsave, $VERBOSE = $VERBOSE, false
class String
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_EUC = '[\xa1-\xfe][\xa1-\xfe]'
PATTERN_UTF8 = '[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]'
@ -118,7 +123,7 @@ class String
def tr!(from, to)
return self.delete!(from) if to.length == 0
pattern = TrPatternCache[from] ||= /[#{Regexp::quote(from)}]/
pattern = TrPatternCache[from] ||= /[#{_regex_quote(from)}]/
if from[0] == ?^
last = /.$/.match(to)[0]
self.gsub!(pattern, last)
@ -133,7 +138,7 @@ class String
end
def delete!(del)
self.gsub!(DeletePatternCache[del] ||= /[#{Regexp::quote(del)}]+/, '')
self.gsub!(DeletePatternCache[del] ||= /[#{_regex_quote(del)}]+/, '')
end
def delete(del)
@ -143,7 +148,7 @@ class String
def squeeze!(del=nil)
pattern =
if del
SqueezePatternCache[del] ||= /([#{Regexp::quote(del)}])\1+/
SqueezePatternCache[del] ||= /([#{_regex_quote(del)}])\1+/
else
/(.|\n)\1+/
end
@ -157,7 +162,7 @@ class String
def tr_s!(from, to)
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] == ?^
last = /.$/.match(to)[0]
self.gsub!(pattern, last)

View file

@ -12,7 +12,6 @@
# p db["root"]
# end
require "marshal"
require "ftools"
class PStore

View file

@ -996,6 +996,4 @@ Init_marshal()
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, "restore", marshal_load, -1);
rb_provide("marshal.so"); /* for backward compatibility */
}

View file

@ -3398,8 +3398,6 @@ yylex()
newtok();
c = nextc();
switch (c) {
case '~': /* $~: match-data */
/* fall through */
case '_': /* $_: last read line string */
c = nextc();
if (is_identchar(c)) {
@ -3409,7 +3407,9 @@ yylex()
}
pushback(c);
c = '_';
local_cnt('_');
/* fall through */
case '~': /* $~: match-data */
local_cnt(c);
/* fall through */
case '*': /* $*: argv */
case '$': /* $$: pid */

View file

@ -1,4 +1,3 @@
require "marshal"
include Marshal
a = 25.6;
pt = Struct.new('Point', :x,:y);

View file

@ -205,7 +205,7 @@ rb_f_kill(argc, argv)
rb_raise(rb_eArgError, "wrong # of arguments -- kill(sig, pid...)");
switch (TYPE(argv[0])) {
case T_FIXNUM:
sig = FIX2UINT(argv[0]);
sig = FIX2INT(argv[0]);
break;
case T_SYMBOL: