diff options
-rw-r--r-- | ChangeLog | 29 | ||||
-rw-r--r-- | Makefile.in | 3 | ||||
-rw-r--r-- | ToDo | 2 | ||||
-rw-r--r-- | bignum.c | 3 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | dln.c | 2 | ||||
-rw-r--r-- | dln.h | 2 | ||||
-rw-r--r-- | env.h | 2 | ||||
-rw-r--r-- | eval.c | 62 | ||||
-rw-r--r-- | file.c | 2 | ||||
-rw-r--r-- | gc.c | 13 | ||||
-rw-r--r-- | hash.c | 2 | ||||
-rw-r--r-- | marshal.c | 6 | ||||
-rw-r--r-- | misc/ruby-mode.el | 11 | ||||
-rw-r--r-- | missing.h | 2 | ||||
-rw-r--r-- | node.h | 2 | ||||
-rw-r--r-- | numeric.c | 7 | ||||
-rw-r--r-- | object.c | 3 | ||||
-rw-r--r-- | pack.c | 2 | ||||
-rw-r--r-- | parse.y | 3 | ||||
-rw-r--r-- | process.c | 2 | ||||
-rw-r--r-- | range.c | 2 | ||||
-rw-r--r-- | re.c | 2 | ||||
-rw-r--r-- | re.h | 2 | ||||
-rw-r--r-- | ruby.c | 2 | ||||
-rw-r--r-- | ruby.h | 2 | ||||
-rw-r--r-- | rubyio.h | 2 | ||||
-rw-r--r-- | rubysig.h | 2 | ||||
-rw-r--r-- | sample/test.rb | 2 | ||||
-rw-r--r-- | signal.c | 2 | ||||
-rw-r--r-- | struct.c | 2 | ||||
-rw-r--r-- | util.c | 258 | ||||
-rw-r--r-- | util.h | 5 | ||||
-rw-r--r-- | variable.c | 2 |
34 files changed, 377 insertions, 70 deletions
@@ -4,10 +4,24 @@ Tue May 14 14:49:05 2002 WATANABE Hirofumi <[email protected]> * missing/strftime.c (timezone): it should take no argument on Cygwin. Mon May 13 14:38:33 2002 WATANABE Hirofumi <[email protected]> * djgpp/config.hin, djgpp/config.sed: catch up with the latest change. Sun May 12 03:01:08 2002 WATANABE Hirofumi <[email protected]> * missing.h: add for missing/*.c. @@ -26,6 +40,16 @@ Sat May 11 10:52:09 2002 Nobuyoshi Nakada <[email protected]> * dir.c (glob_helper): remove escaping backslashes. Fri May 10 19:00:47 2002 Nobuyoshi Nakada <[email protected]> * parse.y (here_document): preserve line number begins here @@ -38,6 +62,11 @@ Fri May 10 01:55:44 2002 Nobuyoshi Nakada <[email protected]> * eval.c (rb_thread_join_m): new. and added optional argument. Tue May 7 17:13:40 2002 WATANABE Hirofumi <[email protected]> * configure.in: forgot to add '-Wl,' to the gcc option on Cygwin/MinGW. @@ -223,9 +223,6 @@ strftime.@OBJEXT@: $(srcdir)/missing/strftime.c strstr.@OBJEXT@: $(srcdir)/missing/strstr.c $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strstr.c -strtod.@OBJEXT@: $(srcdir)/missing/strtod.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strtod.c - strtol.@OBJEXT@: $(srcdir)/missing/strtol.c $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strtol.c @@ -95,7 +95,7 @@ Standard Libraries * new user-defined marshal scheme. _dump(dumper), _load(restorer) * library to load per-user profile seeking .ruby_profile or ruby.ini file. * warning framework (warn, warning for Ruby level) -* marshal should not depend on sprintf/strtod (works bad with locale). * ternary arg pow: a.pow(b,c) == a**b%c * new caller(), e.g. call_stack; needs better name. * remove dependency on MAXPATHLEN. @@ -10,9 +10,10 @@ **********************************************************************/ #include <math.h> #include <ctype.h> -#include "ruby.h" VALUE rb_cBignum; @@ -987,7 +987,7 @@ if test "$enable_shared" = 'yes'; then darwin*) LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib' LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace' - LIBRUBY_DLDFLAGS='-install_name lib$(RUBY_INSTALL_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)' LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib' ;; *) @@ -6,7 +6,7 @@ $Date$ created at: Tue Jan 18 17:05:06 JST 1994 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Wed Jan 19 16:53:09 JST 1994 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Mon Jul 11 11:53:03 JST 1994 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -217,6 +217,21 @@ rb_clear_cache_by_id(id) } } void rb_add_method(klass, mid, node, noex) VALUE klass; @@ -2112,10 +2127,27 @@ avalue_to_svalue(v) } static VALUE svalue_to_mvalue(v) VALUE v; { - if (NIL_P(v)) return rb_ary_new2(0); if (TYPE(v) == T_ARRAY) { return v; } @@ -2511,10 +2543,10 @@ rb_eval(self, n) case NODE_YIELD: if (node->nd_stts) { - result = avalue_to_svalue(rb_eval(self, node->nd_stts)); } else { - result = Qnil; } result = rb_yield_0(result, 0, 0, 0); break; @@ -3745,21 +3777,21 @@ rb_yield_0(val, self, klass, pcall) RARRAY(val)->len); } } else { - if (nd_type(block->var) == NODE_MASGN) { - massign(self, block->var, val, pcall); - } - else { - if (pcall) val = avalue_to_svalue(val); - assign(self, block->var, val, pcall); } } } POP_TAG(); if (state) goto pop_state; } else if (pcall) { - val = avalue_to_svalue(val); } PUSH_ITER(block->iter); @@ -3849,7 +3881,7 @@ static VALUE rb_f_loop() { for (;;) { - rb_yield_0(Qnil, 0, 0, 0); CHECK_INTS; } return Qnil; /* dummy */ @@ -3912,7 +3944,10 @@ assign(self, lhs, val, pcall) VALUE val; int pcall; { - if (val == Qundef) val = Qnil; switch (nd_type(lhs)) { case NODE_GASGN: rb_gvar_set(lhs->nd_entry, val); @@ -5623,6 +5658,7 @@ set_method_visibility(self, argc, argv, ex) for (i=0; i<argc; i++) { rb_export_method(self, rb_to_id(argv[i]), ex); } } static VALUE @@ -6470,7 +6506,7 @@ proc_invoke(proc, args, pcall, self) ruby_frame->iter = ITER_CUR; if (!pcall) { - args = avalue_to_svalue(args); } PUSH_TAG(PROT_NONE); state = EXEC_TAG(); @@ -6,7 +6,7 @@ $Date$ created at: Mon Nov 15 12:24:34 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -1128,18 +1128,7 @@ rb_gc() struct gc_list *list; struct FRAME * volatile frame; /* gcc 2.7.2.3 -O2 bug?? */ jmp_buf save_regs_gc_mark; -#ifdef C_ALLOCA - VALUE stack_end; - alloca(0); -# define STACK_END (&stack_end) -#else -# if defined(__GNUC__) && defined(USE_BUILTIN_FRAME_ADDRESS) - VALUE *stack_end = __builtin_frame_address(0); -# else - VALUE *stack_end = alloca(1); -# endif -# define STACK_END (stack_end) -#endif if (dont_gc || during_gc) { if (!freelist || malloc_memories > GC_MALLOC_LIMIT) { @@ -6,7 +6,7 @@ $Date$ created at: Mon Nov 22 18:51:18 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -15,10 +15,7 @@ #include "ruby.h" #include "rubyio.h" #include "st.h" - -#if !defined(atof) && !defined(HAVE_STDLIB_H) -double strtod(); -#endif #define BITSPERSHORT (2*CHAR_BIT) #define SHORTMASK ((1<<BITSPERSHORT)-1) @@ -884,7 +881,6 @@ r_object(arg) d = -1.0 / t; } else { - /* xxx: should not use system's strtod(3) */ d = strtod(buf, 0); } v = rb_float_new(d); @@ -126,6 +126,9 @@ (defvar ruby-indent-level 2 "*Indentation of ruby statements.") (eval-when-compile (require 'cl)) (defun ruby-imenu-create-index () (let ((index-alist '()) @@ -366,18 +369,18 @@ The variable ruby-indent-level controls the amount of indentation. (forward-line 1) (goto-char (point)) ) - ((looking-at "(") (setq nest (cons (cons (char-after (point)) pnt) nest)) (setq pcol (cons (cons pnt depth) pcol)) (setq depth 0) (goto-char pnt) ) - ((looking-at "[\\[{]") (setq nest (cons (cons (char-after (point)) pnt) nest)) (setq depth (1+ depth)) (goto-char pnt) ) - ((looking-at ")") (setq nest (cdr nest)) (setq depth (cdr (car pcol))) (setq pcol (cdr pcol)) @@ -478,7 +481,7 @@ The variable ruby-indent-level controls the amount of indentation. (setq indent nil)) ; do nothing ((car (nth 1 state)) ; in paren (goto-char (cdr (nth 1 state))) - (if (eq (car (nth 1 state)) ?\( ) (let ((column (current-column)) (s (ruby-parse-region (point) indent-point))) (cond @@ -1,6 +1,6 @@ /************************************************ - missing.h - for missing/*.c $Author$ $Date$ @@ -6,7 +6,7 @@ $Date$ created at: Fri May 28 15:14:02 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Fri Aug 13 18:33:09 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -216,7 +216,7 @@ flo_to_s(flt) VALUE flt; { char buf[24]; - char *fmt = "%.10g"; double value = RFLOAT(flt)->value; double avalue, d1, d2; @@ -235,11 +235,12 @@ flo_to_s(flt) d1 = modf(d1, &d2); if (d1 == 0) fmt = "%.1e"; } - else if (avalue >= 1.0e10) { d1 = avalue; while (d1 > 10.0) d1 /= 10.0; d1 = modf(d1, &d2); if (d1 == 0) fmt = "%.1e"; } else if ((d1 = modf(value, &d2)) == 0) { fmt = "%.1f"; @@ -14,6 +14,7 @@ #include "ruby.h" #include "st.h" #include <stdio.h> #include <errno.h> #include <ctype.h> @@ -990,7 +991,7 @@ rb_cstr_to_dbl(p, badcheck) d = strtod(p, &end); if (p == end) { if (badcheck) { - bad: rb_invalid_str(q, "Float()"); } return d; @@ -6,7 +6,7 @@ $Date$ created at: Thu Feb 10 15:17:05 JST 1994 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -4597,8 +4597,6 @@ value_expr(node) if (node == 0) return Qtrue; switch (nd_type(node)) { - case NODE_WHILE: - case NODE_UNTIL: case NODE_CLASS: case NODE_MODULE: case NODE_DEFN: @@ -4612,6 +4610,7 @@ value_expr(node) case NODE_REDO: case NODE_RETRY: yyerror("void value expression"); return Qfalse; case NODE_BLOCK: @@ -726,7 +726,7 @@ rb_f_fork(obj) if (rb_block_given_p()) { int status; - rb_protect(rb_yield, Qnil, &status); ruby_stop(status); } return Qnil; @@ -265,7 +265,7 @@ range_step(argc, argv, range) } if (FIXNUM_P(b) && FIXNUM_P(e)) { /* fixnums are special */ - long beg, end = FIX2LONG(e), s = NUM2LONG(step); long i; if (s <= 0) { rb_raise(rb_eArgError, "step can't be <= 0"); @@ -5,7 +5,7 @@ $Author$ created at: Mon Aug 9 18:24:49 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Thu Sep 30 14:18:32 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Tue Aug 10 12:47:31 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -5,7 +5,7 @@ $Author$ created at: Thu Jun 10 14:26:32 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -6,7 +6,7 @@ $Date$ created at: Fri Nov 12 16:47:09 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Wed Aug 16 01:15:38 JST 1995 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -1000,7 +1000,7 @@ proc{ test_ok(!defined?(iii)) # out of scope loop{iii=5; test_ok(eval("defined? iii")); break} -loop {|iii| iii = 10 def dyna_var_check loop { @@ -6,7 +6,7 @@ $Date$ created at: Tue Dec 20 10:13:44 JST 1994 - Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -6,7 +6,7 @@ $Date$ created at: Tue Mar 22 18:44:30 JST 1995 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -10,6 +10,8 @@ **********************************************************************/ #include <stdio.h> #include <errno.h> @@ -17,8 +19,6 @@ #include "missing/file.h" #endif -#include "ruby.h" - #include "util.h" #ifndef HAVE_STRING_H char *strchr _((char*,char)); @@ -643,9 +643,261 @@ ruby_getcwd() char *buf = xmalloc(size); while (!getcwd(buf, size)) { - if (errno != ERANGE) rb_sys_fail(NULL); size *= 2; buf = xrealloc(buf, size); } return buf; } @@ -6,7 +6,7 @@ $Date$ created at: Thu Mar 9 11:55:53 JST 1995 - Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -61,4 +61,7 @@ char *ruby_strdup _((const char*)); char *ruby_getcwd _((void)); #define my_getcwd() ruby_getcwd() #endif /* UTIL_H */ @@ -6,7 +6,7 @@ $Date$ created at: Tue Apr 19 23:55:15 JST 1994 - Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan |