debase-ruby_core_source 0.9.9 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/addr2line.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/build_assert/build_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/check_type/check_type.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/container_of/container_of.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/ccan/list/list.h +28 -166
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/str/str.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/constant.h +3 -10
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/dln.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/eval_intern.h +49 -89
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/gc.h +1 -8
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/id.h +5 -15
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/insns.inc +107 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/insns_info.inc +45 -89
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/internal.h +164 -666
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/iseq.h +158 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/known_errors.inc +0 -0
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/method.h +144 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/node.h +42 -18
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/node_name.inc +6 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/opt_sc.inc +0 -40
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/optinsn.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/optunifs.inc +0 -5
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/parse.h +8 -28
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/probes_helper.h +67 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/regenc.h +16 -16
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/regint.h +10 -33
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/regparse.h +1 -5
- data/lib/debase/ruby_core_source/ruby-2.2.8-p477/revision.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/ruby_atomic.h +5 -68
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/siphash.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/symbol.h +13 -33
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/thread_pthread.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/thread_win32.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/timev.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/transcode_data.h +7 -23
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/version.h +10 -31
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/vm.inc +497 -542
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/vm_core.h +305 -784
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/vm_debug.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/vm_exec.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/vm_insnhelper.h +56 -50
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/vm_opts.h +7 -8
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/vmtc.inc +0 -5
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/addr2line.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/build_assert/build_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/check_type/check_type.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/container_of/container_of.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/ccan/list/list.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/str/str.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/constant.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/dln.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/encindex.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/eval_intern.h +3 -4
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/gc.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/id.h +0 -9
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/id_table.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/insns.inc +46 -48
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/insns_info.inc +0 -20
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/internal.h +58 -290
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/iseq.h +15 -18
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/known_errors.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/method.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/node.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/node_name.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/opt_sc.inc +0 -16
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/optinsn.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/optunifs.inc +0 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/parse.h +8 -27
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/probes_helper.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/regenc.h +14 -14
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/regint.h +0 -8
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/regparse.h +0 -0
- data/lib/debase/ruby_core_source/ruby-2.3.5-p376/revision.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/ruby_atomic.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/siphash.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/symbol.h +3 -3
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/thread_pthread.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/thread_win32.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/timev.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/transcode_data.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/version.h +9 -27
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm.inc +255 -264
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_call_iseq_optimized.inc +5 -5
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_core.h +37 -28
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/vm_debug.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/vm_exec.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_insnhelper.h +32 -16
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_opts.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/vmtc.inc +0 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/addr2line.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/build_assert/build_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/check_type/check_type.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/container_of/container_of.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/ccan/list/list.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/str/str.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/constant.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/dln.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/encindex.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/eval_intern.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/gc.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/id.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/id_table.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/insns.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/insns_info.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/internal.h +116 -51
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/iseq.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/known_errors.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/method.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/node.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/node_name.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/opt_sc.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/optinsn.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/optunifs.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/parse.h +8 -27
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/probes_helper.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/regenc.h +79 -67
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/regint.h +187 -244
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/regparse.h +30 -27
- data/lib/debase/ruby_core_source/ruby-2.4.2-p198/revision.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/ruby_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/ruby_atomic.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/siphash.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/symbol.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/thread_pthread.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/thread_win32.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/timev.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/transcode_data.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/version.h +6 -6
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm.inc +37 -34
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/vm_call_iseq_optimized.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_core.h +9 -7
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_debug.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_exec.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_insnhelper.h +30 -14
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/vm_opts.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/vmtc.inc +0 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +138 -143
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview1/method.h +0 -213
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview1/revision.h +0 -1
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview2/revision.h +0 -1
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview2/ruby_assert.h +0 -54
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/encindex.h +0 -67
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/id_table.h +0 -31
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/insns.inc +0 -112
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/iseq.h +0 -252
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/probes_helper.h +0 -43
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/revision.h +0 -1
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/ruby_assert.h +0 -54
- data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/vm_call_iseq_optimized.inc +0 -212
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
node.h -
|
|
4
4
|
|
|
5
|
-
$Author:
|
|
5
|
+
$Author: nagachika $
|
|
6
6
|
created at: Fri May 28 15:14:02 JST 1993
|
|
7
7
|
|
|
8
8
|
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
|
@@ -277,7 +277,7 @@ typedef struct RNode {
|
|
|
277
277
|
|
|
278
278
|
#define NODE_LSHIFT (NODE_TYPESHIFT+7)
|
|
279
279
|
#define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1)
|
|
280
|
-
#define nd_line(n) (int)(RNODE(n)->flags>>NODE_LSHIFT)
|
|
280
|
+
#define nd_line(n) (int)(((SIGNED_VALUE)RNODE(n)->flags)>>NODE_LSHIFT)
|
|
281
281
|
#define nd_set_line(n,l) \
|
|
282
282
|
RNODE(n)->flags=((RNODE(n)->flags&~((VALUE)(-1)<<NODE_LSHIFT))|((VALUE)((l)&NODE_LMASK)<<NODE_LSHIFT))
|
|
283
283
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* A Bison parser, made by GNU Bison 2.
|
|
1
|
+
/* A Bison parser, made by GNU Bison 2.5. */
|
|
2
2
|
|
|
3
3
|
/* Bison interface for Yacc-like parsers in C
|
|
4
4
|
|
|
5
|
-
Copyright (C) 1984, 1989-1990, 2000-
|
|
5
|
+
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
|
|
6
6
|
|
|
7
7
|
This program is free software: you can redistribute it and/or modify
|
|
8
8
|
it under the terms of the GNU General Public License as published by
|
|
@@ -30,15 +30,6 @@
|
|
|
30
30
|
This special exception was added by the Free Software Foundation in
|
|
31
31
|
version 2.2 of Bison. */
|
|
32
32
|
|
|
33
|
-
#ifndef YY_YY_Y_TAB_H_INCLUDED
|
|
34
|
-
# define YY_YY_Y_TAB_H_INCLUDED
|
|
35
|
-
/* Enabling traces. */
|
|
36
|
-
#ifndef YYDEBUG
|
|
37
|
-
# define YYDEBUG 0
|
|
38
|
-
#endif
|
|
39
|
-
#if YYDEBUG
|
|
40
|
-
extern int yydebug;
|
|
41
|
-
#endif
|
|
42
33
|
|
|
43
34
|
/* Tokens. */
|
|
44
35
|
#ifndef YYTOKENTYPE
|
|
@@ -167,10 +158,12 @@ extern int yydebug;
|
|
|
167
158
|
#endif
|
|
168
159
|
|
|
169
160
|
|
|
161
|
+
|
|
170
162
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
|
171
163
|
typedef union YYSTYPE
|
|
172
164
|
{
|
|
173
|
-
|
|
165
|
+
|
|
166
|
+
/* Line 2068 of yacc.c */
|
|
174
167
|
|
|
175
168
|
VALUE val;
|
|
176
169
|
NODE *node;
|
|
@@ -179,7 +172,8 @@ typedef union YYSTYPE
|
|
|
179
172
|
const struct vtable *vars;
|
|
180
173
|
|
|
181
174
|
|
|
182
|
-
|
|
175
|
+
|
|
176
|
+
/* Line 2068 of yacc.c */
|
|
183
177
|
} YYSTYPE;
|
|
184
178
|
# define YYSTYPE_IS_TRIVIAL 1
|
|
185
179
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
|
@@ -187,18 +181,5 @@ typedef union YYSTYPE
|
|
|
187
181
|
#endif
|
|
188
182
|
|
|
189
183
|
|
|
190
|
-
#ifdef YYPARSE_PARAM
|
|
191
|
-
#if defined __STDC__ || defined __cplusplus
|
|
192
|
-
int yyparse (void *YYPARSE_PARAM);
|
|
193
|
-
#else
|
|
194
|
-
int yyparse ();
|
|
195
|
-
#endif
|
|
196
|
-
#else /* ! YYPARSE_PARAM */
|
|
197
|
-
#if defined __STDC__ || defined __cplusplus
|
|
198
|
-
int yyparse (struct parser_params *parser);
|
|
199
|
-
#else
|
|
200
|
-
int yyparse ();
|
|
201
|
-
#endif
|
|
202
|
-
#endif /* ! YYPARSE_PARAM */
|
|
203
184
|
|
|
204
|
-
|
|
185
|
+
|
|
File without changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#ifndef
|
|
2
|
-
#define
|
|
1
|
+
#ifndef ONIGMO_REGENC_H
|
|
2
|
+
#define ONIGMO_REGENC_H
|
|
3
3
|
/**********************************************************************
|
|
4
4
|
regenc.h - Onigmo (Oniguruma-mod) (regular expression library)
|
|
5
5
|
**********************************************************************/
|
|
6
6
|
/*-
|
|
7
7
|
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
|
8
|
-
* Copyright (c) 2011
|
|
8
|
+
* Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp>
|
|
9
9
|
* All rights reserved.
|
|
10
10
|
*
|
|
11
11
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -30,18 +30,32 @@
|
|
|
30
30
|
* SUCH DAMAGE.
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#include "ruby/config.h"
|
|
36
|
-
#include "ruby/defines.h"
|
|
37
|
-
#endif
|
|
33
|
+
#if !defined(RUBY) && (defined(RUBY_EXPORT) || defined(ONIG_ENC_REGISTER))
|
|
34
|
+
# define RUBY
|
|
38
35
|
#endif
|
|
36
|
+
#ifdef RUBY
|
|
37
|
+
# ifndef ONIGMO_REGINT_H
|
|
38
|
+
# ifndef RUBY_EXTERN
|
|
39
|
+
# include "ruby/config.h"
|
|
40
|
+
# include "ruby/defines.h"
|
|
41
|
+
# endif
|
|
42
|
+
# endif
|
|
43
|
+
#else /* RUBY */
|
|
44
|
+
# ifndef PACKAGE
|
|
45
|
+
/* PACKAGE is defined in config.h */
|
|
46
|
+
# include "config.h"
|
|
47
|
+
# endif
|
|
48
|
+
#endif /* RUBY */
|
|
39
49
|
|
|
40
50
|
#ifdef ONIG_ESCAPE_UCHAR_COLLISION
|
|
41
|
-
#undef ONIG_ESCAPE_UCHAR_COLLISION
|
|
51
|
+
# undef ONIG_ESCAPE_UCHAR_COLLISION
|
|
42
52
|
#endif
|
|
43
53
|
|
|
44
|
-
#
|
|
54
|
+
#ifdef RUBY
|
|
55
|
+
# include "ruby/onigmo.h"
|
|
56
|
+
#else
|
|
57
|
+
# include "onigmo.h"
|
|
58
|
+
#endif
|
|
45
59
|
|
|
46
60
|
RUBY_SYMBOL_EXPORT_BEGIN
|
|
47
61
|
|
|
@@ -52,23 +66,23 @@ typedef struct {
|
|
|
52
66
|
|
|
53
67
|
|
|
54
68
|
#ifndef NULL
|
|
55
|
-
#define NULL ((void* )0)
|
|
69
|
+
# define NULL ((void* )0)
|
|
56
70
|
#endif
|
|
57
71
|
|
|
58
72
|
#ifndef TRUE
|
|
59
|
-
#define TRUE 1
|
|
73
|
+
# define TRUE 1
|
|
60
74
|
#endif
|
|
61
75
|
|
|
62
76
|
#ifndef FALSE
|
|
63
|
-
#define FALSE 0
|
|
77
|
+
# define FALSE 0
|
|
64
78
|
#endif
|
|
65
79
|
|
|
66
80
|
#ifndef ARG_UNUSED
|
|
67
|
-
#if defined(__GNUC__)
|
|
81
|
+
# if defined(__GNUC__)
|
|
68
82
|
# define ARG_UNUSED __attribute__ ((unused))
|
|
69
|
-
#else
|
|
83
|
+
# else
|
|
70
84
|
# define ARG_UNUSED
|
|
71
|
-
#endif
|
|
85
|
+
# endif
|
|
72
86
|
#endif
|
|
73
87
|
|
|
74
88
|
#define ONIG_IS_NULL(p) (((void*)(p)) == (void*)0)
|
|
@@ -111,7 +125,7 @@ typedef struct {
|
|
|
111
125
|
{(short int )(sizeof(name) - 1), (name), (ctype)}
|
|
112
126
|
|
|
113
127
|
#ifndef numberof
|
|
114
|
-
#define numberof(array) (int )(sizeof(array) / sizeof((array)[0]))
|
|
128
|
+
# define numberof(array) (int )(sizeof(array) / sizeof((array)[0]))
|
|
115
129
|
#endif
|
|
116
130
|
|
|
117
131
|
|
|
@@ -125,58 +139,56 @@ typedef struct {
|
|
|
125
139
|
#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII
|
|
126
140
|
|
|
127
141
|
/* for encoding system implementation (internal) */
|
|
128
|
-
ONIG_EXTERN int onigenc_ascii_apply_all_case_fold
|
|
129
|
-
ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str
|
|
130
|
-
ONIG_EXTERN int onigenc_apply_all_case_fold_with_map
|
|
131
|
-
ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
#ifdef ONIG_CASE_MAPPING
|
|
136
|
-
ONIG_EXTERN int onigenc_single_byte_ascii_only_case_map P_((OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc));
|
|
137
|
-
#endif /* ONIG_CASE_MAPPING */
|
|
142
|
+
ONIG_EXTERN int onigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc);
|
|
143
|
+
ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc);
|
|
144
|
+
ONIG_EXTERN int onigenc_apply_all_case_fold_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg);
|
|
145
|
+
ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]);
|
|
146
|
+
ONIG_EXTERN int onigenc_not_support_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc);
|
|
147
|
+
ONIG_EXTERN int onigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end, OnigEncoding enc);
|
|
148
|
+
ONIG_EXTERN int onigenc_single_byte_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc);
|
|
138
149
|
|
|
139
150
|
|
|
140
151
|
/* methods for single byte encoding */
|
|
141
|
-
ONIG_EXTERN int onigenc_ascii_mbc_case_fold
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
ONIG_EXTERN int onigenc_single_byte_code_to_mbc
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
ONIG_EXTERN int onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower, OnigEncoding enc);
|
|
153
|
+
ONIG_EXTERN int onigenc_single_byte_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc);
|
|
154
|
+
ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc);
|
|
155
|
+
ONIG_EXTERN int onigenc_single_byte_code_to_mbclen(OnigCodePoint code, OnigEncoding enc);
|
|
156
|
+
ONIG_EXTERN int onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc);
|
|
157
|
+
ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head(const UChar* start, const UChar* s, const OnigUChar* end, OnigEncoding enc);
|
|
158
|
+
ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc);
|
|
159
|
+
ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc);
|
|
160
|
+
ONIG_EXTERN int onigenc_ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc);
|
|
150
161
|
|
|
151
162
|
/* methods for multi byte encoding */
|
|
152
|
-
ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code
|
|
153
|
-
ONIG_EXTERN int onigenc_mbn_mbc_case_fold
|
|
154
|
-
|
|
155
|
-
ONIG_EXTERN int onigenc_mb2_code_to_mbc
|
|
156
|
-
ONIG_EXTERN int onigenc_minimum_property_name_to_ctype
|
|
157
|
-
ONIG_EXTERN int onigenc_unicode_property_name_to_ctype
|
|
158
|
-
ONIG_EXTERN int onigenc_mb2_is_code_ctype
|
|
159
|
-
|
|
160
|
-
ONIG_EXTERN int onigenc_mb4_code_to_mbc
|
|
161
|
-
ONIG_EXTERN int onigenc_mb4_is_code_ctype
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
ONIG_EXTERN int onigenc_unicode_case_map P_((OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc));
|
|
165
|
-
#endif /* ONIG_CASE_MAPPING */
|
|
163
|
+
ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end);
|
|
164
|
+
ONIG_EXTERN int onigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower);
|
|
165
|
+
ONIG_EXTERN int onigenc_mb2_code_to_mbclen(OnigCodePoint code, OnigEncoding enc);
|
|
166
|
+
ONIG_EXTERN int onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf);
|
|
167
|
+
ONIG_EXTERN int onigenc_minimum_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end);
|
|
168
|
+
ONIG_EXTERN int onigenc_unicode_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end);
|
|
169
|
+
ONIG_EXTERN int onigenc_mb2_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype);
|
|
170
|
+
ONIG_EXTERN int onigenc_mb4_code_to_mbclen(OnigCodePoint code, OnigEncoding enc);
|
|
171
|
+
ONIG_EXTERN int onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf);
|
|
172
|
+
ONIG_EXTERN int onigenc_mb4_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype);
|
|
173
|
+
|
|
174
|
+
ONIG_EXTERN int onigenc_unicode_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc);
|
|
166
175
|
|
|
167
176
|
|
|
168
177
|
/* in enc/unicode.c */
|
|
169
|
-
ONIG_EXTERN int onigenc_unicode_is_code_ctype
|
|
170
|
-
ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range
|
|
171
|
-
ONIG_EXTERN int onigenc_unicode_ctype_code_range
|
|
172
|
-
ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str
|
|
173
|
-
ONIG_EXTERN int onigenc_unicode_mbc_case_fold
|
|
174
|
-
ONIG_EXTERN int onigenc_unicode_apply_all_case_fold
|
|
178
|
+
ONIG_EXTERN int onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc);
|
|
179
|
+
ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[], OnigEncoding enc);
|
|
180
|
+
ONIG_EXTERN int onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[]);
|
|
181
|
+
ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]);
|
|
182
|
+
ONIG_EXTERN int onigenc_unicode_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold);
|
|
183
|
+
ONIG_EXTERN int onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc);
|
|
175
184
|
|
|
176
185
|
|
|
177
186
|
#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8)
|
|
178
187
|
#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc)
|
|
179
188
|
#define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8)
|
|
189
|
+
#define UNICODE_VALID_CODEPOINT_P(c) ( \
|
|
190
|
+
((c) <= 0x10ffff) && \
|
|
191
|
+
!((c) < 0x10000 && UTF16_IS_SURROGATE((c) >> 8)))
|
|
180
192
|
|
|
181
193
|
#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \
|
|
182
194
|
OnigEncISO_8859_1_ToLowerCaseTable[c]
|
|
@@ -187,14 +199,14 @@ ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[];
|
|
|
187
199
|
ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[];
|
|
188
200
|
|
|
189
201
|
ONIG_EXTERN int
|
|
190
|
-
onigenc_with_ascii_strncmp
|
|
202
|
+
onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n);
|
|
191
203
|
ONIG_EXTERN int
|
|
192
|
-
onigenc_with_ascii_strnicmp
|
|
204
|
+
onigenc_with_ascii_strnicmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n);
|
|
193
205
|
ONIG_EXTERN UChar*
|
|
194
|
-
onigenc_step
|
|
206
|
+
onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n);
|
|
195
207
|
|
|
196
208
|
/* defined in regexec.c, but used in enc/xxx.c */
|
|
197
|
-
extern int onig_is_in_code_range
|
|
209
|
+
extern int onig_is_in_code_range(const UChar* p, OnigCodePoint code);
|
|
198
210
|
|
|
199
211
|
ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
|
|
200
212
|
ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[];
|
|
@@ -217,9 +229,9 @@ ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[];
|
|
|
217
229
|
|
|
218
230
|
#ifdef ONIG_ENC_REGISTER
|
|
219
231
|
extern int ONIG_ENC_REGISTER(const char *, OnigEncoding);
|
|
220
|
-
#define OnigEncodingName(n) encoding_##n
|
|
221
|
-
#define OnigEncodingDeclare(n) static const OnigEncodingType OnigEncodingName(n)
|
|
222
|
-
#define OnigEncodingDefine(f,n) \
|
|
232
|
+
# define OnigEncodingName(n) encoding_##n
|
|
233
|
+
# define OnigEncodingDeclare(n) static const OnigEncodingType OnigEncodingName(n)
|
|
234
|
+
# define OnigEncodingDefine(f,n) \
|
|
223
235
|
OnigEncodingDeclare(n); \
|
|
224
236
|
void Init_##f(void) { \
|
|
225
237
|
ONIG_ENC_REGISTER(OnigEncodingName(n).name, \
|
|
@@ -227,9 +239,9 @@ extern int ONIG_ENC_REGISTER(const char *, OnigEncoding);
|
|
|
227
239
|
} \
|
|
228
240
|
OnigEncodingDeclare(n)
|
|
229
241
|
#else
|
|
230
|
-
#define OnigEncodingName(n) OnigEncoding##n
|
|
231
|
-
#define OnigEncodingDeclare(n) const OnigEncodingType OnigEncodingName(n)
|
|
232
|
-
#define OnigEncodingDefine(f,n) OnigEncodingDeclare(n)
|
|
242
|
+
# define OnigEncodingName(n) OnigEncoding##n
|
|
243
|
+
# define OnigEncodingDeclare(n) const OnigEncodingType OnigEncodingName(n)
|
|
244
|
+
# define OnigEncodingDefine(f,n) OnigEncodingDeclare(n)
|
|
233
245
|
#endif
|
|
234
246
|
|
|
235
247
|
/* macros for define replica encoding and encoding alias */
|
|
@@ -239,4 +251,4 @@ extern int ONIG_ENC_REGISTER(const char *, OnigEncoding);
|
|
|
239
251
|
|
|
240
252
|
RUBY_SYMBOL_EXPORT_END
|
|
241
253
|
|
|
242
|
-
#endif /*
|
|
254
|
+
#endif /* ONIGMO_REGENC_H */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#ifndef
|
|
2
|
-
#define
|
|
1
|
+
#ifndef ONIGMO_REGINT_H
|
|
2
|
+
#define ONIGMO_REGINT_H
|
|
3
3
|
/**********************************************************************
|
|
4
4
|
regint.h - Onigmo (Oniguruma-mod) (regular expression library)
|
|
5
5
|
**********************************************************************/
|
|
6
6
|
/*-
|
|
7
7
|
* Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
|
8
|
-
* Copyright (c) 2011-
|
|
8
|
+
* Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp>
|
|
9
9
|
* All rights reserved.
|
|
10
10
|
*
|
|
11
11
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
/* #define ONIG_DEBUG_COMPILE */
|
|
36
36
|
/* #define ONIG_DEBUG_SEARCH */
|
|
37
37
|
/* #define ONIG_DEBUG_MATCH */
|
|
38
|
+
/* #define ONIG_DEBUG_MEMLEAK */
|
|
38
39
|
/* #define ONIG_DONT_OPTIMIZE */
|
|
39
40
|
|
|
40
41
|
/* for byte-code statistical data. */
|
|
@@ -42,25 +43,25 @@
|
|
|
42
43
|
|
|
43
44
|
#if defined(ONIG_DEBUG_PARSE_TREE) || defined(ONIG_DEBUG_MATCH) || \
|
|
44
45
|
defined(ONIG_DEBUG_SEARCH) || defined(ONIG_DEBUG_COMPILE) || \
|
|
45
|
-
defined(ONIG_DEBUG_STATISTICS)
|
|
46
|
-
#ifndef ONIG_DEBUG
|
|
47
|
-
#define ONIG_DEBUG
|
|
48
|
-
#endif
|
|
46
|
+
defined(ONIG_DEBUG_STATISTICS) || defined(ONIG_DEBUG_MEMLEAK)
|
|
47
|
+
# ifndef ONIG_DEBUG
|
|
48
|
+
# define ONIG_DEBUG
|
|
49
|
+
# endif
|
|
49
50
|
#endif
|
|
50
51
|
|
|
51
52
|
#ifndef UNALIGNED_WORD_ACCESS
|
|
52
|
-
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
#define UNALIGNED_WORD_ACCESS 1
|
|
57
|
-
#else
|
|
58
|
-
#define UNALIGNED_WORD_ACCESS 0
|
|
59
|
-
#endif
|
|
53
|
+
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
|
|
54
|
+
defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
|
|
55
|
+
defined(__powerpc64__) || \
|
|
56
|
+
defined(__mc68020__)
|
|
57
|
+
# define UNALIGNED_WORD_ACCESS 1
|
|
58
|
+
# else
|
|
59
|
+
# define UNALIGNED_WORD_ACCESS 0
|
|
60
|
+
# endif
|
|
60
61
|
#endif
|
|
61
62
|
|
|
62
63
|
#if UNALIGNED_WORD_ACCESS
|
|
63
|
-
#define PLATFORM_UNALIGNED_WORD_ACCESS
|
|
64
|
+
# define PLATFORM_UNALIGNED_WORD_ACCESS
|
|
64
65
|
#endif
|
|
65
66
|
|
|
66
67
|
/* config */
|
|
@@ -73,213 +74,165 @@
|
|
|
73
74
|
#define USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT /* /(?:()|())*\2/ */
|
|
74
75
|
#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */
|
|
75
76
|
#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
|
|
76
|
-
/* #define USE_RECOMPILE_API */
|
|
77
77
|
/* !!! moved to regenc.h. */ /* #define USE_CRNL_AS_LINE_TERMINATOR */
|
|
78
78
|
#define USE_NO_INVALID_QUANTIFIER
|
|
79
79
|
|
|
80
80
|
/* internal config */
|
|
81
|
-
#define
|
|
82
|
-
#define USE_OP_PUSH_OR_JUMP_EXACT
|
|
81
|
+
/* #define USE_OP_PUSH_OR_JUMP_EXACT */
|
|
83
82
|
#define USE_QTFR_PEEK_NEXT
|
|
84
83
|
#define USE_ST_LIBRARY
|
|
85
|
-
#define USE_SHARED_CCLASS_TABLE
|
|
86
84
|
#define USE_SUNDAY_QUICK_SEARCH
|
|
87
85
|
|
|
88
86
|
#define INIT_MATCH_STACK_SIZE 160
|
|
89
87
|
#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */
|
|
88
|
+
#define DEFAULT_PARSE_DEPTH_LIMIT 4096
|
|
89
|
+
|
|
90
|
+
#define OPT_EXACT_MAXLEN 24
|
|
90
91
|
|
|
91
92
|
/* check config */
|
|
92
93
|
#if defined(USE_PERL_SUBEXP_CALL) || defined(USE_CAPITAL_P_NAMED_GROUP)
|
|
93
|
-
#if !defined(USE_NAMED_GROUP) || !defined(USE_SUBEXP_CALL)
|
|
94
|
-
#error USE_NAMED_GROUP and USE_SUBEXP_CALL must be defined.
|
|
95
|
-
#endif
|
|
94
|
+
# if !defined(USE_NAMED_GROUP) || !defined(USE_SUBEXP_CALL)
|
|
95
|
+
# error USE_NAMED_GROUP and USE_SUBEXP_CALL must be defined.
|
|
96
|
+
# endif
|
|
96
97
|
#endif
|
|
97
98
|
|
|
98
99
|
#if defined(__GNUC__)
|
|
99
|
-
#
|
|
100
|
+
# define ARG_UNUSED __attribute__ ((unused))
|
|
100
101
|
#else
|
|
101
|
-
#
|
|
102
|
+
# define ARG_UNUSED
|
|
102
103
|
#endif
|
|
103
104
|
|
|
104
|
-
#
|
|
105
|
-
#
|
|
106
|
-
#undef xmalloc
|
|
107
|
-
#undef xrealloc
|
|
108
|
-
#undef xcalloc
|
|
109
|
-
#undef xfree
|
|
105
|
+
#if !defined(RUBY) && defined(RUBY_EXPORT)
|
|
106
|
+
# define RUBY
|
|
110
107
|
#endif
|
|
108
|
+
#ifdef RUBY
|
|
109
|
+
# ifndef RUBY_DEFINES_H
|
|
110
|
+
# include "ruby/ruby.h"
|
|
111
|
+
# undef xmalloc
|
|
112
|
+
# undef xrealloc
|
|
113
|
+
# undef xcalloc
|
|
114
|
+
# undef xfree
|
|
115
|
+
# endif
|
|
116
|
+
#else /* RUBY */
|
|
117
|
+
# include "config.h"
|
|
118
|
+
# if SIZEOF_LONG_LONG > 0
|
|
119
|
+
# define LONG_LONG long long
|
|
120
|
+
# endif
|
|
121
|
+
#endif /* RUBY */
|
|
122
|
+
|
|
123
|
+
#include <stdarg.h>
|
|
111
124
|
|
|
112
125
|
/* */
|
|
113
126
|
/* escape other system UChar definition */
|
|
114
127
|
#ifdef ONIG_ESCAPE_UCHAR_COLLISION
|
|
115
|
-
#undef ONIG_ESCAPE_UCHAR_COLLISION
|
|
128
|
+
# undef ONIG_ESCAPE_UCHAR_COLLISION
|
|
116
129
|
#endif
|
|
117
130
|
|
|
118
131
|
#define USE_WORD_BEGIN_END /* "\<": word-begin, "\>": word-end */
|
|
119
|
-
#
|
|
132
|
+
#ifdef RUBY
|
|
133
|
+
# undef USE_CAPTURE_HISTORY
|
|
134
|
+
#else
|
|
135
|
+
# define USE_CAPTURE_HISTORY
|
|
136
|
+
#endif
|
|
120
137
|
#define USE_VARIABLE_META_CHARS
|
|
121
|
-
#define USE_POSIX_API_REGION_OPTION /* needed for POSIX API support */
|
|
122
138
|
#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
|
|
123
139
|
/* #define USE_COMBINATION_EXPLOSION_CHECK */ /* (X*)* */
|
|
124
140
|
|
|
125
|
-
/* multithread config */
|
|
126
|
-
/* #define USE_MULTI_THREAD_SYSTEM */
|
|
127
|
-
/* #define USE_DEFAULT_MULTI_THREAD_SYSTEM */
|
|
128
|
-
|
|
129
|
-
#if defined(USE_MULTI_THREAD_SYSTEM) \
|
|
130
|
-
&& defined(USE_DEFAULT_MULTI_THREAD_SYSTEM)
|
|
131
|
-
|
|
132
|
-
#ifdef _WIN32
|
|
133
|
-
#define WIN32_LEAN_AND_MEAN
|
|
134
|
-
#include <windows.h>
|
|
135
|
-
extern CRITICAL_SECTION gOnigMutex;
|
|
136
|
-
#define THREAD_SYSTEM_INIT InitializeCriticalSection(&gOnigMutex)
|
|
137
|
-
#define THREAD_SYSTEM_END DeleteCriticalSection(&gOnigMutex)
|
|
138
|
-
#define THREAD_ATOMIC_START EnterCriticalSection(&gOnigMutex)
|
|
139
|
-
#define THREAD_ATOMIC_END LeaveCriticalSection(&gOnigMutex)
|
|
140
|
-
#define THREAD_PASS Sleep(0)
|
|
141
|
-
#else /* _WIN32 */
|
|
142
|
-
#include <pthread.h>
|
|
143
|
-
#include <sched.h>
|
|
144
|
-
extern pthread_mutex_t gOnigMutex;
|
|
145
|
-
#define THREAD_SYSTEM_INIT pthread_mutex_init(&gOnigMutex, NULL)
|
|
146
|
-
#define THREAD_SYSTEM_END pthread_mutex_destroy(&gOnigMutex)
|
|
147
|
-
#define THREAD_ATOMIC_START pthread_mutex_lock(&gOnigMutex)
|
|
148
|
-
#define THREAD_ATOMIC_END pthread_mutex_unlock(&gOnigMutex)
|
|
149
|
-
#define THREAD_PASS sched_yield()
|
|
150
|
-
#endif /* _WIN32 */
|
|
151
|
-
|
|
152
|
-
#else /* USE_DEFAULT_MULTI_THREAD_SYSTEM */
|
|
153
|
-
|
|
154
|
-
#ifndef THREAD_SYSTEM_INIT
|
|
155
|
-
#define THREAD_SYSTEM_INIT /* depend on thread system */
|
|
156
|
-
#endif
|
|
157
|
-
#ifndef THREAD_SYSTEM_END
|
|
158
|
-
#define THREAD_SYSTEM_END /* depend on thread system */
|
|
159
|
-
#endif
|
|
160
|
-
#ifndef THREAD_ATOMIC_START
|
|
161
|
-
#define THREAD_ATOMIC_START /* depend on thread system */
|
|
162
|
-
#endif
|
|
163
|
-
#ifndef THREAD_ATOMIC_END
|
|
164
|
-
#define THREAD_ATOMIC_END /* depend on thread system */
|
|
165
|
-
#endif
|
|
166
|
-
#ifndef THREAD_PASS
|
|
167
|
-
#define THREAD_PASS /* depend on thread system */
|
|
168
|
-
#endif
|
|
169
|
-
|
|
170
|
-
#endif /* USE_DEFAULT_MULTI_THREAD_SYSTEM */
|
|
171
141
|
|
|
172
142
|
#ifndef xmalloc
|
|
173
|
-
#define xmalloc malloc
|
|
174
|
-
#define xrealloc realloc
|
|
175
|
-
#define xcalloc calloc
|
|
176
|
-
#define xfree free
|
|
143
|
+
# define xmalloc malloc
|
|
144
|
+
# define xrealloc realloc
|
|
145
|
+
# define xcalloc calloc
|
|
146
|
+
# define xfree free
|
|
177
147
|
#endif
|
|
178
148
|
|
|
179
149
|
#ifdef RUBY
|
|
180
150
|
|
|
181
|
-
#define CHECK_INTERRUPT_IN_MATCH_AT rb_thread_check_ints()
|
|
182
|
-
#define onig_st_init_table st_init_table
|
|
183
|
-
#define onig_st_init_table_with_size st_init_table_with_size
|
|
184
|
-
#define onig_st_init_numtable st_init_numtable
|
|
185
|
-
#define onig_st_init_numtable_with_size st_init_numtable_with_size
|
|
186
|
-
#define onig_st_init_strtable st_init_strtable
|
|
187
|
-
#define onig_st_init_strtable_with_size st_init_strtable_with_size
|
|
188
|
-
#define onig_st_delete st_delete
|
|
189
|
-
#define onig_st_delete_safe st_delete_safe
|
|
190
|
-
#define onig_st_insert st_insert
|
|
191
|
-
#define onig_st_lookup st_lookup
|
|
192
|
-
#define onig_st_foreach st_foreach
|
|
193
|
-
#define onig_st_add_direct st_add_direct
|
|
194
|
-
#define onig_st_free_table st_free_table
|
|
195
|
-
#define onig_st_cleanup_safe st_cleanup_safe
|
|
196
|
-
#define onig_st_copy st_copy
|
|
197
|
-
#define onig_st_nothing_key_clone st_nothing_key_clone
|
|
198
|
-
#define onig_st_nothing_key_free st_nothing_key_free
|
|
199
|
-
#define onig_st_is_member st_is_member
|
|
200
|
-
|
|
201
|
-
#define USE_UPPER_CASE_TABLE
|
|
202
|
-
#else
|
|
203
|
-
|
|
204
|
-
#define CHECK_INTERRUPT_IN_MATCH_AT
|
|
205
|
-
|
|
206
|
-
#define st_init_table onig_st_init_table
|
|
207
|
-
#define st_init_table_with_size onig_st_init_table_with_size
|
|
208
|
-
#define st_init_numtable onig_st_init_numtable
|
|
209
|
-
#define st_init_numtable_with_size onig_st_init_numtable_with_size
|
|
210
|
-
#define st_init_strtable onig_st_init_strtable
|
|
211
|
-
#define st_init_strtable_with_size onig_st_init_strtable_with_size
|
|
212
|
-
#define st_delete onig_st_delete
|
|
213
|
-
#define st_delete_safe onig_st_delete_safe
|
|
214
|
-
#define st_insert onig_st_insert
|
|
215
|
-
#define st_lookup onig_st_lookup
|
|
216
|
-
#define st_foreach onig_st_foreach
|
|
217
|
-
#define st_add_direct onig_st_add_direct
|
|
218
|
-
#define st_free_table onig_st_free_table
|
|
219
|
-
#define st_cleanup_safe onig_st_cleanup_safe
|
|
220
|
-
#define st_copy onig_st_copy
|
|
221
|
-
#define st_nothing_key_clone onig_st_nothing_key_clone
|
|
222
|
-
#define st_nothing_key_free onig_st_nothing_key_free
|
|
151
|
+
# define CHECK_INTERRUPT_IN_MATCH_AT rb_thread_check_ints()
|
|
152
|
+
# define onig_st_init_table st_init_table
|
|
153
|
+
# define onig_st_init_table_with_size st_init_table_with_size
|
|
154
|
+
# define onig_st_init_numtable st_init_numtable
|
|
155
|
+
# define onig_st_init_numtable_with_size st_init_numtable_with_size
|
|
156
|
+
# define onig_st_init_strtable st_init_strtable
|
|
157
|
+
# define onig_st_init_strtable_with_size st_init_strtable_with_size
|
|
158
|
+
# define onig_st_delete st_delete
|
|
159
|
+
# define onig_st_delete_safe st_delete_safe
|
|
160
|
+
# define onig_st_insert st_insert
|
|
161
|
+
# define onig_st_lookup st_lookup
|
|
162
|
+
# define onig_st_foreach st_foreach
|
|
163
|
+
# define onig_st_add_direct st_add_direct
|
|
164
|
+
# define onig_st_free_table st_free_table
|
|
165
|
+
# define onig_st_cleanup_safe st_cleanup_safe
|
|
166
|
+
# define onig_st_copy st_copy
|
|
167
|
+
# define onig_st_nothing_key_clone st_nothing_key_clone
|
|
168
|
+
# define onig_st_nothing_key_free st_nothing_key_free
|
|
169
|
+
# define onig_st_is_member st_is_member
|
|
170
|
+
|
|
171
|
+
# define USE_UPPER_CASE_TABLE
|
|
172
|
+
#else /* RUBY */
|
|
173
|
+
|
|
174
|
+
# define CHECK_INTERRUPT_IN_MATCH_AT
|
|
175
|
+
|
|
176
|
+
# define st_init_table onig_st_init_table
|
|
177
|
+
# define st_init_table_with_size onig_st_init_table_with_size
|
|
178
|
+
# define st_init_numtable onig_st_init_numtable
|
|
179
|
+
# define st_init_numtable_with_size onig_st_init_numtable_with_size
|
|
180
|
+
# define st_init_strtable onig_st_init_strtable
|
|
181
|
+
# define st_init_strtable_with_size onig_st_init_strtable_with_size
|
|
182
|
+
# define st_delete onig_st_delete
|
|
183
|
+
# define st_delete_safe onig_st_delete_safe
|
|
184
|
+
# define st_insert onig_st_insert
|
|
185
|
+
# define st_lookup onig_st_lookup
|
|
186
|
+
# define st_foreach onig_st_foreach
|
|
187
|
+
# define st_add_direct onig_st_add_direct
|
|
188
|
+
# define st_free_table onig_st_free_table
|
|
189
|
+
# define st_cleanup_safe onig_st_cleanup_safe
|
|
190
|
+
# define st_copy onig_st_copy
|
|
191
|
+
# define st_nothing_key_clone onig_st_nothing_key_clone
|
|
192
|
+
# define st_nothing_key_free onig_st_nothing_key_free
|
|
223
193
|
/* */
|
|
224
|
-
#define onig_st_is_member st_is_member
|
|
194
|
+
# define onig_st_is_member st_is_member
|
|
225
195
|
|
|
226
|
-
#endif
|
|
196
|
+
#endif /* RUBY */
|
|
227
197
|
|
|
228
198
|
#define STATE_CHECK_STRING_THRESHOLD_LEN 7
|
|
229
199
|
#define STATE_CHECK_BUFF_MAX_SIZE 0x4000
|
|
230
200
|
|
|
231
|
-
#define THREAD_PASS_LIMIT_COUNT 8
|
|
232
201
|
#define xmemset memset
|
|
233
202
|
#define xmemcpy memcpy
|
|
234
203
|
#define xmemmove memmove
|
|
235
204
|
|
|
236
|
-
#if defined(
|
|
237
|
-
|
|
238
|
-
|
|
205
|
+
#if ((defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 90) \
|
|
206
|
+
|| (!defined(RUBY_MSVCRT_VERSION) && defined(_WIN32))) \
|
|
207
|
+
&& !defined(__GNUC__)
|
|
208
|
+
# define xalloca _alloca
|
|
209
|
+
# define xvsnprintf(buf,size,fmt,args) _vsnprintf_s(buf,size,_TRUNCATE,fmt,args)
|
|
210
|
+
# define xsnprintf sprintf_s
|
|
211
|
+
# define xstrcat(dest,src,size) strcat_s(dest,size,src)
|
|
239
212
|
#else
|
|
240
|
-
#define xalloca alloca
|
|
241
|
-
#define xvsnprintf vsnprintf
|
|
213
|
+
# define xalloca alloca
|
|
214
|
+
# define xvsnprintf vsnprintf
|
|
215
|
+
# define xsnprintf snprintf
|
|
216
|
+
# define xstrcat(dest,src,size) strcat(dest,src)
|
|
242
217
|
#endif
|
|
243
218
|
|
|
219
|
+
#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER)
|
|
220
|
+
# define _CRTDBG_MAP_ALLOC
|
|
221
|
+
# include <malloc.h>
|
|
222
|
+
# include <crtdbg.h>
|
|
223
|
+
#endif
|
|
244
224
|
|
|
245
|
-
#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
|
|
246
|
-
#define ONIG_STATE_INC(reg) (reg)->state++
|
|
247
|
-
#define ONIG_STATE_DEC(reg) (reg)->state--
|
|
248
|
-
|
|
249
|
-
#define ONIG_STATE_INC_THREAD(reg) do {\
|
|
250
|
-
THREAD_ATOMIC_START;\
|
|
251
|
-
(reg)->state++;\
|
|
252
|
-
THREAD_ATOMIC_END;\
|
|
253
|
-
} while(0)
|
|
254
|
-
#define ONIG_STATE_DEC_THREAD(reg) do {\
|
|
255
|
-
THREAD_ATOMIC_START;\
|
|
256
|
-
(reg)->state--;\
|
|
257
|
-
THREAD_ATOMIC_END;\
|
|
258
|
-
} while(0)
|
|
259
|
-
#else
|
|
260
|
-
#define ONIG_STATE_INC(reg) /* Nothing */
|
|
261
|
-
#define ONIG_STATE_DEC(reg) /* Nothing */
|
|
262
|
-
#define ONIG_STATE_INC_THREAD(reg) /* Nothing */
|
|
263
|
-
#define ONIG_STATE_DEC_THREAD(reg) /* Nothing */
|
|
264
|
-
#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
|
|
265
|
-
|
|
266
|
-
#ifdef HAVE_STDLIB_H
|
|
267
225
|
#include <stdlib.h>
|
|
268
|
-
#endif
|
|
269
226
|
|
|
270
227
|
#if defined(HAVE_ALLOCA_H) && (defined(_AIX) || !defined(__GNUC__))
|
|
271
|
-
#include <alloca.h>
|
|
228
|
+
# include <alloca.h>
|
|
272
229
|
#endif
|
|
273
230
|
|
|
274
|
-
#
|
|
275
|
-
# include <string.h>
|
|
276
|
-
#else
|
|
277
|
-
# include <strings.h>
|
|
278
|
-
#endif
|
|
231
|
+
#include <string.h>
|
|
279
232
|
|
|
280
233
|
#include <ctype.h>
|
|
281
234
|
#ifdef HAVE_SYS_TYPES_H
|
|
282
|
-
#include <sys/types.h>
|
|
235
|
+
# include <sys/types.h>
|
|
283
236
|
#endif
|
|
284
237
|
|
|
285
238
|
#ifdef HAVE_STDINT_H
|
|
@@ -290,12 +243,10 @@ extern pthread_mutex_t gOnigMutex;
|
|
|
290
243
|
# include <inttypes.h>
|
|
291
244
|
#endif
|
|
292
245
|
|
|
293
|
-
#
|
|
294
|
-
# include <stddef.h>
|
|
295
|
-
#endif
|
|
246
|
+
#include <stddef.h>
|
|
296
247
|
|
|
297
248
|
#ifdef _WIN32
|
|
298
|
-
#include <malloc.h> /* for alloca() */
|
|
249
|
+
# include <malloc.h> /* for alloca() */
|
|
299
250
|
#endif
|
|
300
251
|
|
|
301
252
|
#ifdef ONIG_DEBUG
|
|
@@ -303,28 +254,32 @@ extern pthread_mutex_t gOnigMutex;
|
|
|
303
254
|
#endif
|
|
304
255
|
|
|
305
256
|
#ifdef _WIN32
|
|
306
|
-
#if defined(_MSC_VER) && (_MSC_VER < 1300)
|
|
307
|
-
#ifndef _INTPTR_T_DEFINED
|
|
308
|
-
#define _INTPTR_T_DEFINED
|
|
257
|
+
# if defined(_MSC_VER) && (_MSC_VER < 1300)
|
|
258
|
+
# ifndef _INTPTR_T_DEFINED
|
|
259
|
+
# define _INTPTR_T_DEFINED
|
|
309
260
|
typedef int intptr_t;
|
|
310
|
-
#endif
|
|
311
|
-
#ifndef _UINTPTR_T_DEFINED
|
|
312
|
-
#define _UINTPTR_T_DEFINED
|
|
261
|
+
# endif
|
|
262
|
+
# ifndef _UINTPTR_T_DEFINED
|
|
263
|
+
# define _UINTPTR_T_DEFINED
|
|
313
264
|
typedef unsigned int uintptr_t;
|
|
314
|
-
#endif
|
|
315
|
-
#endif
|
|
265
|
+
# endif
|
|
266
|
+
# endif
|
|
316
267
|
#endif /* _WIN32 */
|
|
317
268
|
|
|
318
269
|
#ifndef PRIdPTR
|
|
319
|
-
#ifdef _WIN64
|
|
320
|
-
#define PRIdPTR "I64d"
|
|
321
|
-
#define PRIuPTR "I64u"
|
|
322
|
-
#define PRIxPTR "I64x"
|
|
323
|
-
#else
|
|
324
|
-
#define PRIdPTR "ld"
|
|
325
|
-
#define PRIuPTR "lu"
|
|
326
|
-
#define PRIxPTR "lx"
|
|
270
|
+
# ifdef _WIN64
|
|
271
|
+
# define PRIdPTR "I64d"
|
|
272
|
+
# define PRIuPTR "I64u"
|
|
273
|
+
# define PRIxPTR "I64x"
|
|
274
|
+
# else
|
|
275
|
+
# define PRIdPTR "ld"
|
|
276
|
+
# define PRIuPTR "lu"
|
|
277
|
+
# define PRIxPTR "lx"
|
|
278
|
+
# endif
|
|
327
279
|
#endif
|
|
280
|
+
|
|
281
|
+
#ifndef PRIdPTRDIFF
|
|
282
|
+
# define PRIdPTRDIFF PRIdPTR
|
|
328
283
|
#endif
|
|
329
284
|
|
|
330
285
|
#include "regenc.h"
|
|
@@ -332,10 +287,10 @@ typedef unsigned int uintptr_t;
|
|
|
332
287
|
RUBY_SYMBOL_EXPORT_BEGIN
|
|
333
288
|
|
|
334
289
|
#ifdef MIN
|
|
335
|
-
#undef MIN
|
|
290
|
+
# undef MIN
|
|
336
291
|
#endif
|
|
337
292
|
#ifdef MAX
|
|
338
|
-
#undef MAX
|
|
293
|
+
# undef MAX
|
|
339
294
|
#endif
|
|
340
295
|
#define MIN(a,b) (((a)>(b))?(b):(a))
|
|
341
296
|
#define MAX(a,b) (((a)<(b))?(b):(a))
|
|
@@ -350,28 +305,28 @@ RUBY_SYMBOL_EXPORT_BEGIN
|
|
|
350
305
|
|
|
351
306
|
#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
|
|
352
307
|
|
|
353
|
-
#define PLATFORM_GET_INC(val,p,type) do{\
|
|
308
|
+
# define PLATFORM_GET_INC(val,p,type) do{\
|
|
354
309
|
val = *(type* )p;\
|
|
355
310
|
(p) += sizeof(type);\
|
|
356
311
|
} while(0)
|
|
357
312
|
|
|
358
313
|
#else
|
|
359
314
|
|
|
360
|
-
#define PLATFORM_GET_INC(val,p,type) do{\
|
|
315
|
+
# define PLATFORM_GET_INC(val,p,type) do{\
|
|
361
316
|
xmemcpy(&val, (p), sizeof(type));\
|
|
362
317
|
(p) += sizeof(type);\
|
|
363
318
|
} while(0)
|
|
364
319
|
|
|
365
320
|
/* sizeof(OnigCodePoint) */
|
|
366
|
-
#define WORD_ALIGNMENT_SIZE SIZEOF_LONG
|
|
321
|
+
# define WORD_ALIGNMENT_SIZE SIZEOF_LONG
|
|
367
322
|
|
|
368
|
-
#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
|
|
323
|
+
# define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
|
|
369
324
|
(pad_size) = WORD_ALIGNMENT_SIZE \
|
|
370
325
|
- ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
|
|
371
326
|
if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\
|
|
372
327
|
} while (0)
|
|
373
328
|
|
|
374
|
-
#define ALIGNMENT_RIGHT(addr) do {\
|
|
329
|
+
# define ALIGNMENT_RIGHT(addr) do {\
|
|
375
330
|
(addr) += (WORD_ALIGNMENT_SIZE - 1);\
|
|
376
331
|
(addr) -= ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
|
|
377
332
|
} while (0)
|
|
@@ -435,7 +390,6 @@ typedef unsigned int BitStatusType;
|
|
|
435
390
|
#define IS_NOTEOL(option) ((option) & ONIG_OPTION_NOTEOL)
|
|
436
391
|
#define IS_NOTBOS(option) ((option) & ONIG_OPTION_NOTBOS)
|
|
437
392
|
#define IS_NOTEOS(option) ((option) & ONIG_OPTION_NOTEOS)
|
|
438
|
-
#define IS_POSIX_REGION(option) ((option) & ONIG_OPTION_POSIX_REGION)
|
|
439
393
|
#define IS_ASCII_RANGE(option) ((option) & ONIG_OPTION_ASCII_RANGE)
|
|
440
394
|
#define IS_POSIX_BRACKET_ALL_RANGE(option) ((option) & ONIG_OPTION_POSIX_BRACKET_ALL_RANGE)
|
|
441
395
|
#define IS_WORD_BOUND_ALL_RANGE(option) ((option) & ONIG_OPTION_WORD_BOUND_ALL_RANGE)
|
|
@@ -618,7 +572,6 @@ enum OpCode {
|
|
|
618
572
|
OP_CCLASS_NOT,
|
|
619
573
|
OP_CCLASS_MB_NOT,
|
|
620
574
|
OP_CCLASS_MIX_NOT,
|
|
621
|
-
OP_CCLASS_NODE, /* pointer to CClassNode node */
|
|
622
575
|
|
|
623
576
|
OP_ANYCHAR, /* "." */
|
|
624
577
|
OP_ANYCHAR_ML, /* "." multi-line */
|
|
@@ -647,7 +600,6 @@ enum OpCode {
|
|
|
647
600
|
OP_END_LINE,
|
|
648
601
|
OP_SEMI_END_BUF,
|
|
649
602
|
OP_BEGIN_POSITION,
|
|
650
|
-
OP_BEGIN_POS_OR_LINE, /* used for implicit anchor optimization */
|
|
651
603
|
|
|
652
604
|
OP_BACKREF1,
|
|
653
605
|
OP_BACKREF2,
|
|
@@ -692,6 +644,9 @@ enum OpCode {
|
|
|
692
644
|
OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */
|
|
693
645
|
OP_PUSH_LOOK_BEHIND_NOT, /* (?<!...) start */
|
|
694
646
|
OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end */
|
|
647
|
+
OP_PUSH_ABSENT_POS, /* (?~...) start */
|
|
648
|
+
OP_ABSENT, /* (?~...) start of inner loop */
|
|
649
|
+
OP_ABSENT_END, /* (?~...) end */
|
|
695
650
|
|
|
696
651
|
OP_CALL, /* \g<name> */
|
|
697
652
|
OP_RETURN,
|
|
@@ -779,12 +734,15 @@ typedef void* PointerType;
|
|
|
779
734
|
#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR)
|
|
780
735
|
#define SIZE_OP_RETURN SIZE_OPCODE
|
|
781
736
|
#define SIZE_OP_CONDITION (SIZE_OPCODE + SIZE_MEMNUM + SIZE_RELADDR)
|
|
737
|
+
#define SIZE_OP_PUSH_ABSENT_POS SIZE_OPCODE
|
|
738
|
+
#define SIZE_OP_ABSENT (SIZE_OPCODE + SIZE_RELADDR)
|
|
739
|
+
#define SIZE_OP_ABSENT_END SIZE_OPCODE
|
|
782
740
|
|
|
783
741
|
#ifdef USE_COMBINATION_EXPLOSION_CHECK
|
|
784
|
-
#define SIZE_OP_STATE_CHECK
|
|
785
|
-
#define SIZE_OP_STATE_CHECK_PUSH
|
|
786
|
-
#define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
|
|
787
|
-
#define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
|
|
742
|
+
# define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
|
|
743
|
+
# define SIZE_OP_STATE_CHECK_PUSH (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
|
|
744
|
+
# define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
|
|
745
|
+
# define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
|
|
788
746
|
#endif
|
|
789
747
|
|
|
790
748
|
#define MC_ESC(syn) (syn)->meta_char_table.esc
|
|
@@ -832,13 +790,10 @@ typedef void* PointerType;
|
|
|
832
790
|
|
|
833
791
|
/* cclass node */
|
|
834
792
|
#define FLAG_NCCLASS_NOT (1<<0)
|
|
835
|
-
#define FLAG_NCCLASS_SHARE (1<<1)
|
|
836
793
|
|
|
837
794
|
#define NCCLASS_SET_NOT(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_NOT)
|
|
838
|
-
#define NCCLASS_SET_SHARE(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_SHARE)
|
|
839
795
|
#define NCCLASS_CLEAR_NOT(nd) NCCLASS_FLAG_CLEAR(nd, FLAG_NCCLASS_NOT)
|
|
840
796
|
#define IS_NCCLASS_NOT(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_NOT)
|
|
841
|
-
#define IS_NCCLASS_SHARE(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_SHARE)
|
|
842
797
|
|
|
843
798
|
typedef struct {
|
|
844
799
|
int type;
|
|
@@ -893,6 +848,10 @@ typedef struct _OnigStackType {
|
|
|
893
848
|
UChar *pstr; /* string position */
|
|
894
849
|
} call_frame;
|
|
895
850
|
#endif
|
|
851
|
+
struct {
|
|
852
|
+
UChar *abs_pstr; /* absent start position */
|
|
853
|
+
const UChar *end_pstr; /* end position */
|
|
854
|
+
} absent_pos;
|
|
896
855
|
} u;
|
|
897
856
|
} OnigStackType;
|
|
898
857
|
|
|
@@ -936,60 +895,44 @@ typedef struct {
|
|
|
936
895
|
extern OnigOpInfoType OnigOpInfo[];
|
|
937
896
|
|
|
938
897
|
|
|
939
|
-
extern void onig_print_compiled_byte_code
|
|
898
|
+
extern void onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp, OnigEncoding enc);
|
|
940
899
|
|
|
941
|
-
#ifdef ONIG_DEBUG_STATISTICS
|
|
942
|
-
extern void onig_statistics_init
|
|
943
|
-
extern void onig_print_statistics
|
|
944
|
-
#endif
|
|
900
|
+
# ifdef ONIG_DEBUG_STATISTICS
|
|
901
|
+
extern void onig_statistics_init(void);
|
|
902
|
+
extern void onig_print_statistics(FILE* f);
|
|
903
|
+
# endif
|
|
945
904
|
#endif
|
|
946
905
|
|
|
947
|
-
extern UChar* onig_error_code_to_format
|
|
948
|
-
extern void
|
|
949
|
-
extern
|
|
950
|
-
extern int
|
|
951
|
-
extern
|
|
952
|
-
|
|
953
|
-
extern
|
|
954
|
-
|
|
955
|
-
extern
|
|
906
|
+
extern UChar* onig_error_code_to_format(OnigPosition code);
|
|
907
|
+
extern void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, va_list args);
|
|
908
|
+
extern void onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...);
|
|
909
|
+
extern int onig_bbuf_init(BBuf* buf, OnigDistance size);
|
|
910
|
+
extern int onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo);
|
|
911
|
+
#ifdef RUBY
|
|
912
|
+
extern int onig_compile_ruby(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo, const char *sourcefile, int sourceline);
|
|
913
|
+
#endif
|
|
914
|
+
extern void onig_transfer(regex_t* to, regex_t* from);
|
|
915
|
+
extern int onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc);
|
|
916
|
+
extern int onig_is_code_in_cc_len(int enclen, OnigCodePoint code, CClassNode* cc);
|
|
956
917
|
|
|
957
918
|
/* strend hash */
|
|
958
919
|
typedef void hash_table_type;
|
|
959
920
|
#ifdef RUBY
|
|
960
|
-
#include "ruby/st.h"
|
|
961
|
-
typedef st_data_t hash_data_type;
|
|
921
|
+
# include "ruby/st.h"
|
|
962
922
|
#else
|
|
963
|
-
#include "st.h"
|
|
964
|
-
typedef uintptr_t hash_data_type;
|
|
923
|
+
# include "st.h"
|
|
965
924
|
#endif
|
|
925
|
+
typedef st_data_t hash_data_type;
|
|
966
926
|
|
|
967
|
-
extern hash_table_type* onig_st_init_strend_table_with_size
|
|
968
|
-
extern int onig_st_lookup_strend
|
|
969
|
-
extern int onig_st_insert_strend
|
|
970
|
-
|
|
971
|
-
/* encoding property management */
|
|
972
|
-
#define PROPERTY_LIST_ADD_PROP(Name, CR) \
|
|
973
|
-
r = onigenc_property_list_add_property((UChar* )Name, CR,\
|
|
974
|
-
&PropertyNameTable, &PropertyList, &PropertyListNum,\
|
|
975
|
-
&PropertyListSize);\
|
|
976
|
-
if (r != 0) goto end
|
|
977
|
-
|
|
978
|
-
#define PROPERTY_LIST_INIT_CHECK \
|
|
979
|
-
if (PropertyInited == 0) {\
|
|
980
|
-
int r = onigenc_property_list_init(init_property_list);\
|
|
981
|
-
if (r != 0) return r;\
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
extern int onigenc_property_list_add_property P_((UChar* name, const OnigCodePoint* prop, hash_table_type **table, const OnigCodePoint*** plist, int *pnum, int *psize));
|
|
985
|
-
|
|
986
|
-
typedef int (*ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE)(void);
|
|
987
|
-
|
|
988
|
-
extern int onigenc_property_list_init P_((ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE));
|
|
927
|
+
extern hash_table_type* onig_st_init_strend_table_with_size(st_index_t size);
|
|
928
|
+
extern int onig_st_lookup_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value);
|
|
929
|
+
extern int onig_st_insert_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value);
|
|
989
930
|
|
|
990
|
-
|
|
991
|
-
extern size_t
|
|
931
|
+
#ifdef RUBY
|
|
932
|
+
extern size_t onig_memsize(const regex_t *reg);
|
|
933
|
+
extern size_t onig_region_memsize(const struct re_registers *regs);
|
|
934
|
+
#endif
|
|
992
935
|
|
|
993
936
|
RUBY_SYMBOL_EXPORT_END
|
|
994
937
|
|
|
995
|
-
#endif /*
|
|
938
|
+
#endif /* ONIGMO_REGINT_H */
|