aboutsummaryrefslogtreecommitdiffstats
path: root/regint.h
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-11 15:08:33 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-11 15:08:33 +0000
commit6b1c6e0e55707c78f7dba05e3f005269aa78fa3f (patch)
tree69e97c4465966bc427f9569dd8664562aa456662 /regint.h
parent238b9276decab770a18138ebc298fa7172f2a047 (diff)
downloadruby-6b1c6e0e55707c78f7dba05e3f005269aa78fa3f.tar.gz
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/trunk@57603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regint.h')
-rw-r--r--regint.h15
1 files changed, 13 insertions, 2 deletions
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, /* (?<!...) start */
OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end */
+ OP_PUSH_ABSENT_POS, /* (?~...) start */
+ OP_ABSENT, /* (?~...) start of inner loop */
+ OP_ABSENT_END, /* (?~...) end */
OP_CALL, /* \g<name> */
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;