diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-08-14 03:56:28 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-08-14 03:56:28 +0000 |
commit | 39ac1d7c22072f2d520738098692bdbce2f380df (patch) | |
tree | 97866a3781af260ce47912f61a6190b9d72270f4 | |
parent | c086e784e200dc555e3f6d0ddb2edfdffd4f166d (diff) |
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | array.c | 6 | ||||
-rw-r--r-- | eval.c | 6 | ||||
-rw-r--r-- | lib/debug.rb | 5 | ||||
-rw-r--r-- | lib/e2mmap.rb | 14 | ||||
-rw-r--r-- | lib/matrix.rb | 8 | ||||
-rw-r--r-- | missing/snprintf.c | 5 | ||||
-rw-r--r-- | sample/rbc.rb | 29 |
8 files changed, 51 insertions, 32 deletions
@@ -1,3 +1,13 @@ +Fri Aug 14 11:01:47 1998 Yukihiro Matsumoto <[email protected]> + + * eval.c (call_trace_func): save __FILE__, __LINE__ before + executing trace_func, since trace function should not corrupt + line number information. + +Thu Aug 13 15:09:02 1998 Yukihiro Matsumoto <[email protected]> + + * array.c (ary_s_new): was marking unallocated region on GC. + Tue Aug 11 11:57:35 1998 Yukihiro Matsumoto <[email protected]> * version 1.1c2 released. @@ -167,6 +167,7 @@ ary_s_new(argc, argv, klass) VALUE *argv; VALUE klass; { + int len = 0; VALUE size, val; NEWOBJ(ary, struct RArray); OBJSETUP(ary, klass, T_ARRAY); @@ -186,10 +187,11 @@ ary_s_new(argc, argv, klass) ArgError("array size too big"); } ary->capa = capa; - ary->len = capa; + len = capa; } ary->ptr = ALLOC_N(VALUE, ary->capa); - memfill(ary->ptr, ary->len, val); + memfill(ary->ptr, len, val); + ary->len = len; obj_call_init((VALUE)ary); return (VALUE)ary; @@ -1554,6 +1554,8 @@ call_trace_func(event, file, line, self, id) int state; volatile VALUE trace; struct FRAME *prev; + char *file_save = sourcefile; + int line_save = sourceline; if (!trace_func) return; @@ -1585,6 +1587,8 @@ call_trace_func(event, file, line, self, id) thread_critical--; #endif if (!trace_func) trace_func = trace; + sourceline = line_save; + sourcefile = file_save; if (state) JUMP_TAG(state); } @@ -2780,7 +2784,7 @@ rb_longjmp(tag, mesg) errinfo = mesg; } - if (debug && !NIL_P(errinfo)) { + if (debug && !NIL_P(errinfo) && !obj_is_kind_of(errinfo, eSystemExit)) { fprintf(stderr, "Exception `%s' at %s:%d\n", rb_class2name(CLASS_OF(errinfo)), sourcefile, sourceline); diff --git a/lib/debug.rb b/lib/debug.rb index 2e3a29aa9e..90270a3fe7 100644 --- a/lib/debug.rb +++ b/lib/debug.rb @@ -176,7 +176,7 @@ class DEBUGGER__ printf "no sourcefile available for %s\n", file end when /^p\s+/ - p debug_eval($', binding) + p debug_eval($', binding) #' else v = debug_eval(input, binding) p v unless v == nil @@ -194,10 +194,13 @@ class DEBUGGER__ return "\n" unless line return line end + save = $DEBUG begin + $DEBUG = FALSE f = open(file) lines = @scripts[file] = f.readlines rescue + $DEBUG = save @scripts[file] = TRUE return "\n" end diff --git a/lib/e2mmap.rb b/lib/e2mmap.rb index 307b07dfbe..fa10d485d8 100644 --- a/lib/e2mmap.rb +++ b/lib/e2mmap.rb @@ -22,13 +22,13 @@ else cl.bind(self) end - # �����Ȥθߴ����Τ���˻Ĥ��Ƥ���. + # backward compatibility def E2MM.extend_to(b) c = eval("self", b) c.extend(self) end -# public :fail + # public :fail # alias e2mm_fail fail def fail(err = nil, *rest) @@ -39,8 +39,8 @@ else self.module_eval %q^ E2MM_ErrorMSG = {} unless self.const_defined?(:E2MM_ErrorMSG) # fail(err, *rest) - # err: �㳰 - # rest: ��å��������Ϥ��ѥ��� + # err: Exception + # rest: Parameter accompanied with the exception # def self.fail(err = nil, *rest) if form = E2MM_ErrorMSG[err] @@ -63,7 +63,6 @@ else # def_exception(c, m) # c: exception # m: message_form - # �㳰c�Υ�å�������m�Ȥ���. # def self.def_e2message(c, m) E2MM_ErrorMSG[c] = m @@ -72,8 +71,8 @@ else # def_exception(c, m) # n: exception_name # m: message_form - # s: �㳰�����ѡ����饹(�ǥե����: Exception) - # �㳰̾``c''�����㳰�������, ���Υ�å�������m�Ȥ���. + # s: superclass_of_exception (default: Exception) + # defines excaption named ``c'', whose message is ``m''. # #def def_exception(n, m) def self.def_exception(n, m, s = nil) @@ -99,4 +98,3 @@ else def_exception(:ErrNotRegisteredException, "not registerd exception(%s)") end end - diff --git a/lib/matrix.rb b/lib/matrix.rb index 99f44857a3..fcb0b29eb5 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -17,17 +17,15 @@ # : # rown] # -# column: �� -# row: �� # # module ExceptionForMatrix:: # Exceptions: # ErrDimensionMismatch -# �Ԥޤ�����������פ��Ƥ��ʤ�. +# number of column/row do not match # ErrNotRegular -# ��§����Ǥʤ�. +# not a regular matrix # ErrOperationNotDefined -# ���α黻�ҤϤޤ��������Ƥ��ʤ�. +# specified operator is not defined (yet) # # class Matrix # include ExceptionForMatrix diff --git a/missing/snprintf.c b/missing/snprintf.c index 69b9c3c33d..804fb1bd8b 100644 --- a/missing/snprintf.c +++ b/missing/snprintf.c @@ -60,11 +60,14 @@ #include <sys/types.h> +# undef __P #if defined(__STDC__) +# define __P(x) x # include <stdarg.h> #else # undef __P # define __P(x) () +# define const # include <varargs.h> #endif #ifndef _BSD_VA_LIST_ @@ -347,7 +350,9 @@ err: #define u_int unsigned int #include <limits.h> +#if !defined(__CYGWIN32__) #include <stdlib.h> +#endif #include <string.h> #if defined(__STDC__) diff --git a/sample/rbc.rb b/sample/rbc.rb index 5dd2cf230d..83796255cc 100644 --- a/sample/rbc.rb +++ b/sample/rbc.rb @@ -11,22 +11,21 @@ # # rbc.rb [options] file_name opts # options: -# -d �ǥХå��⡼��(���Ѥ��ʤ������ɤ��Ǥ��礦) -# -f ~/.irbrc ���ɤ߹��ޤʤ�. -# -m bc�⡼��(ʬ��, ����η����Ǥ��ޤ�) -# -r load-module ruby -r ��Ʊ��. -# --inspect ��̽��Ϥ�inspect���Ѥ���(bc�⡼�ɰʳ��ϥ� -# �ե����). -# --noinspect ��̽��Ϥ�inspect���Ѥ��ʤ�. -# --noreadline readline�饤�֥������Ѥ��ʤ�(�ǥե���� -# �Ǥ�readline�饤�֥������Ѥ��褦�Ȥ���). +# -d debug mode (not recommended) +# -f does not read ~/.irbrc +# -m bc mode (rational/matrix calc) +# -r load-module same as `ruby -r' +# --inspect use inspect for result output +# (default for non-bc mode) +# --noinspect does not use inspect for result output +# --noreadline does not use readline library +# (default: try to use readline) # -# �ɲ� private method: -# exit, quit ��λ����. -# inspect_mode(sw = nil) ���ڥ��ȥ⡼�ɤΥȥ��� -# trace_load(sw = nil) load/require����rbc��file�ɤ߹��ߵ�ǽ���� -# ����⡼�ɤΥ����å�(�ǥե���Ȥϥȥ졼�� -# �⡼��) +# additional private method (as function): +# exit, quit terminate the interpreter +# inspect_mode(sw = nil) toggle inspect mode +# trace_load(sw = nil) change trace mode for file loading using +# load/require. (default: trace-mode on) # require "e2mmap.rb" |