Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
K.Kosako committed May 29, 2017
2 parents c4ce370 + 5f43223 commit 7f5aa49
Show file tree
Hide file tree
Showing 21 changed files with 280 additions and 181 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8)
project(oniguruma C)

set(PACKAGE onig)
set(PACKAGE_VERSION "6.2.0")
set(PACKAGE_VERSION "6.3.0")

set(USE_COMBINATION_EXPLOSION_CHECK 0)
set(USE_CRNL_AS_LINE_TERMINATOR 0)
Expand Down
11 changes: 11 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
History

2017/05/29: Version 6.3.0

2017/05/24: fix #60 : invalid state(CCS_VALUE) in parse_char_class()
2017/05/24: fix #59 : access to invalid address by reg->dmax value
2017/05/23: fix invalid increment of start position in onig_scan()
2017/05/23: fix #58 : access to invalid address by reg->dmin value
2017/05/23: fix #57 : DATA_ENSURE() check must be before data access
2017/05/22: fix #56 : return invalid result for codepoint 0xFFFFFFFF
2017/05/19: [new] add \o{17777777777} syntax.
2017/05/19: fix #55 : Byte value expressed in octal must be smaller than 256

2017/04/08: Version 6.2.0

2017/03/15: fix: size in xmemcpy in stack_double (PR #51)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Supported character encodings:
* CP1251: contributed by Byte


New feature of version 6.3.0
--------------------------

* NEW SYNTAX: escape-o-brace for octal codepoint.


New feature of version 6.1.2
--------------------------

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(onig, 6.2.0)
AC_INIT(onig, 6.3.0)

AC_CONFIG_MACRO_DIR([m4])

Expand Down
2 changes: 1 addition & 1 deletion dist.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- This file is part of LuaDist project

name = "onig"
version = "6.2.0"
version = "6.3.0"

desc = "Oniguruma is a regular expressions library."
author = "K.Kosako"
Expand Down
3 changes: 2 additions & 1 deletion doc/RE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Oniguruma Regular Expressions Version 6.0.0 2016/08/18
Oniguruma Regular Expressions Version 6.3.0 2017/05/19

syntax: ONIG_SYNTAX_RUBY (default)

Expand All @@ -22,6 +22,7 @@ syntax: ONIG_SYNTAX_RUBY (default)
\a bell (0x07)
\e escape (0x1B)
\nnn octal char (encoded byte value)
\o{17777777777} wide octal char (character code point value)
\xHH hexadecimal char (encoded byte value)
\x{7HHHHHHH} wide hexadecimal char (character code point value)
\cx control char (character code point value)
Expand Down
33 changes: 17 additions & 16 deletions doc/RE.ja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
���� ����ɽ�� Version 6.0.0 2016/05/02
���� ����ɽ�� Version 6.3.0 2017/05/19

����ʸˡ: ONIG_SYNTAX_RUBY (������)

Expand All @@ -13,21 +13,22 @@

2. ʸ��

\t ��ʿ���� (0x09)
\v ��ľ���� (0x0B)
\n ���� (0x0A)
\r ���� (0x0D)
\b ������� (0x08)
\f ���� (0x0C)
\a �� (0x07)
\e ���򽤾� (0x1B)
\nnn Ȭ�ʿ�ɽ�� ��沽�Х�����(�ΰ���)
\xHH ��ϻ�ʿ�ɽ�� ��沽�Х�����(�ΰ���)
\x{7HHHHHHH} ��ĥ��ϻ�ʿ�ɽ�� �����ɥݥ������
\cx ����ʸ��ɽ�� �����ɥݥ������
\C-x ����ʸ��ɽ�� �����ɥݥ������
\M-x Ķ (x|0x80) �����ɥݥ������
\M-\C-x Ķ + ����ʸ��ɽ�� �����ɥݥ������
\t ��ʿ���� (0x09)
\v ��ľ���� (0x0B)
\n ���� (0x0A)
\r ���� (0x0D)
\b ������� (0x08)
\f ���� (0x0C)
\a �� (0x07)
\e ���򽤾� (0x1B)
\nnn Ȭ�ʿ�ɽ�� ��沽�Х�����(�ΰ���)
\o{17777777777} ��ĥȬ�ʿ�ɽ�� �����ɥݥ������
\xHH ��ϻ�ʿ�ɽ�� ��沽�Х�����(�ΰ���)
\x{7HHHHHHH} ��ĥ��ϻ�ʿ�ɽ�� �����ɥݥ������
\cx ����ʸ��ɽ�� �����ɥݥ������
\C-x ����ʸ��ɽ�� �����ɥݥ������
\M-x Ķ (x|0x80) �����ɥݥ������
\M-\C-x Ķ + ����ʸ��ɽ�� �����ɥݥ������

�� \b�ϡ�ʸ��������ǤΤ�ͭ��

Expand Down
7 changes: 2 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@
<h1>Oniguruma</h1> (<a href="index_ja.html">Japanese</a>)

<p>
(c) K.Kosako, updated at: 2017/04/06
(c) K.Kosako, updated at: 2017/05/26
</p>

<dl>
<font color="orange">
<dt><b>What's new</b>
</font>
<ul>
<li>2017/05/29: Version 6.3.0 released.</li>
<li>2017/04/08: Version 6.2.0 released.</li>
<li>2016/12/11: Version 6.1.3 released.</li>
<li>2016/11/07: Version 6.1.2 released.</li>
<li>2016/09/02: Version 6.1.1 released.</li>
<li>2016/08/29: Version 6.1.0 released.</li>
<li>2014/12/12: Version 5.9.6 released.</li>
</ul>
</dl>
<hr>
Expand Down
7 changes: 2 additions & 5 deletions index_ja.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@
<h1>鬼車</h1>

<p>
(c) K.Kosako, 最終更新: 2017/04/06
(c) K.Kosako, 最終更新: 2017/05/26
</p>

<dl>
<font color="orange">
<dt><b>更新情報</b>
</font>
<ul>
<li>2017/05/29: Version 6.3.0 リリース</li>
<li>2017/04/08: Version 6.2.0 リリース</li>
<li>2016/12/11: Version 6.1.3 リリース</li>
<li>2016/11/07: Version 6.1.2 リリース</li>
<li>2016/09/02: Version 6.1.1 リリース</li>
<li>2016/08/29: Version 6.1.0 リリース</li>
<li>2014/12/12: Version 5.9.6 リリース</li>
</ul>
</dl>
<hr>
Expand Down
2 changes: 1 addition & 1 deletion src/gperf_unfold_key_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def parse_line(s):
if r != s: return r
r = re.sub(REG_GET_CODE, 'OnigCodePoint gcode = wordlist[key].code;', s)
if r != s: return r
r = re.sub(REG_CODE_CHECK, 'if (code == gcode)', s)
r = re.sub(REG_CODE_CHECK, 'if (code == gcode && wordlist[key].index >= 0)', s)
if r != s: return r

return s
Expand Down
3 changes: 2 additions & 1 deletion src/oniguruma.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern "C" {

#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 6
#define ONIGURUMA_VERSION_MINOR 2
#define ONIGURUMA_VERSION_MINOR 3
#define ONIGURUMA_VERSION_TEENY 0

#ifdef __cplusplus
Expand Down Expand Up @@ -473,6 +473,7 @@ ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;
#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
#define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{1OOOOOOOOOO} */

#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
Expand Down
98 changes: 49 additions & 49 deletions src/regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
regcomp.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* Copyright (c) 2002-2017 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -761,17 +761,17 @@ compile_length_quantifier_node(QtfrNode* qn, regex_t* reg)
if (infinite && qn->lower <= 1) {
if (qn->greedy) {
if (qn->lower == 1)
len = SIZE_OP_JUMP;
len = SIZE_OP_JUMP;
else
len = 0;
len = 0;

len += SIZE_OP_PUSH + cklen + mod_tlen + SIZE_OP_JUMP;
}
else {
if (qn->lower == 0)
len = SIZE_OP_JUMP;
len = SIZE_OP_JUMP;
else
len = 0;
len = 0;

len += mod_tlen + SIZE_OP_PUSH + cklen;
}
Expand All @@ -785,10 +785,10 @@ compile_length_quantifier_node(QtfrNode* qn, regex_t* reg)
else if (qn->upper == 1 && qn->greedy) {
if (qn->lower == 0) {
if (CKN_ON) {
len = SIZE_OP_STATE_CHECK_PUSH + tlen;
len = SIZE_OP_STATE_CHECK_PUSH + tlen;
}
else {
len = SIZE_OP_PUSH + tlen;
len = SIZE_OP_PUSH + tlen;
}
}
else {
Expand Down Expand Up @@ -1255,7 +1255,7 @@ compile_length_enclose_node(EncloseNode* node, regex_t* reg)
if (tlen < 0) return tlen;

len = tlen * qn->lower
+ SIZE_OP_PUSH + tlen + SIZE_OP_POP + SIZE_OP_JUMP;
+ SIZE_OP_PUSH + tlen + SIZE_OP_POP + SIZE_OP_JUMP;
}
else {
len = SIZE_OP_PUSH_STOP_BT + tlen + SIZE_OP_POP_STOP_BT;
Expand Down Expand Up @@ -1362,7 +1362,7 @@ compile_enclose_node(EncloseNode* node, regex_t* reg)
r = add_opcode(reg, OP_POP);
if (r) return r;
r = add_opcode_rel_addr(reg, OP_JUMP,
-((int )SIZE_OP_PUSH + len + (int )SIZE_OP_POP + (int )SIZE_OP_JUMP));
-((int )SIZE_OP_PUSH + len + (int )SIZE_OP_POP + (int )SIZE_OP_JUMP));
}
else {
r = add_opcode(reg, OP_PUSH_STOP_BT);
Expand Down Expand Up @@ -2145,16 +2145,16 @@ get_char_length_tree1(Node* node, regex_t* reg, int* len, int level)
switch (en->type) {
case ENCLOSE_MEMORY:
#ifdef USE_SUBEXP_CALL
if (IS_ENCLOSE_CLEN_FIXED(en))
*len = en->char_len;
else {
r = get_char_length_tree1(en->target, reg, len, level);
if (r == 0) {
en->char_len = *len;
SET_ENCLOSE_STATUS(node, NST_CLEN_FIXED);
}
}
break;
if (IS_ENCLOSE_CLEN_FIXED(en))
*len = en->char_len;
else {
r = get_char_length_tree1(en->target, reg, len, level);
if (r == 0) {
en->char_len = *len;
SET_ENCLOSE_STATUS(node, NST_CLEN_FIXED);
}
}
break;
#endif
case ENCLOSE_OPTION:
case ENCLOSE_STOP_BACKTRACK:
Expand Down Expand Up @@ -2594,17 +2594,17 @@ get_min_len(Node* node, OnigLen *min, ScanEnv* env)
if (IS_ENCLOSE_MIN_FIXED(en))
*min = en->min_len;
else {
if (IS_ENCLOSE_MARK1(NENCLOSE(node)))
*min = 0; // recursive
else {
SET_ENCLOSE_STATUS(node, NST_MARK1);
r = get_min_len(en->target, min, env);
CLEAR_ENCLOSE_STATUS(node, NST_MARK1);
if (r == 0) {
en->min_len = *min;
SET_ENCLOSE_STATUS(node, NST_MIN_FIXED);
}
}
if (IS_ENCLOSE_MARK1(NENCLOSE(node)))
*min = 0; // recursive
else {
SET_ENCLOSE_STATUS(node, NST_MARK1);
r = get_min_len(en->target, min, env);
CLEAR_ENCLOSE_STATUS(node, NST_MARK1);
if (r == 0) {
en->min_len = *min;
SET_ENCLOSE_STATUS(node, NST_MIN_FIXED);
}
}
}
break;

Expand Down Expand Up @@ -2713,22 +2713,22 @@ get_max_len(Node* node, OnigLen *max, ScanEnv* env)
EncloseNode* en = NENCLOSE(node);
switch (en->type) {
case ENCLOSE_MEMORY:
if (IS_ENCLOSE_MAX_FIXED(en))
*max = en->max_len;
else {
if (IS_ENCLOSE_MARK1(NENCLOSE(node)))
*max = ONIG_INFINITE_DISTANCE;
else {
SET_ENCLOSE_STATUS(node, NST_MARK1);
r = get_max_len(en->target, max, env);
CLEAR_ENCLOSE_STATUS(node, NST_MARK1);
if (r == 0) {
en->max_len = *max;
SET_ENCLOSE_STATUS(node, NST_MAX_FIXED);
}
}
}
break;
if (IS_ENCLOSE_MAX_FIXED(en))
*max = en->max_len;
else {
if (IS_ENCLOSE_MARK1(NENCLOSE(node)))
*max = ONIG_INFINITE_DISTANCE;
else {
SET_ENCLOSE_STATUS(node, NST_MARK1);
r = get_max_len(en->target, max, env);
CLEAR_ENCLOSE_STATUS(node, NST_MARK1);
if (r == 0) {
en->max_len = *max;
SET_ENCLOSE_STATUS(node, NST_MAX_FIXED);
}
}
}
break;

case ENCLOSE_OPTION:
case ENCLOSE_STOP_BACKTRACK:
Expand Down Expand Up @@ -4559,7 +4559,7 @@ concat_left_node_opt_info(OnigEncoding enc, NodeOptInfo* to, NodeOptInfo* add)
if (to->expr.len > 0) {
if (add->len.max > 0) {
if (to->expr.len > (int )add->len.max)
to->expr.len = add->len.max;
to->expr.len = add->len.max;

if (to->expr.mmd.max == 0)
select_opt_exact_info(enc, &to->exb, &to->expr);
Expand Down Expand Up @@ -4957,7 +4957,7 @@ set_optimize_exact_info(regex_t* reg, OptExactInfo* e)
reg->exact_end = reg->exact + e->len;

allow_reverse =
ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end);
ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end);

if (e->len >= 3 || (e->len >= 2 && allow_reverse)) {
r = set_bm_skip(reg->exact, reg->exact_end, reg->enc,
Expand Down Expand Up @@ -5045,7 +5045,7 @@ set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env)
if (opt.exb.len > 0 || opt.exm.len > 0) {
select_opt_exact_info(reg->enc, &opt.exb, &opt.exm);
if (opt.map.value > 0 &&
comp_opt_exact_or_map_info(&opt.exb, &opt.map) > 0) {
comp_opt_exact_or_map_info(&opt.exb, &opt.map) > 0) {
goto set_map;
}
else {
Expand Down
Loading

0 comments on commit 7f5aa49

Please sign in to comment.