mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* marshal.c (w_object): dump extended modules as well.
* marshal.c (r_object0): TYPE_USRMARSHAL should restore extended modules before invoking marshal_load. these two fixes are done by Masatoshi Seki <m_seki@mva.biglobe.ne.jp>. * parse.y (yylex): argument parentheses preceded by spaces should be warned; not error. [ruby-talk:84103] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0c25b62505
commit
87025fdd43
8 changed files with 41 additions and 14 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,11 @@
|
||||||
|
Wed Oct 15 11:23:05 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* marshal.c (w_object): dump extended modules as well.
|
||||||
|
|
||||||
|
* marshal.c (r_object0): TYPE_USRMARSHAL should restore extended
|
||||||
|
modules before invoking marshal_load. these two fixes are done
|
||||||
|
by Masatoshi Seki <m_seki@mva.biglobe.ne.jp>.
|
||||||
|
|
||||||
Wed Oct 15 09:30:34 2003 NAKAMURA Usaku <usa@ruby-lang.org>
|
Wed Oct 15 09:30:34 2003 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* ext/enumerator/enumerator.c (enumerator_each): avoid VC++ warning.
|
* ext/enumerator/enumerator.c (enumerator_each): avoid VC++ warning.
|
||||||
|
@ -45,6 +53,11 @@ Wed Oct 15 03:53:20 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
* ext/tk/lib/tk.rb: fixed trouble on auto-load Tcl commands (enbug
|
* ext/tk/lib/tk.rb: fixed trouble on auto-load Tcl commands (enbug
|
||||||
on the last commit).
|
on the last commit).
|
||||||
|
|
||||||
|
Wed Oct 15 00:25:00 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (yylex): argument parentheses preceded by spaces should
|
||||||
|
be warned; not error. [ruby-talk:84103]
|
||||||
|
|
||||||
Wed Oct 15 00:20:15 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Wed Oct 15 00:20:15 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tcltklib/tcltklib.c: replace Tcl/Tk's vwait and tkwait to
|
* ext/tcltklib/tcltklib.c: replace Tcl/Tk's vwait and tkwait to
|
||||||
|
|
2
eval.c
2
eval.c
|
@ -1332,7 +1332,7 @@ ruby_finalize_0(ex)
|
||||||
void
|
void
|
||||||
ruby_finalize()
|
ruby_finalize()
|
||||||
{
|
{
|
||||||
ruby_finalize_0(0);
|
ruby_finalize_0(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -319,7 +319,7 @@ end
|
||||||
|
|
||||||
$objs = ["socket.#{$OBJEXT}"]
|
$objs = ["socket.#{$OBJEXT}"]
|
||||||
|
|
||||||
if $getaddr_info_ok and have_func("getaddrinfo") and have_func("getnameinfo")
|
if $getaddr_info_ok and have_func("getaddrinfo", "netdb.h") and have_func("getnameinfo", "netdb.h")
|
||||||
have_getaddrinfo = true
|
have_getaddrinfo = true
|
||||||
else
|
else
|
||||||
if try_link(<<EOF)
|
if try_link(<<EOF)
|
||||||
|
|
|
@ -872,6 +872,7 @@ class CGI
|
||||||
|
|
||||||
raw_cookie.split(/; /).each do |pairs|
|
raw_cookie.split(/; /).each do |pairs|
|
||||||
name, values = pairs.split('=',2)
|
name, values = pairs.split('=',2)
|
||||||
|
next unless name and value
|
||||||
name = CGI::unescape(name)
|
name = CGI::unescape(name)
|
||||||
values ||= ""
|
values ||= ""
|
||||||
values = values.split('&').collect{|v| CGI::unescape(v) }
|
values = values.split('&').collect{|v| CGI::unescape(v) }
|
||||||
|
|
|
@ -58,7 +58,7 @@ module IRB
|
||||||
|
|
||||||
case input_method
|
case input_method
|
||||||
when nil
|
when nil
|
||||||
if (defined? (ReadlineInputMethod) &&
|
if (defined?(ReadlineInputMethod) &&
|
||||||
(use_readline? || IRB.conf[:PROMPT_MODE] != :INF_RUBY && STDIN.tty?))
|
(use_readline? || IRB.conf[:PROMPT_MODE] != :INF_RUBY && STDIN.tty?))
|
||||||
@io = ReadlineInputMethod.new
|
@io = ReadlineInputMethod.new
|
||||||
else
|
else
|
||||||
|
|
|
@ -394,7 +394,7 @@ def install_files(mfile, ifiles, map = nil, srcprefix = nil)
|
||||||
path = Hash.new {|h, i| h[i] = dirs.push([i])[-1]}
|
path = Hash.new {|h, i| h[i] = dirs.push([i])[-1]}
|
||||||
ifiles.each do |files, dir, prefix|
|
ifiles.each do |files, dir, prefix|
|
||||||
dir = map_dir(dir, map)
|
dir = map_dir(dir, map)
|
||||||
prefix = %r"\A#{Regexp.quote(prefix)}/?" if prefix
|
prefix = %r|\A#{Regexp.quote(prefix)}/?| if prefix
|
||||||
if( files[0,2] == "./" )
|
if( files[0,2] == "./" )
|
||||||
# install files which are in current working directory.
|
# install files which are in current working directory.
|
||||||
files = files[2..-1]
|
files = files[2..-1]
|
||||||
|
|
30
marshal.c
30
marshal.c
|
@ -483,8 +483,7 @@ w_object(obj, arg, limit)
|
||||||
VALUE v;
|
VALUE v;
|
||||||
|
|
||||||
v = rb_funcall(obj, s_mdump, 0, 0);
|
v = rb_funcall(obj, s_mdump, 0, 0);
|
||||||
w_byte(TYPE_USRMARSHAL, arg);
|
w_class(TYPE_USRMARSHAL, obj, arg);
|
||||||
w_unique(rb_class2name(CLASS_OF(obj)), arg);
|
|
||||||
w_object(v, arg, limit);
|
w_object(v, arg, limit);
|
||||||
if (ivtbl) w_ivar(0, &c_arg);
|
if (ivtbl) w_ivar(0, &c_arg);
|
||||||
return;
|
return;
|
||||||
|
@ -953,10 +952,11 @@ path2module(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
r_object0(arg, proc, ivp)
|
r_object0(arg, proc, ivp, extended)
|
||||||
struct load_arg *arg;
|
struct load_arg *arg;
|
||||||
VALUE proc;
|
VALUE proc;
|
||||||
int *ivp;
|
int *ivp;
|
||||||
|
VALUE extended;
|
||||||
{
|
{
|
||||||
VALUE v = Qnil;
|
VALUE v = Qnil;
|
||||||
int type = r_byte(arg);
|
int type = r_byte(arg);
|
||||||
|
@ -975,7 +975,7 @@ r_object0(arg, proc, ivp)
|
||||||
{
|
{
|
||||||
int ivar = Qtrue;
|
int ivar = Qtrue;
|
||||||
|
|
||||||
v = r_object0(arg, 0, &ivar);
|
v = r_object0(arg, 0, &ivar, extended);
|
||||||
if (ivar) r_ivar(v, arg);
|
if (ivar) r_ivar(v, arg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -984,8 +984,14 @@ r_object0(arg, proc, ivp)
|
||||||
{
|
{
|
||||||
VALUE m = path2module(r_unique(arg));
|
VALUE m = path2module(r_unique(arg));
|
||||||
|
|
||||||
v = r_object0(arg, 0, 0);
|
if (NIL_P(extended)) extended = rb_ary_new2(0);
|
||||||
rb_extend_object(v, m);
|
rb_ary_push(extended, m);
|
||||||
|
|
||||||
|
v = r_object0(arg, 0, 0, extended);
|
||||||
|
while (RARRAY(extended)->len > 0) {
|
||||||
|
m = rb_ary_pop(extended);
|
||||||
|
rb_extend_object(v, m);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -996,7 +1002,7 @@ r_object0(arg, proc, ivp)
|
||||||
if (FL_TEST(c, FL_SINGLETON)) {
|
if (FL_TEST(c, FL_SINGLETON)) {
|
||||||
rb_raise(rb_eTypeError, "singleton can't be loaded");
|
rb_raise(rb_eTypeError, "singleton can't be loaded");
|
||||||
}
|
}
|
||||||
v = r_object0(arg, 0, 0);
|
v = r_object0(arg, 0, 0, extended);
|
||||||
if (rb_special_const_p(v) || TYPE(v) == T_OBJECT || TYPE(v) == T_CLASS) {
|
if (rb_special_const_p(v) || TYPE(v) == T_OBJECT || TYPE(v) == T_CLASS) {
|
||||||
format_error:
|
format_error:
|
||||||
rb_raise(rb_eArgError, "dump format error (user class)");
|
rb_raise(rb_eArgError, "dump format error (user class)");
|
||||||
|
@ -1200,6 +1206,12 @@ r_object0(arg, proc, ivp)
|
||||||
VALUE data;
|
VALUE data;
|
||||||
|
|
||||||
v = rb_obj_alloc(klass);
|
v = rb_obj_alloc(klass);
|
||||||
|
if (! NIL_P(extended)) {
|
||||||
|
while (RARRAY(extended)->len > 0) {
|
||||||
|
VALUE m = rb_ary_pop(extended);
|
||||||
|
rb_extend_object(v, m);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!rb_respond_to(v, s_mload)) {
|
if (!rb_respond_to(v, s_mload)) {
|
||||||
rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'",
|
rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'",
|
||||||
rb_class2name(klass));
|
rb_class2name(klass));
|
||||||
|
@ -1246,7 +1258,7 @@ r_object0(arg, proc, ivp)
|
||||||
"class %s needs to have instance method `_load_data'",
|
"class %s needs to have instance method `_load_data'",
|
||||||
rb_class2name(klass));
|
rb_class2name(klass));
|
||||||
}
|
}
|
||||||
rb_funcall(v, s_load_data, 1, r_object0(arg, 0, 0));
|
rb_funcall(v, s_load_data, 1, r_object0(arg, 0, 0, extended));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1298,7 +1310,7 @@ static VALUE
|
||||||
r_object(arg)
|
r_object(arg)
|
||||||
struct load_arg *arg;
|
struct load_arg *arg;
|
||||||
{
|
{
|
||||||
return r_object0(arg, arg->proc, 0);
|
return r_object0(arg, arg->proc, 0, Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
3
parse.y
3
parse.y
|
@ -4029,7 +4029,8 @@ yylex()
|
||||||
c = tLPAREN_ARG;
|
c = tLPAREN_ARG;
|
||||||
}
|
}
|
||||||
else if (lex_state == EXPR_ARG) {
|
else if (lex_state == EXPR_ARG) {
|
||||||
c = tLPAREN_ARG;
|
rb_warn("don't put space before argument parentheses");
|
||||||
|
c = '(';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
COND_PUSH(0);
|
COND_PUSH(0);
|
||||||
|
|
Loading…
Reference in a new issue