1
0
Fork 0
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:
matz 2003-10-15 02:27:56 +00:00
parent 0c25b62505
commit 87025fdd43
8 changed files with 41 additions and 14 deletions

View file

@ -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>
* 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
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>
* ext/tcltklib/tcltklib.c: replace Tcl/Tk's vwait and tkwait to

2
eval.c
View file

@ -1332,7 +1332,7 @@ ruby_finalize_0(ex)
void
ruby_finalize()
{
ruby_finalize_0(0);
ruby_finalize_0(EXIT_SUCCESS);
}
int

View file

@ -319,7 +319,7 @@ end
$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
else
if try_link(<<EOF)

View file

@ -872,6 +872,7 @@ class CGI
raw_cookie.split(/; /).each do |pairs|
name, values = pairs.split('=',2)
next unless name and value
name = CGI::unescape(name)
values ||= ""
values = values.split('&').collect{|v| CGI::unescape(v) }

View file

@ -58,7 +58,7 @@ module IRB
case input_method
when nil
if (defined? (ReadlineInputMethod) &&
if (defined?(ReadlineInputMethod) &&
(use_readline? || IRB.conf[:PROMPT_MODE] != :INF_RUBY && STDIN.tty?))
@io = ReadlineInputMethod.new
else

View file

@ -394,7 +394,7 @@ def install_files(mfile, ifiles, map = nil, srcprefix = nil)
path = Hash.new {|h, i| h[i] = dirs.push([i])[-1]}
ifiles.each do |files, dir, prefix|
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] == "./" )
# install files which are in current working directory.
files = files[2..-1]

View file

@ -483,8 +483,7 @@ w_object(obj, arg, limit)
VALUE v;
v = rb_funcall(obj, s_mdump, 0, 0);
w_byte(TYPE_USRMARSHAL, arg);
w_unique(rb_class2name(CLASS_OF(obj)), arg);
w_class(TYPE_USRMARSHAL, obj, arg);
w_object(v, arg, limit);
if (ivtbl) w_ivar(0, &c_arg);
return;
@ -953,10 +952,11 @@ path2module(path)
}
static VALUE
r_object0(arg, proc, ivp)
r_object0(arg, proc, ivp, extended)
struct load_arg *arg;
VALUE proc;
int *ivp;
VALUE extended;
{
VALUE v = Qnil;
int type = r_byte(arg);
@ -975,7 +975,7 @@ r_object0(arg, proc, ivp)
{
int ivar = Qtrue;
v = r_object0(arg, 0, &ivar);
v = r_object0(arg, 0, &ivar, extended);
if (ivar) r_ivar(v, arg);
}
break;
@ -984,8 +984,14 @@ r_object0(arg, proc, ivp)
{
VALUE m = path2module(r_unique(arg));
v = r_object0(arg, 0, 0);
rb_extend_object(v, m);
if (NIL_P(extended)) extended = rb_ary_new2(0);
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;
@ -996,7 +1002,7 @@ r_object0(arg, proc, ivp)
if (FL_TEST(c, FL_SINGLETON)) {
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) {
format_error:
rb_raise(rb_eArgError, "dump format error (user class)");
@ -1200,6 +1206,12 @@ r_object0(arg, proc, ivp)
VALUE data;
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)) {
rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'",
rb_class2name(klass));
@ -1246,7 +1258,7 @@ r_object0(arg, proc, ivp)
"class %s needs to have instance method `_load_data'",
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;
@ -1298,7 +1310,7 @@ static VALUE
r_object(arg)
struct load_arg *arg;
{
return r_object0(arg, arg->proc, 0);
return r_object0(arg, arg->proc, 0, Qnil);
}
static VALUE

View file

@ -4029,7 +4029,8 @@ yylex()
c = tLPAREN_ARG;
}
else if (lex_state == EXPR_ARG) {
c = tLPAREN_ARG;
rb_warn("don't put space before argument parentheses");
c = '(';
}
}
COND_PUSH(0);