Trunk $B$G8=>u%;%k%U%S%k%I$,$G$-$^$;$s(B

e$BLZB<$G$9!#e(B

e$B0J2<$N=$@5$,860x$G!"$3$N=$@5$,F~$C$?0J9_$Ne(Bruby
e$B$rM%@hE*$K5/F0$9$k4D6-$Ke(B
e$B$*$$$F!"e(Btrunk e$B$N%;%k%U%S%k%I$,$G$-$J$/$J$C$F$$$^$9!#e(B

Revision 13447 - (view) (download) (annotate) - [select for diffs]
Modified Sat Sep 15 08:04:10 2007 UTC (8 days, 8 hours ago) by nobu
File length: 5357 byte(s)
Diff to previous 13348

  • encoding.c (rb_enc_associate_index, rb_enc_get_index): check if
    object is encoding capable. [ruby-dev:31780]

  • string.c (rb_str_subpat_set): check for if the argument is a String.

e$B$3$s$J%(%i!<$,$G$^$9e(B
C:\WINNT\system32\cmd.exe /C …\win32\rm.bat ruby.exe
ruby ./…/tool/insns2vm.rb --srcdir="./…"
c:/ruby/lib/ruby/1.9/erb.rb:412:in initialize': wrong argument type StringScanner (not encode capable) (TypeError) from c:/ruby/lib/ruby/1.9/erb.rb:412:innew’
from c:/ruby/lib/ruby/1.9/erb.rb:412:in scan' from c:/ruby/lib/ruby/1.9/erb.rb:524:incompile’
from c:/ruby/lib/ruby/1.9/erb.rb:691:in initialize' from E:/ruby-src/ruby-trunk-20070919/lib/vm/instruction.rb:675:innew’
from
E:/ruby-src/ruby-trunk-20070919/lib/vm/instruction.rb:675:in
generate' from E:/ruby-src/ruby-trunk-20070919/lib/vm/instruction.rb:1317:inblock in generate’
from
E:/ruby-src/ruby-trunk-20070919/lib/vm/instruction.rb:1316:in
each' from E:/ruby-src/ruby-trunk-20070919/lib/vm/instruction.rb:1316:ingenerate’
from ./…/tool/insns2vm.rb:14:in `’
NMAKE : fatal error U1077: ‘ruby’ : e$B%j%?!<%se(B e$B%3!<%Ie(B ‘0x1’

e$BD>@$N860x$Oe(B erb.rb e$B$Ne(B
412e$B9TL$GEO$7$F$$$k$N$,e(BStringe$B%%V%8%’%/%H$G$O$J$/e(B
StrincScannere$B$N%
%V%8%’%/%H$G!"$=$N$?$a$K>e5-$N=$@5$G9T$o$l$F$$$k%A%’%C%/e(B
e$B$+$iO3$l$F$7$^$&$?$a$G$9!#e(B

static int
enc_capable(VALUE obj)
{
if (IMMEDIATE_P(obj)) return Qfalse;
switch (BUILTIN_TYPE(obj)) {
case T_STRING:
case T_REGEXP:
case T_FILE:
return Qtrue;
default:
return Qfalse;
}
}

StringScannere$B$Oe(BStringe$B$N;RB9$G$b$J$$$N$G$3$N%A%’%C%/$G$O$8$+$l$k$o$1$G$9$,e(B
e$B$I$N$h$&$K$9$Y$-$J$N$G$7$g$&$+e(B?

e$B?tF|A0$K<+J,$Ne(Bwebe$BF|5-$K$b=q$-$^$7$?$N$G!"$o$?$7$NCN$i$J$$$H$3$m$Ge(B
e$BOC$,?J$s$G$$$?$i$4$a$s$J$5$$!#e(B


e$BLZB<9@0le(B
I thought what I’d do was, I’d pretend I was one of those deaf-mutes
or shoud I?
mail kbk at kt.rim.or.jp
web www.kt.rim.or.jp/e(J~e(Bkbk/zakkicho/index.html

e$B$J$+$@$G$9!#e(B

At Mon, 24 Sep 2007 01:54:54 +0900,
=?ISO-2022-JP?B?GyRCJC0kYCRpJDMkJiQkJEEbKEI=?= wrote in
[ruby-dev:31831]:

e$BD>@$N860x$Oe(B erb.rb e$B$Ne(B 412e$B9TL$GEO$7$F$$$k$N$,e(BStringe$B%%V%8%’%/%H$G$O$J$/e(B
StrincScannere$B$N%
%V%8%’%/%H$G!"$=$N$?$a$K>e5-$N=$@5$G9T$o$l$F$$$k%A%’%C%/e(B
e$B$+$iO3$l$F$7$^$&$?$a$G$9!#e(B

erbe$B<+BN$Oe(BStringe$B$rEO$7$F$$$k$b$N$N!"e(BStringScanner#initializee$B$NCfe(B
e$B$G!"EO$5$l$?e(BStringe$B$Ne(Bencodinge$B$re(BStringScannere$B<+?H$K%3%T!<$7$F$*$3e(B
e$B$&$H$9$k$H$3$m$GCF$+$l$F$$$k$h$&$G$9!#e(B

e$B$3$N>l9g$OJ]B8$5$l$F$$$ke(Bstre$B$Ne(Bencodinge$B$r;H$($P$$$$$N$G$O$J$$$+$He(B
e$B;W$$$^$9!#e(B

StringScannere$B$Oe(BStringe$B$N;RB9$G$b$J$$$N$G$3$N%A%’%C%/$G$O$8$+$l$k$o$1$G$9$,e(B
e$B$I$N$h$&$K$9$Y$-$J$N$G$7$g$&$+e(B?

e$B$I$&$7$?$b$s$G$7$g$&$M$’!#G$0U$N%/%i%9$,e(Bencodinge$B$r;}$F$kI,MW$,$“e(B
e$B$k$+$I$&$+!”$,$h$/$o$+$i$J$$$s$G$9$,!#e(B

Index: ext/strscan/strscan.c

— ext/strscan/strscan.c (revision 13494)
+++ ext/strscan/strscan.c (working copy)
@@ -191,5 +191,4 @@ strscan_initialize(int argc, VALUE *argv
StringValue(str);
p->str = str;

  • rb_enc_associate(self, rb_enc_get(str));

    return self;
    @@ -655,5 +654,4 @@ strscan_getch(VALUE self)
    struct strscanner *p;
    long len;

  • rb_encoding *enc = rb_enc_get(self);

    GET_SCANNER(self, p);
    @@ -662,5 +660,5 @@ strscan_getch(VALUE self)
    return Qnil;

  • len = rb_enc_mbclen(CURPTR§, S_PEND§, enc);

  • len = rb_enc_mbclen(CURPTR§, S_PEND§, rb_enc_get(p->str));
    if (p->curr + len > S_LEN§) {
    len = S_LEN§ - p->curr;

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31833] Re: trunk
e$B$G8=>u%;%k%U%S%k%I$,$G$-$^$;$se(B”
on Mon, 24 Sep 2007 10:21:57 +0900, Nobuyoshi N.
[email protected] writes:

|erbe$B<+BN$Oe(BStringe$B$rEO$7$F$$$k$b$N$N!"e(BStringScanner#initializee$B$NCfe(B
|e$B$G!"EO$5$l$?e(BStringe$B$Ne(Bencodinge$B$re(BStringScannere$B<+?H$K%3%T!<$7$F$*$3e(B
|e$B$&$H$9$k$H$3$m$GCF$+$l$F$$$k$h$&$G$9!#e(B
|
|e$B$3$N>l9g$OJ]B8$5$l$F$$$ke(Bstre$B$Ne(Bencodinge$B$r;H$($P$$$$$N$G$O$J$$$+$He(B
|e$B;W$$$^$9!#e(B

e$B$G$7$g$&$M!#%3%_%C%H$7$F$/$@$5$$!#e(B

|> StringScannere$B$Oe(BStringe$B$N;RB9$G$b$J$$$N$G$3$N%A%‘%C%/$G$O$8$+$l$k$o$1$G$9$,e(B
|> e$B$I$N$h$&$K$9$Y$-$J$N$G$7$g$&$+e(B?
|
|e$B$I$&$7$?$b$s$G$7$g$&$M$’!#G$0U$N%/%i%9$,e(Bencodinge$B$r;}$F$kI,MW$,$“e(B
|e$B$k$+$I$&$+!”$,$h$/$o$+$i$J$$$s$G$9$,!#e(B

e$BEv=i$OG$0U$N%/%i%9$K;}$?$;$F9=$o$J$$$H;W$C$F$?$s$G$9$,!#$^$"!"e(B
e$B8DJL$K9M$($F$$$-$^$7$g$&!#e(B