Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed May 27, 1998
1 parent e630077 commit 1847755
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/final.rb
Expand Up @@ -2,7 +2,7 @@
# $Id$
# Copyright (C) 1998 Yukihiro Matsumoto. All rights reserved.

# The ObjectSpace extention:
# The ObjectSpace extension:
#
# ObjectSpace.define_finalizer(obj, proc=lambda())
#
Expand Down
2 changes: 1 addition & 1 deletion lib/mkmf.rb
@@ -1,4 +1,4 @@
# module to create Makefile for extention modules
# module to create Makefile for extension modules
# invoke like: ruby -r mkmf extconf.rb

require 'rbconfig'
Expand Down
8 changes: 5 additions & 3 deletions lib/observer.rb
Expand Up @@ -30,9 +30,11 @@ def changed?
@observer_state
end
def notify_observers(*arg)
if @observer_peers and @observer_state
for i in @observer_peers
i.update(*arg)
if @observer_state
if @observer_peers
for i in @observer_peers
i.update(*arg)
end
end
@observer_state = FALSE
end
Expand Down
27 changes: 9 additions & 18 deletions regex.c
Expand Up @@ -380,6 +380,7 @@ long re_syntax_options = 0;
/* Macros for re_compile_pattern, which is found below these definitions. */

#define TRANSLATE_P() ((options&RE_OPTION_IGNORECASE) && translate)
#define TRY_TRANSLATE() ((bufp->options&(RE_OPTION_IGNORECASE|RE_MAY_IGNORECASE)) && translate)
/* Fetch the next character in the uncompiled pattern---translating it
if necessary. Also cast from a signed character in the constant
string passed to us by the user to an unsigned char that we can use
Expand Down Expand Up @@ -2228,17 +2229,13 @@ re_compile_fastmap(bufp)
{
case exactn:
if (p[1] == 0xff) {
if (TRANSLATE_P()) {
if (TRANSLATE_P())
fastmap[translate[p[2]]] = 2;
bufp->options |= RE_MAY_IGNORECASE;
}
else
fastmap[p[2]] = 2;
}
else if (TRANSLATE_P()) {
else if (TRANSLATE_P())
fastmap[translate[p[1]]] = 1;
bufp->options |= RE_MAY_IGNORECASE;
}
else
fastmap[p[1]] = 1;
break;
Expand All @@ -2260,10 +2257,8 @@ re_compile_fastmap(bufp)
continue;

case endline:
if (TRANSLATE_P()) {
if (TRANSLATE_P())
fastmap[translate['\n']] = 1;
bufp->options |= RE_MAY_IGNORECASE;
}
else
fastmap['\n'] = 1;

Expand Down Expand Up @@ -2386,10 +2381,8 @@ re_compile_fastmap(bufp)
for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
{
if (TRANSLATE_P()) {
if (TRANSLATE_P())
fastmap[translate[j]] = 1;
bufp->options |= RE_MAY_IGNORECASE;
}
else
fastmap[j] = 1;
}
Expand Down Expand Up @@ -2545,8 +2538,7 @@ re_search(bufp, string, size, startpos, range, regs)
&& bufp->must
&& !must_instr(bufp->must+1, bufp->must[0],
string+startpos, size-startpos,
(bufp->options&(RE_OPTION_IGNORECASE|RE_MAY_IGNORECASE))?
translate:0)) {
TRY_TRANSLATE()?translate:0)) {
return -1;
}

Expand Down Expand Up @@ -2584,8 +2576,7 @@ re_search(bufp, string, size, startpos, range, regs)
break;
}
else
if (fastmap[(bufp->options&(RE_OPTION_IGNORECASE|RE_MAY_IGNORECASE))?
translate[c] : c])
if (fastmap[TRY_TRANSLATE() ? translate[c] : c])
break;
range--;
}
Expand All @@ -2597,8 +2588,7 @@ re_search(bufp, string, size, startpos, range, regs)

c = string[startpos];
c &= 0xff;
if ((bufp->options&(RE_OPTION_IGNORECASE|RE_MAY_IGNORECASE)) ?
!fastmap[translate[c]] : !fastmap[c])
if (TRY_TRANSLATE() ? !fastmap[translate[c]] : !fastmap[c])
goto advance;
}
}
Expand Down Expand Up @@ -3394,6 +3384,7 @@ re_match(bufp, string_arg, size, pos, regs)
continue;

case casefold_on:
bufp->options |= RE_MAY_IGNORECASE;
options |= RE_OPTION_IGNORECASE;
continue;

Expand Down

0 comments on commit 1847755

Please sign in to comment.