[前][次][番号順一覧][スレッド一覧][生データ]

ruby-cvs:21368

From: akr ruby-lang.org
Date: Sat, 8 Dec 2007 11:50:45 +0900 (JST)
Subject: [ruby-cvs:21368] Ruby:r14131 (trunk): * encoding.c (rb_enc_mbclen): make it never fail.

akr	2007-12-08 11:50:43 +0900 (Sat, 08 Dec 2007)

  New Revision: 14131

  Modified files:
    trunk/ChangeLog
    trunk/encoding.c
    trunk/ext/tk/sample/tkextlib/vu/canvSticker2.rb
    trunk/include/ruby/encoding.h
    trunk/include/ruby/regex.h
    trunk/parse.y
    trunk/re.c
    trunk/string.c
    trunk/test/ruby/test_m17n.rb
    trunk/test/ruby/test_regexp.rb

  Log:
    * encoding.c (rb_enc_mbclen): make it never fail.
      (rb_enc_nth): don't check the return value of rb_enc_mbclen.
      (rb_enc_strlen): ditto.
      (rb_enc_precise_mbclen): return needmore(1) if e <= p.
      (rb_enc_get_ascii): new function for extracting ASCII character.
    
    * include/ruby/encoding.h (rb_enc_get_ascii): declared.
    
    * include/ruby/regex.h (ismbchar): removed.
    
    * re.c (rb_reg_expr_str): use rb_enc_get_ascii.
      (unescape_escaped_nonascii): use rb_enc_precise_mbclen to determine
      the termination of escaped non-ASCII character.
      (unescape_nonascii): use rb_enc_precise_mbclen.
      (rb_reg_quote): use rb_enc_get_ascii.
      (rb_reg_regsub): use rb_enc_get_ascii.
    
    * string.c (rb_str_reverse) don't check the return value of
      rb_enc_mbclen.
      (rb_str_split_m): don't call rb_enc_mbclen with e <= p.
    
    * parse.y (is_identchar): use ISASCII.
      (parser_ismbchar): removed.
      (parser_precise_mbclen): new macro.
      (parser_isascii): new macro.
      (parser_tokadd_mbchar): use parser_precise_mbclen to check invalid
      character precisely.
      (parser_tokadd_string): use parser_isascii.
      (parser_yylex): ditto.
      (is_special_global_name): don't call is_identchar with e <= p.
      (rb_enc_symname_p): ditto.
    
      [ruby-dev:32455]
    
    * ext/tk/sample/tkextlib/vu/canvSticker2.rb: remove coding cookie
      because the encoding is not UTF-8.  [ruby-dev:32475]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=14131&r2=14130
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=14131&r2=14130
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14131&r2=14130
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/encoding.h?r1=14131&r2=14130
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_regexp.rb?r1=14131&r2=14130
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/tk/sample/tkextlib/vu/canvSticker2.rb?r1=14131&r2=14130
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/re.c?r1=14131&r2=14130
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/regex.h?r1=14131&r2=14130
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=14131&r2=14130
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_m17n.rb?r1=14131&r2=14130


[前][次][番号順一覧][スレッド一覧][生データ]