From 5398ef4904fb49b1088a2578f9be4b3ab4164550 Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 13 Mar 2017 09:05:46 +0000 Subject: merge revision(s) 57603: [Backport #12997] Merge Onigmo 6.1.1 * Support absent operator https://github.com/k-takata/Onigmo/issues/82 * https://github.com/k-takata/Onigmo/blob/Onigmo-6.1.1/HISTORY git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regint.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'regint.h') diff --git a/regint.h b/regint.h index 624deea864..a2f5bbba1d 100644 --- a/regint.h +++ b/regint.h @@ -202,7 +202,9 @@ #define xmemcpy memcpy #define xmemmove memmove -#if defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 90 && !defined(__GNUC__) +#if ((defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 90) \ + || (!defined(RUBY_MSVCRT_VERSION) && defined(_WIN32))) \ + && !defined(__GNUC__) # define xalloca _alloca # define xvsnprintf(buf,size,fmt,args) _vsnprintf_s(buf,size,_TRUNCATE,fmt,args) # define xsnprintf sprintf_s @@ -598,7 +600,6 @@ enum OpCode { OP_END_LINE, OP_SEMI_END_BUF, OP_BEGIN_POSITION, - OP_BEGIN_POS_OR_LINE, /* used for implicit anchor optimization */ OP_BACKREF1, OP_BACKREF2, @@ -643,6 +644,9 @@ enum OpCode { OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */ OP_PUSH_LOOK_BEHIND_NOT, /* (? */ OP_RETURN, @@ -730,6 +734,9 @@ typedef void* PointerType; #define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR) #define SIZE_OP_RETURN SIZE_OPCODE #define SIZE_OP_CONDITION (SIZE_OPCODE + SIZE_MEMNUM + SIZE_RELADDR) +#define SIZE_OP_PUSH_ABSENT_POS SIZE_OPCODE +#define SIZE_OP_ABSENT (SIZE_OPCODE + SIZE_RELADDR) +#define SIZE_OP_ABSENT_END SIZE_OPCODE #ifdef USE_COMBINATION_EXPLOSION_CHECK # define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM) @@ -841,6 +848,10 @@ typedef struct _OnigStackType { UChar *pstr; /* string position */ } call_frame; #endif + struct { + UChar *abs_pstr; /* absent start position */ + const UChar *end_pstr; /* end position */ + } absent_pos; } u; } OnigStackType; -- cgit v1.2.3