summaryrefslogtreecommitdiff
path: root/regint.h
diff options
context:
space:
mode:
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;