diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-05-29 08:59:39 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-05-29 08:59:39 +0000 |
commit | 8e73a6ce75a115b1fd411d5a3a987d599a7dcc4b (patch) | |
tree | e5e320e2ce9e6fbc0cc00927dffa60894f87b709 | |
parent | f2a1269383c19a2d6d9fd475681b34e5e81e65e3 (diff) |
* regex.c (re_compile_pattern): no back reference to a
subexpression if inside of it.
* eval.c (rb_yield_0): preserve and restore ruby_cref as well.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | eval.c | 4 | ||||
-rw-r--r-- | ext/tk/lib/tk.rb | 22 | ||||
-rw-r--r-- | regex.c | 22 | ||||
-rw-r--r-- | version.h | 4 |
5 files changed, 53 insertions, 8 deletions
@@ -140,6 +140,11 @@ Thu May 17 05:23:52 2001 Keiju Ishitsuka <keiju@ishitsuka.com> * lib/irb.rb lib/irb/multi-irb.rb lib/irb/ruby-lex.rb lib/irb/version.rb resolve ctrl-c problem +Wed May 16 01:48:34 2001 Guy Decoux <decoux@moulon.inra.fr> + + * regex.c (re_compile_pattern): no back reference to a + subexpression if inside of it. + Tue May 15 17:46:37 2001 Yukihiro Matsumoto <matz@ruby-lang.org> * array.c (rb_ary_and): should not push frozen key string. @@ -191,6 +196,10 @@ Fri May 11 02:00:44 2001 Ryo HAYASAKA <ryoh@jaist.ac.jp> * bignum.c (bigdivrem): access boundary bug. +Wed May 9 14:38:33 2001 K.Kosako <kosako@sofnec.co.jp> + + * eval.c (rb_yield_0): preserve and restore ruby_cref as well. + Tue May 8 17:12:43 2001 K.Kosako <kosako@sofnec.co.jp> * eval.c (is_defined): core dumped during instance_eval for @@ -3503,6 +3503,7 @@ rb_yield_0(val, self, klass, acheck) { NODE *node; volatile VALUE result = Qnil; + volatile VALUE old_cref; struct BLOCK *block; struct SCOPE *old_scope; struct FRAME frame; @@ -3519,6 +3520,8 @@ rb_yield_0(val, self, klass, acheck) frame = block->frame; frame.prev = ruby_frame; ruby_frame = &(frame); + old_cref = (VALUE)ruby_cref; + ruby_cref = (NODE*)ruby_frame->cbase; old_scope = ruby_scope; ruby_scope = block->scope; ruby_block = block->prev; @@ -3643,6 +3646,7 @@ rb_yield_0(val, self, klass, acheck) POP_VARS(); ruby_block = block; ruby_frame = ruby_frame->prev; + ruby_cref = (NODE*)old_cref; if (ruby_scope->flag & SCOPE_DONT_RECYCLE) scope_dup(old_scope); ruby_scope = old_scope; diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 262adec3f2..b1ab35598f 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -665,6 +665,10 @@ module TkPackage include TkCore extend TkPackage + def add_path(path) + Tk::AUTO_PATH.value = Tk::AUTO_PATH.to_a << path + end + def forget(package) tk_call('package', 'forget', package) nil @@ -726,9 +730,6 @@ module Tk TK_LIBRARY = INTERP._invoke("set", "tk_library") LIBRARY = INTERP._invoke("info", "library") - TCL_PACKAGE_PATH = INTERP._invoke("set", "tcl_pkgPath") - AUTO_PATH = tk_split_simplelist(INTERP._invoke("set", "auto_path")) - PLATFORM = Hash[*tk_split_simplelist(INTERP._eval('array get tcl_platform'))] JAPANIZED_TK = (INTERP._invoke("info", "commands", "kanji") != "") @@ -1379,6 +1380,21 @@ class TkVarAccess<TkVariable end end +module Tk + begin + auto_path = INTERP._invoke('set', 'auto_path') + rescue + begin + auto_path = INTERP._invoke('set', 'env(TCLLIBPATH)') + rescue + auto_path = Tk::LIBRARY + end + end + AUTO_PATH = TkVarAccess.new('auto_path', auto_path) + + TCL_PACKAGE_PATH = TkVarAccess.new('tcl_pkgPath') +end + module TkSelection include Tk extend Tk @@ -2258,6 +2258,7 @@ re_compile_pattern(pattern, size, bufp) if (!ISDIGIT(c)) PATUNFETCH; if (c1 >= regnum) { + need_to_get_octal: /* need to get octal */ p = p_save; c = scan_oct(p_save, 3, &numlen) & 0xff; @@ -2269,9 +2270,24 @@ re_compile_pattern(pattern, size, bufp) } /* Can't back reference to a subexpression if inside of it. */ - for (stackt = stackp - 2; stackt > stackb; stackt -= 5) - if (*stackt == c1) - goto normal_char; + for (stackt = stackp - 2; stackt > stackb; ) { + switch (*stackt) { + case '(': + if (stackt[-2] == c1) + goto need_to_get_octal; + stackt -= 5; + break; + case '!': + stackt--; + case '=': + case '>': + stackt -= 4; + break; + default: + stackt -= 3; + break; + } + } laststart = b; BUFPUSH(duplicate); BUFPUSH(c1); @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.6.4" -#define RUBY_RELEASE_DATE "2001-05-28" +#define RUBY_RELEASE_DATE "2001-05-29" #define RUBY_VERSION_CODE 164 -#define RUBY_RELEASE_CODE 20010528 +#define RUBY_RELEASE_CODE 20010529 |