kanayago 0.1.1

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.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +15 -0
  3. data/.rubocop_todo.yml +23 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +79 -0
  6. data/Rakefile +182 -0
  7. data/ext/kanayago/ccan/check_type/check_type.h +63 -0
  8. data/ext/kanayago/ccan/container_of/container_of.h +142 -0
  9. data/ext/kanayago/ccan/list/list.h +791 -0
  10. data/ext/kanayago/ccan/str/str.h +17 -0
  11. data/ext/kanayago/constant.h +53 -0
  12. data/ext/kanayago/extconf.rb +21 -0
  13. data/ext/kanayago/id.h +347 -0
  14. data/ext/kanayago/id_table.h +39 -0
  15. data/ext/kanayago/internal/array.h +151 -0
  16. data/ext/kanayago/internal/basic_operators.h +64 -0
  17. data/ext/kanayago/internal/bignum.h +244 -0
  18. data/ext/kanayago/internal/bits.h +568 -0
  19. data/ext/kanayago/internal/compile.h +34 -0
  20. data/ext/kanayago/internal/compilers.h +107 -0
  21. data/ext/kanayago/internal/complex.h +29 -0
  22. data/ext/kanayago/internal/encoding.h +36 -0
  23. data/ext/kanayago/internal/error.h +218 -0
  24. data/ext/kanayago/internal/fixnum.h +184 -0
  25. data/ext/kanayago/internal/gc.h +322 -0
  26. data/ext/kanayago/internal/hash.h +191 -0
  27. data/ext/kanayago/internal/imemo.h +261 -0
  28. data/ext/kanayago/internal/io.h +140 -0
  29. data/ext/kanayago/internal/numeric.h +274 -0
  30. data/ext/kanayago/internal/parse.h +117 -0
  31. data/ext/kanayago/internal/rational.h +71 -0
  32. data/ext/kanayago/internal/re.h +28 -0
  33. data/ext/kanayago/internal/ruby_parser.h +125 -0
  34. data/ext/kanayago/internal/sanitizers.h +297 -0
  35. data/ext/kanayago/internal/serial.h +23 -0
  36. data/ext/kanayago/internal/static_assert.h +16 -0
  37. data/ext/kanayago/internal/string.h +186 -0
  38. data/ext/kanayago/internal/symbol.h +45 -0
  39. data/ext/kanayago/internal/thread.h +79 -0
  40. data/ext/kanayago/internal/variable.h +72 -0
  41. data/ext/kanayago/internal/vm.h +137 -0
  42. data/ext/kanayago/internal/warnings.h +16 -0
  43. data/ext/kanayago/internal.h +108 -0
  44. data/ext/kanayago/kanayago.c +420 -0
  45. data/ext/kanayago/kanayago.h +21 -0
  46. data/ext/kanayago/lex.c +302 -0
  47. data/ext/kanayago/method.h +255 -0
  48. data/ext/kanayago/node.c +440 -0
  49. data/ext/kanayago/node.h +111 -0
  50. data/ext/kanayago/node_name.inc +224 -0
  51. data/ext/kanayago/parse.c +26931 -0
  52. data/ext/kanayago/parse.h +244 -0
  53. data/ext/kanayago/parse.tmp.y +16145 -0
  54. data/ext/kanayago/parser_bits.h +564 -0
  55. data/ext/kanayago/parser_node.h +32 -0
  56. data/ext/kanayago/parser_st.c +164 -0
  57. data/ext/kanayago/parser_st.h +162 -0
  58. data/ext/kanayago/parser_value.h +106 -0
  59. data/ext/kanayago/probes.h +4 -0
  60. data/ext/kanayago/ruby_assert.h +14 -0
  61. data/ext/kanayago/ruby_atomic.h +23 -0
  62. data/ext/kanayago/ruby_parser.c +1165 -0
  63. data/ext/kanayago/rubyparser.h +1391 -0
  64. data/ext/kanayago/shape.h +234 -0
  65. data/ext/kanayago/st.c +2339 -0
  66. data/ext/kanayago/symbol.h +123 -0
  67. data/ext/kanayago/thread_pthread.h +168 -0
  68. data/ext/kanayago/universal_parser.c +230 -0
  69. data/ext/kanayago/vm_core.h +2215 -0
  70. data/ext/kanayago/vm_opts.h +67 -0
  71. data/lib/kanayago/version.rb +5 -0
  72. data/lib/kanayago.rb +11 -0
  73. data/sig/kanayago.rbs +4 -0
  74. metadata +116 -0
