[前][次][番号順一覧][スレッド一覧]

ruby-changes:28224

From: naruse <ko1@a...>
Date: Sat, 13 Apr 2013 20:30:46 +0900 (JST)
Subject: [ruby-changes:28224] naruse:r40276 (trunk): * Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee.

naruse	2013-04-13 20:30:35 +0900 (Sat, 13 Apr 2013)

  New Revision: 40276

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40276

  Log:
    * Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee.
      [bug] fix problem with optimization of \z (Issue #16) [Bug #8210]

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/oniguruma.h
    trunk/regcomp.c
    trunk/regexec.c
    trunk/regint.h
    trunk/regparse.c

Index: regparse.c
===================================================================
--- regparse.c	(revision 40275)
+++ regparse.c	(revision 40276)
@@ -1580,7 +1580,7 @@ str_node_split_last_char(StrNode* sn, On https://github.com/ruby/ruby/blob/trunk/regparse.c#L1580
 
   if (sn->end > sn->s) {
     p = onigenc_get_prev_char_head(enc, sn->s, sn->end, sn->end);
-    if (p && p > sn->s) { /* can be splitted. */
+    if (p && p > sn->s) { /* can be split. */
       n = node_new_str(p, sn->end);
       if (IS_NOT_NULL(n) && (sn->flag & NSTR_RAW) != 0)
 	NSTRING_SET_RAW(n);
@@ -3201,7 +3201,7 @@ fetch_token_in_cc(OnigToken* tok, UChar* https://github.com/ruby/ruby/blob/trunk/regparse.c#L3201
   else if (c == '[') {
     if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_POSIX_BRACKET) && (PPEEK_IS(':'))) {
       OnigCodePoint send[] = { (OnigCodePoint )':', (OnigCodePoint )']' };
-      tok->backp = p; /* point at '[' is readed */
+      tok->backp = p; /* point at '[' is read */
       PINC;
       if (str_exist_check_with_esc(send, 2, p, end,
                                    (OnigCodePoint )']', enc, syn)) {
Index: regcomp.c
===================================================================
--- regcomp.c	(revision 40275)
+++ regcomp.c	(revision 40276)
@@ -4990,7 +4990,7 @@ optimize_node_left(Node* node, NodeOptIn https://github.com/ruby/ruby/blob/trunk/regcomp.c#L4990
       int i, z;
       CClassNode* cc = NCCLASS(node);
 
-      /* no need to check ignore case. (setted in setup_tree()) */
+      /* no need to check ignore case. (set in setup_tree()) */
 
       if (IS_NOT_NULL(cc->mbuf) || IS_NCCLASS_NOT(cc)) {
         OnigDistance min = ONIGENC_MBC_MINLEN(env->enc);
Index: include/ruby/oniguruma.h
===================================================================
--- include/ruby/oniguruma.h	(revision 40275)
+++ include/ruby/oniguruma.h	(revision 40276)
@@ -5,7 +5,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/oniguruma.h#L5
 **********************************************************************/
 /*-
  * Copyright (c) 2002-2009  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2012  K.Takata  <kentkt AT csc DOT jp>
+ * Copyright (c) 2011-2013  K.Takata  <kentkt AT csc DOT jp>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/oniguruma.h#L40
 #define ONIGURUMA
 #define ONIGURUMA_VERSION_MAJOR   5
 #define ONIGURUMA_VERSION_MINOR   13
-#define ONIGURUMA_VERSION_TEENY   3
+#define ONIGURUMA_VERSION_TEENY   4
 
 #ifdef __cplusplus
 # ifndef  HAVE_PROTOTYPES
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40275)
+++ ChangeLog	(revision 40276)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Apr 13 20:28:08 2013  NARUSE, Yui  <naruse@r...>
+
+	* Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee.
+	  [bug] fix problem with optimization of \z (Issue #16) [Bug #8210]
+
 Sat Apr 13 18:56:15 2013  NAKAMURA Usaku  <usa@r...>
 
 	* ext/ripper/depend: parse.h and id.h may be created on topdir.
Index: regint.h
===================================================================
--- regint.h	(revision 40275)
+++ regint.h	(revision 40276)
@@ -803,7 +803,7 @@ typedef struct _OnigStackType { https://github.com/ruby/ruby/blob/trunk/regint.h#L803
     struct {
       int num;           /* memory num */
       UChar *pstr;       /* start/end position */
-      /* Following information is setted, if this stack type is MEM-START */
+      /* Following information is set, if this stack type is MEM-START */
       OnigStackIndex start;  /* prev. info (for backtrack  "(...)*" ) */
       OnigStackIndex end;    /* prev. info (for backtrack  "(...)*" ) */
     } mem;
@@ -876,6 +876,7 @@ typedef void hash_table_type; https://github.com/ruby/ruby/blob/trunk/regint.h#L876
 #include "ruby/st.h"
 typedef st_data_t hash_data_type;
 #else
+#include "st.h"
 typedef uintptr_t hash_data_type;
 #endif
 
Index: regexec.c
===================================================================
--- regexec.c	(revision 40275)
+++ regexec.c	(revision 40276)
@@ -4020,15 +4020,14 @@ onig_search_gpos(regex_t* reg, const UCh https://github.com/ruby/ruby/blob/trunk/regexec.c#L4020
 	  start = min_semi_end - reg->anchor_dmax;
 	  if (start < end)
 	    start = onigenc_get_right_adjust_char_head(reg->enc, str, start, end);
-	  else { /* match with empty at end */
-	    start = onigenc_get_prev_char_head(reg->enc, str, end, end);
-	  }
 	}
 	if ((OnigDistance )(max_semi_end - (range - 1)) < reg->anchor_dmin) {
 	  range = max_semi_end - reg->anchor_dmin + 1;
 	}
 
-	if (start >= range) goto mismatch_no_msa;
+	if (start > range) goto mismatch_no_msa;
+	/* If start == range, match with empty at end.
+	   Backward search is used. */
       }
       else {
 	if ((OnigDistance )(min_semi_end - range) > reg->anchor_dmax) {
@@ -4258,7 +4257,7 @@ onig_search_gpos(regex_t* reg, const UCh https://github.com/ruby/ruby/blob/trunk/regexec.c#L4257
   ONIG_STATE_DEC_THREAD(reg);
 
   /* If result is mismatch and no FIND_NOT_EMPTY option,
-     then the region is not setted in match_at(). */
+     then the region is not set in match_at(). */
   if (IS_FIND_NOT_EMPTY(reg->options) && region
 #ifdef USE_POSIX_API_REGION_OPTION
       && !IS_POSIX_REGION(option)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]