* Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee.

[bug] fix problem with optimization of \z (Issue #16) [Bug #8210]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2013-04-13 11:30:35 +00:00
Родитель 0869d460ba
Коммит 536a3274c9
6 изменённых файлов: 16 добавлений и 11 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sat Apr 13 20:28:08 2013 NARUSE, Yui <naruse@ruby-lang.org>
* 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@ruby-lang.org>
* ext/ripper/depend: parse.h and id.h may be created on topdir.

Просмотреть файл

@ -5,7 +5,7 @@
**********************************************************************/
/*-
* 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" {
#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

Просмотреть файл

@ -4990,7 +4990,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
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);

Просмотреть файл

@ -4020,15 +4020,14 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
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 UChar* str, const UChar* end,
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)

Просмотреть файл

@ -803,7 +803,7 @@ typedef struct _OnigStackType {
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;
#include "ruby/st.h"
typedef st_data_t hash_data_type;
#else
#include "st.h"
typedef uintptr_t hash_data_type;
#endif

Просмотреть файл

@ -1580,7 +1580,7 @@ str_node_split_last_char(StrNode* sn, OnigEncoding enc)
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** src, UChar* end, ScanEnv* env)
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)) {