@@ -0,0 +1,123 @@
1
+ #ifndef RUBY_SYMBOL_H
2
+ #define RUBY_SYMBOL_H 1
3
+ /**********************************************************************
4
+
5
+ symbol.h -
6
+
7
+ $Author$
8
+ created at: Tue Jul 8 15:49:54 JST 2014
9
+
10
+ Copyright (C) 2014 Yukihiro Matsumoto
11
+
12
+ **********************************************************************/
13
+
14
+ #include "id.h"
15
+ #include "ruby/encoding.h"
16
+
17
+ #define DYNAMIC_ID_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID)
18
+ #define STATIC_ID2SYM(id) (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
19
+
20
+ #ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
21
+ #define rb_id2sym(id) \
22
+ RB_GNUC_EXTENSION_BLOCK(__builtin_constant_p(id) && !DYNAMIC_ID_P(id) ? \
23
+ STATIC_ID2SYM(id) : rb_id2sym(id))
24
+ #endif
25
+
26
+ struct RSymbol {
27
+ struct RBasic basic;
28
+ st_index_t hashval;
29
+ VALUE fstr;
30
+ ID id;
31
+ };
32
+
33
+ #define RSYMBOL(obj) ((struct RSymbol *)(obj))
34
+
35
+ #define is_notop_id(id) ((id)>tLAST_OP_ID)
36
+ #define is_local_id(id) (id_type(id)==ID_LOCAL)
37
+ #define is_global_id(id) (id_type(id)==ID_GLOBAL)
38
+ #define is_instance_id(id) (id_type(id)==ID_INSTANCE)
39
+ #define is_attrset_id(id) ((id)==idASET||id_type(id)==ID_ATTRSET)
40
+ #define is_const_id(id) (id_type(id)==ID_CONST)
41
+ #define is_class_id(id) (id_type(id)==ID_CLASS)
42
+ #define is_junk_id(id) (id_type(id)==ID_JUNK)
43
+
44
+ static inline int
45
+ id_type(ID id)
46
+ {
47
+ if (is_notop_id(id)) {
48
+ return (int)(id&ID_SCOPE_MASK);
49
+ }
50
+ else {
51
+ return -1;
52
+ }
53
+ }
54
+
55
+ typedef uint32_t rb_id_serial_t;
56
+ static const uint32_t RB_ID_SERIAL_MAX = /* 256M on LP32 */
57
+ UINT32_MAX >>
58
+ ((sizeof(ID)-sizeof(rb_id_serial_t))*CHAR_BIT < RUBY_ID_SCOPE_SHIFT ?
59
+ RUBY_ID_SCOPE_SHIFT : 0);
60
+
61
+ typedef struct {
62
+ rb_id_serial_t last_id;
63
+ st_table *str_sym;
64
+ VALUE ids;
65
+ VALUE dsymbol_fstr_hash;
66
+ } rb_symbols_t;
67
+
68
+ static inline rb_id_serial_t
69
+ rb_id_to_serial(ID id)
70
+ {
71
+ if (is_notop_id(id)) {
72
+ return (rb_id_serial_t)(id >> ID_SCOPE_SHIFT);
73
+ }
74
+ else {
75
+ return (rb_id_serial_t)id;
76
+ }
77
+ }
78
+
79
+ static inline int
80
+ sym_type(VALUE sym)
81
+ {
82
+ ID id;
83
+ if (STATIC_SYM_P(sym)) {
84
+ id = RSHIFT(sym, RUBY_SPECIAL_SHIFT);
85
+ if (id<=tLAST_OP_ID) {
86
+ return -1;
87
+ }
88
+ }
89
+ else {
90
+ id = RSYMBOL(sym)->id;
91
+ }
92
+ return (int)(id&ID_SCOPE_MASK);
93
+ }
94
+
95
+ #define is_local_sym(sym) (sym_type(sym)==ID_LOCAL)
96
+ #define is_global_sym(sym) (sym_type(sym)==ID_GLOBAL)
97
+ #define is_instance_sym(sym) (sym_type(sym)==ID_INSTANCE)
98
+ #define is_attrset_sym(sym) (sym_type(sym)==ID_ATTRSET)
99
+ #define is_const_sym(sym) (sym_type(sym)==ID_CONST)
100
+ #define is_class_sym(sym) (sym_type(sym)==ID_CLASS)
101
+ #define is_junk_sym(sym) (sym_type(sym)==ID_JUNK)
102
+
103
+ #ifndef RIPPER
104
+ RUBY_FUNC_EXPORTED
105
+ #else
106
+ RUBY_EXTERN
107
+ #endif
108
+ const uint_least32_t ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
109
+
110
+ static inline int
111
+ is_global_name_punct(const int c)
112
+ {
113
+ if (c <= 0x20 || 0x7e < c) return 0;
114
+ return (ruby_global_name_punct_bits[(c - 0x20) / 32] >> (c % 32)) & 1;
115
+ }
116
+
117
+ RUBY_SYMBOL_EXPORT_BEGIN
118
+
119
+ int rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset);
120
+ size_t rb_sym_immortal_count(void);
121
+
122
+ RUBY_SYMBOL_EXPORT_END
123
+ #endif
@@ -0,0 +1,168 @@
1
+ #ifndef RUBY_THREAD_PTHREAD_H
2
+ #define RUBY_THREAD_PTHREAD_H
3
+ /**********************************************************************
4
+
5
+ thread_pthread.h -
6
+
7
+ $Author$
8
+
9
+ Copyright (C) 2004-2007 Koichi Sasada
10
+
11
+ **********************************************************************/
12
+
13
+ #ifdef HAVE_PTHREAD_NP_H
14
+ #include <pthread_np.h>
15
+ #endif
16
+
17
+ #define RB_NATIVETHREAD_LOCK_INIT PTHREAD_MUTEX_INITIALIZER
18
+ #define RB_NATIVETHREAD_COND_INIT PTHREAD_COND_INITIALIZER
19
+
20
+ // this data should be protected by timer_th.waiting_lock
21
+ struct rb_thread_sched_waiting {
22
+ enum thread_sched_waiting_flag {
23
+ thread_sched_waiting_none = 0x00,
24
+ thread_sched_waiting_timeout = 0x01,
25
+ thread_sched_waiting_io_read = 0x02,
26
+ thread_sched_waiting_io_write = 0x08,
27
+ thread_sched_waiting_io_force = 0x40, // ignore readable
28
+ } flags;
29
+
30
+ struct {
31
+ // should be compat with hrtime.h
32
+ #ifdef MY_RUBY_BUILD_MAY_TIME_TRAVEL
33
+ int128_t timeout;
34
+ #else
35
+ uint64_t timeout;
36
+ #endif
37
+ int fd; // -1 for timeout only
38
+ int result;
39
+ } data;
40
+
41
+ // connected to timer_th.waiting
42
+ struct ccan_list_node node;
43
+ };
44
+
45
+ // per-Thead scheduler helper data
46
+ struct rb_thread_sched_item {
47
+ struct {
48
+ struct ccan_list_node ubf;
49
+
50
+ // connected to ractor->threads.sched.reqdyq
51
+ // locked by ractor->threads.sched.lock
52
+ struct ccan_list_node readyq;
53
+
54
+ // connected to vm->ractor.sched.timeslice_threads
55
+ // locked by vm->ractor.sched.lock
56
+ struct ccan_list_node timeslice_threads;
57
+
58
+ // connected to vm->ractor.sched.running_threads
59
+ // locked by vm->ractor.sched.lock
60
+ struct ccan_list_node running_threads;
61
+
62
+ // connected to vm->ractor.sched.zombie_threads
63
+ struct ccan_list_node zombie_threads;
64
+ } node;
65
+
66
+ struct rb_thread_sched_waiting waiting_reason;
67
+
68
+ bool finished;
69
+ bool malloc_stack;
70
+ void *context_stack;
71
+ struct coroutine_context *context;
72
+ };
73
+
74
+ struct rb_native_thread {
75
+ rb_atomic_t serial;
76
+ struct rb_vm_struct *vm;
77
+
78
+ rb_nativethread_id_t thread_id;
79
+
80
+ #ifdef RB_THREAD_T_HAS_NATIVE_ID
81
+ int tid;
82
+ #endif
83
+
84
+ struct rb_thread_struct *running_thread;
85
+
86
+ // to control native thread
87
+ #if defined(__GLIBC__) || defined(__FreeBSD__)
88
+ union
89
+ #else
90
+ /*
91
+ * assume the platform condvars are badly implemented and have a
92
+ * "memory" of which mutex they're associated with
93
+ */
94
+ struct
95
+ #endif
96
+ {
97
+ rb_nativethread_cond_t intr; /* th->interrupt_lock */
98
+ rb_nativethread_cond_t readyq; /* use sched->lock */
99
+ } cond;
100
+
101
+ #ifdef USE_SIGALTSTACK
102
+ void *altstack;
103
+ #endif
104
+
105
+ struct coroutine_context *nt_context;
106
+ int dedicated;
107
+
108
+ size_t machine_stack_maxsize;
109
+ };
110
+
111
+ #undef except
112
+ #undef try
113
+ #undef leave
114
+ #undef finally
115
+
116
+ // per-Ractor
117
+ struct rb_thread_sched {
118
+ rb_nativethread_lock_t lock_;
119
+ #if VM_CHECK_MODE
120
+ struct rb_thread_struct *lock_owner;
121
+ #endif
122
+ struct rb_thread_struct *running; // running thread or NULL
123
+ bool is_running;
124
+ bool is_running_timeslice;
125
+ bool enable_mn_threads;
126
+
127
+ struct ccan_list_head readyq;
128
+ int readyq_cnt;
129
+ // ractor scheduling
130
+ struct ccan_list_node grq_node;
131
+ };
132
+
133
+ #ifdef RB_THREAD_LOCAL_SPECIFIER
134
+ NOINLINE(void rb_current_ec_set(struct rb_execution_context_struct *));
135
+ NOINLINE(struct rb_execution_context_struct *rb_current_ec_noinline(void));
136
+
137
+ # ifdef __APPLE__
138
+ // on Darwin, TLS can not be accessed across .so
139
+ NOINLINE(struct rb_execution_context_struct *rb_current_ec(void));
140
+ # else
141
+ RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec;
142
+
143
+ // for RUBY_DEBUG_LOG()
144
+ RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER rb_atomic_t ruby_nt_serial;
145
+ #define RUBY_NT_SERIAL 1
146
+ # endif
147
+ #else
148
+ typedef pthread_key_t native_tls_key_t;
149
+
150
+ static inline void *
151
+ native_tls_get(native_tls_key_t key)
152
+ {
153
+ // return value should be checked by caller
154
+ return pthread_getspecific(key);
155
+ }
156
+
157
+ static inline void
158
+ native_tls_set(native_tls_key_t key, void *ptr)
159
+ {
160
+ if (UNLIKELY(pthread_setspecific(key, ptr) != 0)) {
161
+ rb_bug("pthread_setspecific error");
162
+ }
163
+ }
164
+
165
+ RUBY_EXTERN native_tls_key_t ruby_current_ec_key;
166
+ #endif
167
+
168
+ #endif /* RUBY_THREAD_PTHREAD_H */
@@ -0,0 +1,230 @@
1
+ #include <alloca.h>
2
+ #include <string.h>
3
+ #include <stdarg.h>
4
+ #include <stdbool.h>
5
+ #include <stddef.h>
6
+
7
+ /* Dependency */
8
+ #include "internal/parse.h"
9
+ #include "node.h"
10
+ #include "id.h"
11
+
12
+ #include "internal/compilers.h"
13
+ #include "ruby/backward/2/inttypes.h"
14
+ #include "probes.h"
15
+
16
+ #define LIKELY(x) RB_LIKELY(x)
17
+ #define UNLIKELY(x) RB_UNLIKELY(x)
18
+ #ifndef TRUE
19
+ # define TRUE 1
20
+ #endif
21
+
22
+ #ifndef FALSE
23
+ # define FALSE 0
24
+ #endif
25
+ #define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
26
+ #define rb_strlen_lit(str) (sizeof(str "") - 1)
27
+ #undef FIXNUM_MAX
28
+ #define FIXNUM_MAX (LONG_MAX / 2)
29
+ #undef RSTRING_GETMEM
30
+ #define RSTRING_GETMEM(str, ptrvar, lenvar) \
31
+ ((ptrvar) = RSTRING_PTR(str), \
32
+ (lenvar) = RSTRING_LEN(str))
33
+
34
+ /* parser_st */
35
+ #define st_table parser_st_table
36
+ #define st_data_t parser_st_data_t
37
+ #define st_hash_type parser_st_hash_type
38
+ #define ST_CONTINUE ST2_CONTINUE
39
+ #define ST_STOP ST2_STOP
40
+ #define ST_DELETE ST2_DELETE
41
+ #define ST_CHECK ST2_CHECK
42
+ #define ST_REPLACE ST2_REPLACE
43
+ #undef st_init_numtable
44
+ #define st_init_numtable rb_parser_st_init_numtable
45
+ #undef st_free_table
46
+ #define st_free_table rb_parser_st_free_table
47
+ #undef st_init_table_with_size
48
+ #define st_init_table_with_size rb_parser_st_init_table_with_size
49
+ #undef st_insert
50
+ #define st_insert rb_parser_st_insert
51
+ #undef st_foreach
52
+ #define st_foreach rb_parser_st_foreach
53
+ #undef st_delete
54
+ #define st_delete rb_parser_st_delete
55
+ #undef st_is_member
56
+ #define st_is_member parser_st_is_member
57
+ #undef st_init_table
58
+ #define st_init_table rb_parser_st_init_table
59
+ #undef st_lookup
60
+ #define st_lookup rb_parser_st_lookup
61
+
62
+ #define rb_encoding const void
63
+
64
+ #undef xmalloc
65
+ #define xmalloc p->config->malloc
66
+ #undef xcalloc
67
+ #define xcalloc p->config->calloc
68
+ #undef xrealloc
69
+ #define xrealloc p->config->realloc
70
+ #undef ALLOC_N
71
+ #define ALLOC_N(type,n) ((type *)p->config->alloc_n((n), sizeof(type)))
72
+ #undef ALLOC
73
+ #define ALLOC(type) ((type *)p->config->alloc(sizeof(type)))
74
+ #undef xfree
75
+ #define xfree p->config->free
76
+ #undef ALLOCA_N
77
+ // alloca(rbimpl_size_mul_or_raise(x, y));
78
+ #define ALLOCA_N(type,n) ((type *)alloca(sizeof(type) * (n)))
79
+ #undef REALLOC_N
80
+ #define REALLOC_N(var,type,n) ((var) = (type *)p->config->realloc_n((void *)var, n, sizeof(type)))
81
+ #undef ZALLOC
82
+ #define ZALLOC(type) ((type *)p->config->zalloc(sizeof(type)))
83
+ #undef MEMMOVE
84
+ #define MEMMOVE(p1,p2,type,n) (p->config->rb_memmove((p1), (p2), sizeof(type), (n)))
85
+ #undef MEMCPY
86
+ #define MEMCPY(p1,p2,type,n) (p->config->nonempty_memcpy((p1), (p2), sizeof(type), (n)))
87
+
88
+ #define compile_callback p->config->compile_callback
89
+ #define reg_named_capture_assign p->config->reg_named_capture_assign
90
+
91
+ #define rb_attr_get p->config->attr_get
92
+
93
+ #define rb_ary_new p->config->ary_new
94
+ #define rb_ary_push p->config->ary_push
95
+ #undef rb_ary_new_from_args
96
+ #define rb_ary_new_from_args p->config->ary_new_from_args
97
+ #define rb_ary_unshift p->config->ary_unshift
98
+
99
+ #define rb_make_temporary_id p->config->make_temporary_id
100
+ #define is_local_id p->config->is_local_id
101
+ #define is_attrset_id p->config->is_attrset_id
102
+ #define is_global_name_punct p->config->is_global_name_punct
103
+ #define id_type p->config->id_type
104
+ #define rb_id_attrset p->config->id_attrset
105
+ #undef rb_intern
106
+ #define rb_intern p->config->intern
107
+ #define rb_intern2 p->config->intern2
108
+ #define rb_intern3 p->config->intern3
109
+ #define rb_intern_str p->config->intern_str
110
+ #define is_notop_id p->config->is_notop_id
111
+ #define rb_enc_symname_type p->config->enc_symname_type
112
+ #define rb_id2name p->config->id2name
113
+ #define rb_id2str p->config->id2str
114
+ #undef ID2SYM
115
+ #define ID2SYM p->config->id2sym
116
+ #undef SYM2ID
117
+ #define SYM2ID p->config->sym2id
118
+
119
+ #define rb_str_catf p->config->str_catf
120
+ #undef rb_str_cat_cstr
121
+ #define rb_str_cat_cstr p->config->str_cat_cstr
122
+ #define rb_str_modify p->config->str_modify
123
+ #define rb_str_set_len p->config->str_set_len
124
+ #define rb_str_cat p->config->str_cat
125
+ #define rb_str_resize p->config->str_resize
126
+ #undef rb_str_new
127
+ #define rb_str_new p->config->str_new
128
+ #undef rb_str_new_cstr
129
+ #define rb_str_new_cstr p->config->str_new_cstr
130
+ #define rb_str_to_interned_str p->config->str_to_interned_str
131
+ #define is_ascii_string p->config->is_ascii_string
132
+ #define rb_enc_str_new p->config->enc_str_new
133
+ #define rb_str_vcatf p->config->str_vcatf
134
+ #define rb_sprintf p->config->rb_sprintf
135
+ #undef RSTRING_PTR
136
+ #define RSTRING_PTR p->config->rstring_ptr
137
+ #undef RSTRING_END
138
+ #define RSTRING_END p->config->rstring_end
139
+ #undef RSTRING_LEN
140
+ #define RSTRING_LEN p->config->rstring_len
141
+ #define rb_obj_as_string p->config->obj_as_string
142
+
143
+ #undef INT2NUM
144
+ #define INT2NUM p->config->int2num
145
+
146
+ #define rb_stderr_tty_p p->config->stderr_tty_p
147
+ #define rb_write_error_str p->config->write_error_str
148
+ #define rb_io_write p->config->io_write
149
+ #define rb_io_flush p->config->io_flush
150
+ #define rb_io_puts p->config->io_puts
151
+
152
+ #define rb_ractor_stdout p->config->debug_output_stdout
153
+ #define rb_ractor_stderr p->config->debug_output_stderr
154
+
155
+ #define rb_is_usascii_enc p->config->is_usascii_enc
156
+ #define rb_enc_isalnum p->config->enc_isalnum
157
+ #define rb_enc_precise_mbclen p->config->enc_precise_mbclen
158
+ #define MBCLEN_CHARFOUND_P p->config->mbclen_charfound_p
159
+ #define MBCLEN_CHARFOUND_LEN p->config->mbclen_charfound_len
160
+ #define rb_enc_name p->config->enc_name
161
+ #define rb_enc_prev_char p->config->enc_prev_char
162
+ #define rb_enc_get p->config->enc_get
163
+ #define rb_enc_asciicompat p->config->enc_asciicompat
164
+ #define rb_utf8_encoding p->config->utf8_encoding
165
+ #define rb_enc_associate p->config->enc_associate
166
+ #define rb_ascii8bit_encoding p->config->ascii8bit_encoding
167
+ #define rb_enc_codelen p->config->enc_codelen
168
+ #define rb_enc_mbcput p->config->enc_mbcput
169
+ #define rb_enc_find_index p->config->enc_find_index
170
+ #define rb_enc_from_index p->config->enc_from_index
171
+ #define rb_enc_isspace p->config->enc_isspace
172
+ #define ENC_CODERANGE_7BIT p->config->enc_coderange_7bit
173
+ #define ENC_CODERANGE_UNKNOWN p->config->enc_coderange_unknown
174
+ #define rb_usascii_encoding p->config->usascii_encoding
175
+
176
+ #define rb_local_defined p->config->local_defined
177
+ #define rb_dvar_defined p->config->dvar_defined
178
+
179
+ #define rb_syntax_error_append p->config->syntax_error_append
180
+ #define rb_raise p->config->raise
181
+ #define syntax_error_new p->config->syntax_error_new
182
+
183
+ #define rb_errinfo p->config->errinfo
184
+ #define rb_set_errinfo p->config->set_errinfo
185
+ #define rb_exc_raise p->config->exc_raise
186
+ #define rb_make_exception p->config->make_exception
187
+
188
+ #define ruby_sized_xfree p->config->sized_xfree
189
+ #define SIZED_REALLOC_N(v, T, m, n) ((v) = (T *)p->config->sized_realloc_n((void *)(v), (m), sizeof(T), (n)))
190
+ #undef RB_GC_GUARD
191
+ #define RB_GC_GUARD p->config->gc_guard
192
+ #define rb_gc_mark p->config->gc_mark
193
+
194
+ #define rb_reg_compile p->config->reg_compile
195
+ #define rb_reg_check_preprocess p->config->reg_check_preprocess
196
+ #define rb_memcicmp p->config->memcicmp
197
+
198
+ #define rb_compile_warn p->config->compile_warn
199
+ #define rb_compile_warning p->config->compile_warning
200
+ #define rb_bug p->config->bug
201
+ #define rb_fatal p->config->fatal
202
+ #undef ruby_verbose
203
+ #define ruby_verbose p->config->verbose()
204
+ #undef errno
205
+ #define errno (*p->config->errno_ptr())
206
+
207
+ #define rb_make_backtrace p->config->make_backtrace
208
+
209
+ #define ruby_scan_hex p->config->scan_hex
210
+ #define ruby_scan_oct p->config->scan_oct
211
+ #define ruby_scan_digits p->config->scan_digits
212
+ #define strtod p->config->strtod
213
+
214
+ #undef RTEST
215
+ #define RTEST p->config->rtest
216
+ #undef NIL_P
217
+ #define NIL_P p->config->nil_p
218
+ #undef Qnil
219
+ #define Qnil p->config->qnil
220
+ #undef Qfalse
221
+ #define Qfalse p->config->qfalse
222
+ #define rb_eArgError p->config->eArgError()
223
+ #undef rb_long2int
224
+ #define rb_long2int p->config->long2int
225
+ #define rb_enc_mbminlen p->config->enc_mbminlen
226
+ #define rb_enc_isascii p->config->enc_isascii
227
+ #define rb_enc_mbc_to_codepoint p->config->enc_mbc_to_codepoint
228
+
229
+ #define rb_ast_new() \
230
+ rb_ast_new(p->config)