debase-ruby_core_source 0.10.6 → 0.10.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/lib/debase/ruby_core_source.rb +2 -1
  4. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/addr2line.h +21 -0
  5. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/build_assert/build_assert.h +40 -0
  6. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/check_type/check_type.h +63 -0
  7. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/container_of/container_of.h +142 -0
  8. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/list/list.h +788 -0
  9. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/str/str.h +16 -0
  10. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/constant.h +54 -0
  11. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/debug_counter.h +378 -0
  12. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/dln.h +51 -0
  13. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/encindex.h +69 -0
  14. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/eval_intern.h +314 -0
  15. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/gc.h +129 -0
  16. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/hrtime.h +168 -0
  17. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/id.h +292 -0
  18. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/id_table.h +34 -0
  19. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/insns.inc +249 -0
  20. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/insns_info.inc +9614 -0
  21. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/internal.h +2682 -0
  22. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/iseq.h +312 -0
  23. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/known_errors.inc +791 -0
  24. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/method.h +232 -0
  25. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/mjit.h +179 -0
  26. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/mjit_compile.inc +7883 -0
  27. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/node.h +483 -0
  28. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/node_name.inc +210 -0
  29. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/opt_sc.inc +109 -0
  30. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/optinsn.inc +128 -0
  31. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/optunifs.inc +43 -0
  32. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/parse.h +210 -0
  33. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/probes_helper.h +42 -0
  34. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/regenc.h +254 -0
  35. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/regint.h +938 -0
  36. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/regparse.h +370 -0
  37. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/revision.h +2 -0
  38. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ruby_assert.h +15 -0
  39. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ruby_atomic.h +244 -0
  40. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/siphash.h +48 -0
  41. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/symbol.h +119 -0
  42. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/thread_pthread.h +75 -0
  43. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/thread_win32.h +36 -0
  44. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/timev.h +56 -0
  45. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/transcode_data.h +139 -0
  46. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/transient_heap.h +62 -0
  47. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/version.h +77 -0
  48. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm.inc +5269 -0
  49. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_call_iseq_optimized.inc +237 -0
  50. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_core.h +1955 -0
  51. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_debug.h +34 -0
  52. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_exec.h +193 -0
  53. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_insnhelper.h +255 -0
  54. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_opts.h +70 -0
  55. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vmtc.inc +243 -0
  56. data/lib/debase/ruby_core_source/version.rb +1 -1
  57. metadata +55 -3
@@ -0,0 +1,483 @@
1
+ /**********************************************************************
2
+
3
+ node.h -
4
+
5
+ $Author$
6
+ created at: Fri May 28 15:14:02 JST 1993
7
+
8
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
9
+
10
+ **********************************************************************/
11
+
12
+ #ifndef RUBY_NODE_H
13
+ #define RUBY_NODE_H 1
14
+
15
+ #if defined(__cplusplus)
16
+ extern "C" {
17
+ #if 0
18
+ } /* satisfy cc-mode */
19
+ #endif
20
+ #endif
21
+
22
+ enum node_type {
23
+ NODE_SCOPE,
24
+ NODE_BLOCK,
25
+ NODE_IF,
26
+ NODE_UNLESS,
27
+ NODE_CASE,
28
+ NODE_CASE2,
29
+ NODE_CASE3,
30
+ NODE_WHEN,
31
+ NODE_IN,
32
+ NODE_WHILE,
33
+ NODE_UNTIL,
34
+ NODE_ITER,
35
+ NODE_FOR,
36
+ NODE_FOR_MASGN,
37
+ NODE_BREAK,
38
+ NODE_NEXT,
39
+ NODE_REDO,
40
+ NODE_RETRY,
41
+ NODE_BEGIN,
42
+ NODE_RESCUE,
43
+ NODE_RESBODY,
44
+ NODE_ENSURE,
45
+ NODE_AND,
46
+ NODE_OR,
47
+ NODE_MASGN,
48
+ NODE_LASGN,
49
+ NODE_DASGN,
50
+ NODE_DASGN_CURR,
51
+ NODE_GASGN,
52
+ NODE_IASGN,
53
+ NODE_CDECL,
54
+ NODE_CVASGN,
55
+ NODE_OP_ASGN1,
56
+ NODE_OP_ASGN2,
57
+ NODE_OP_ASGN_AND,
58
+ NODE_OP_ASGN_OR,
59
+ NODE_OP_CDECL,
60
+ NODE_CALL,
61
+ NODE_OPCALL,
62
+ NODE_FCALL,
63
+ NODE_VCALL,
64
+ NODE_QCALL,
65
+ NODE_SUPER,
66
+ NODE_ZSUPER,
67
+ NODE_LIST,
68
+ NODE_ZLIST,
69
+ NODE_VALUES,
70
+ NODE_HASH,
71
+ NODE_RETURN,
72
+ NODE_YIELD,
73
+ NODE_LVAR,
74
+ NODE_DVAR,
75
+ NODE_GVAR,
76
+ NODE_IVAR,
77
+ NODE_CONST,
78
+ NODE_CVAR,
79
+ NODE_NTH_REF,
80
+ NODE_BACK_REF,
81
+ NODE_MATCH,
82
+ NODE_MATCH2,
83
+ NODE_MATCH3,
84
+ NODE_LIT,
85
+ NODE_STR,
86
+ NODE_DSTR,
87
+ NODE_XSTR,
88
+ NODE_DXSTR,
89
+ NODE_EVSTR,
90
+ NODE_DREGX,
91
+ NODE_ONCE,
92
+ NODE_ARGS,
93
+ NODE_ARGS_AUX,
94
+ NODE_OPT_ARG,
95
+ NODE_KW_ARG,
96
+ NODE_POSTARG,
97
+ NODE_ARGSCAT,
98
+ NODE_ARGSPUSH,
99
+ NODE_SPLAT,
100
+ NODE_BLOCK_PASS,
101
+ NODE_DEFN,
102
+ NODE_DEFS,
103
+ NODE_ALIAS,
104
+ NODE_VALIAS,
105
+ NODE_UNDEF,
106
+ NODE_CLASS,
107
+ NODE_MODULE,
108
+ NODE_SCLASS,
109
+ NODE_COLON2,
110
+ NODE_COLON3,
111
+ NODE_DOT2,
112
+ NODE_DOT3,
113
+ NODE_FLIP2,
114
+ NODE_FLIP3,
115
+ NODE_SELF,
116
+ NODE_NIL,
117
+ NODE_TRUE,
118
+ NODE_FALSE,
119
+ NODE_ERRINFO,
120
+ NODE_DEFINED,
121
+ NODE_POSTEXE,
122
+ NODE_DSYM,
123
+ NODE_ATTRASGN,
124
+ NODE_LAMBDA,
125
+ NODE_METHREF,
126
+ NODE_ARYPTN,
127
+ NODE_HSHPTN,
128
+ NODE_LAST
129
+ };
130
+
131
+ typedef struct rb_code_position_struct {
132
+ int lineno;
133
+ int column;
134
+ } rb_code_position_t;
135
+
136
+ typedef struct rb_code_location_struct {
137
+ rb_code_position_t beg_pos;
138
+ rb_code_position_t end_pos;
139
+ } rb_code_location_t;
140
+
141
+ static inline rb_code_location_t
142
+ code_loc_gen(rb_code_location_t *loc1, rb_code_location_t *loc2)
143
+ {
144
+ rb_code_location_t loc;
145
+ loc.beg_pos = loc1->beg_pos;
146
+ loc.end_pos = loc2->end_pos;
147
+ return loc;
148
+ }
149
+
150
+ typedef struct RNode {
151
+ VALUE flags;
152
+ union {
153
+ struct RNode *node;
154
+ ID id;
155
+ VALUE value;
156
+ ID *tbl;
157
+ } u1;
158
+ union {
159
+ struct RNode *node;
160
+ ID id;
161
+ long argc;
162
+ VALUE value;
163
+ } u2;
164
+ union {
165
+ struct RNode *node;
166
+ ID id;
167
+ long state;
168
+ struct rb_global_entry *entry;
169
+ struct rb_args_info *args;
170
+ struct rb_ary_pattern_info *apinfo;
171
+ VALUE value;
172
+ } u3;
173
+ rb_code_location_t nd_loc;
174
+ int node_id;
175
+ } NODE;
176
+
177
+ #define RNODE(obj) (R_CAST(RNode)(obj))
178
+
179
+ /* FL : 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: FINALIZE, 8: TAINT, 9: UNTRUSTED, 10: EXIVAR, 11: FREEZE */
180
+ /* NODE_FL: 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: NODE_FL_NEWLINE,
181
+ * 8..14: nd_type,
182
+ * 15..: nd_line
183
+ */
184
+ #define NODE_FL_NEWLINE (((VALUE)1)<<7)
185
+
186
+ #define NODE_TYPESHIFT 8
187
+ #define NODE_TYPEMASK (((VALUE)0x7f)<<NODE_TYPESHIFT)
188
+
189
+ #define nd_type(n) ((int) (((n)->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT))
190
+ #define nd_set_type(n,t) \
191
+ (n)->flags=(((n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))<<NODE_TYPESHIFT)&NODE_TYPEMASK))
192
+
193
+ #define NODE_LSHIFT (NODE_TYPESHIFT+7)
194
+ #define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1)
195
+ #define nd_line(n) (int)(((SIGNED_VALUE)(n)->flags)>>NODE_LSHIFT)
196
+ #define nd_set_line(n,l) \
197
+ (n)->flags=(((n)->flags&~((VALUE)(-1)<<NODE_LSHIFT))|((VALUE)((l)&NODE_LMASK)<<NODE_LSHIFT))
198
+
199
+ #define nd_first_column(n) ((int)((n)->nd_loc.beg_pos.column))
200
+ #define nd_set_first_column(n, v) ((n)->nd_loc.beg_pos.column = (v))
201
+ #define nd_first_lineno(n) ((int)((n)->nd_loc.beg_pos.lineno))
202
+ #define nd_set_first_lineno(n, v) ((n)->nd_loc.beg_pos.lineno = (v))
203
+ #define nd_first_loc(n) ((n)->nd_loc.beg_pos)
204
+ #define nd_set_first_loc(n, v) (nd_first_loc(n) = (v))
205
+
206
+ #define nd_last_column(n) ((int)((n)->nd_loc.end_pos.column))
207
+ #define nd_set_last_column(n, v) ((n)->nd_loc.end_pos.column = (v))
208
+ #define nd_last_lineno(n) ((int)((n)->nd_loc.end_pos.lineno))
209
+ #define nd_set_last_lineno(n, v) ((n)->nd_loc.end_pos.lineno = (v))
210
+ #define nd_last_loc(n) ((n)->nd_loc.end_pos)
211
+ #define nd_set_last_loc(n, v) (nd_last_loc(n) = (v))
212
+ #define nd_node_id(n) ((n)->node_id)
213
+ #define nd_set_node_id(n,id) ((n)->node_id = (id))
214
+
215
+ #define nd_head u1.node
216
+ #define nd_alen u2.argc
217
+ #define nd_next u3.node
218
+
219
+ #define nd_cond u1.node
220
+ #define nd_body u2.node
221
+ #define nd_else u3.node
222
+
223
+ #define nd_resq u2.node
224
+ #define nd_ensr u3.node
225
+
226
+ #define nd_1st u1.node
227
+ #define nd_2nd u2.node
228
+
229
+ #define nd_stts u1.node
230
+
231
+ #define nd_entry u3.entry
232
+ #define nd_vid u1.id
233
+ #define nd_cflag u2.id
234
+ #define nd_cval u3.value
235
+
236
+ #define nd_oid u1.id
237
+ #define nd_tbl u1.tbl
238
+
239
+ #define nd_var u1.node
240
+ #define nd_iter u3.node
241
+
242
+ #define nd_value u2.node
243
+ #define nd_aid u3.id
244
+
245
+ #define nd_lit u1.value
246
+
247
+ #define nd_rest u1.id
248
+ #define nd_opt u1.node
249
+ #define nd_pid u1.id
250
+ #define nd_plen u2.argc
251
+
252
+ #define nd_recv u1.node
253
+ #define nd_mid u2.id
254
+ #define nd_args u3.node
255
+ #define nd_ainfo u3.args
256
+
257
+ #define nd_defn u3.node
258
+
259
+ #define nd_cpath u1.node
260
+ #define nd_super u3.node
261
+
262
+ #define nd_beg u1.node
263
+ #define nd_end u2.node
264
+ #define nd_state u3.state
265
+ #define nd_rval u2.value
266
+
267
+ #define nd_nth u2.argc
268
+
269
+ #define nd_tag u1.id
270
+
271
+ #define nd_alias u1.id
272
+ #define nd_orig u2.id
273
+ #define nd_undef u2.node
274
+
275
+ #define nd_brace u2.argc
276
+
277
+ #define nd_pconst u1.node
278
+ #define nd_pkwargs u2.node
279
+ #define nd_pkwrestarg u3.node
280
+
281
+ #define nd_apinfo u3.apinfo
282
+
283
+ #define NEW_NODE(t,a0,a1,a2,loc) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2),loc)
284
+ #define NEW_NODE_WITH_LOCALS(t,a1,a2,loc) node_newnode_with_locals(p, (t),(VALUE)(a1),(VALUE)(a2),loc)
285
+
286
+ #define NEW_DEFN(i,a,d,loc) NEW_NODE(NODE_DEFN,0,i,NEW_SCOPE(a,d,loc),loc)
287
+ #define NEW_DEFS(r,i,a,d,loc) NEW_NODE(NODE_DEFS,r,i,NEW_SCOPE(a,d,loc),loc)
288
+ #define NEW_SCOPE(a,b,loc) NEW_NODE_WITH_LOCALS(NODE_SCOPE,b,a,loc)
289
+ #define NEW_BLOCK(a,loc) NEW_NODE(NODE_BLOCK,a,0,0,loc)
290
+ #define NEW_IF(c,t,e,loc) NEW_NODE(NODE_IF,c,t,e,loc)
291
+ #define NEW_UNLESS(c,t,e,loc) NEW_NODE(NODE_UNLESS,c,t,e,loc)
292
+ #define NEW_CASE(h,b,loc) NEW_NODE(NODE_CASE,h,b,0,loc)
293
+ #define NEW_CASE2(b,loc) NEW_NODE(NODE_CASE2,0,b,0,loc)
294
+ #define NEW_CASE3(h,b,loc) NEW_NODE(NODE_CASE3,h,b,0,loc)
295
+ #define NEW_WHEN(c,t,e,loc) NEW_NODE(NODE_WHEN,c,t,e,loc)
296
+ #define NEW_IN(c,t,e,loc) NEW_NODE(NODE_IN,c,t,e,loc)
297
+ #define NEW_WHILE(c,b,n,loc) NEW_NODE(NODE_WHILE,c,b,n,loc)
298
+ #define NEW_UNTIL(c,b,n,loc) NEW_NODE(NODE_UNTIL,c,b,n,loc)
299
+ #define NEW_FOR(i,b,loc) NEW_NODE(NODE_FOR,0,b,i,loc)
300
+ #define NEW_FOR_MASGN(v,loc) NEW_NODE(NODE_FOR_MASGN,v,0,0,loc)
301
+ #define NEW_ITER(a,b,loc) NEW_NODE(NODE_ITER,0,NEW_SCOPE(a,b,loc),0,loc)
302
+ #define NEW_LAMBDA(a,b,loc) NEW_NODE(NODE_LAMBDA,0,NEW_SCOPE(a,b,loc),0,loc)
303
+ #define NEW_BREAK(s,loc) NEW_NODE(NODE_BREAK,s,0,0,loc)
304
+ #define NEW_NEXT(s,loc) NEW_NODE(NODE_NEXT,s,0,0,loc)
305
+ #define NEW_REDO(loc) NEW_NODE(NODE_REDO,0,0,0,loc)
306
+ #define NEW_RETRY(loc) NEW_NODE(NODE_RETRY,0,0,0,loc)
307
+ #define NEW_BEGIN(b,loc) NEW_NODE(NODE_BEGIN,0,b,0,loc)
308
+ #define NEW_RESCUE(b,res,e,loc) NEW_NODE(NODE_RESCUE,b,res,e,loc)
309
+ #define NEW_RESBODY(a,ex,n,loc) NEW_NODE(NODE_RESBODY,n,ex,a,loc)
310
+ #define NEW_ENSURE(b,en,loc) NEW_NODE(NODE_ENSURE,b,0,en,loc)
311
+ #define NEW_RETURN(s,loc) NEW_NODE(NODE_RETURN,s,0,0,loc)
312
+ #define NEW_YIELD(a,loc) NEW_NODE(NODE_YIELD,a,0,0,loc)
313
+ #define NEW_LIST(a,loc) NEW_NODE(NODE_LIST,a,1,0,loc)
314
+ #define NEW_ZLIST(loc) NEW_NODE(NODE_ZLIST,0,0,0,loc)
315
+ #define NEW_HASH(a,loc) NEW_NODE(NODE_HASH,a,0,0,loc)
316
+ #define NEW_MASGN(l,r,loc) NEW_NODE(NODE_MASGN,l,0,r,loc)
317
+ #define NEW_GASGN(v,val,loc) NEW_NODE(NODE_GASGN,v,val,rb_global_entry(v),loc)
318
+ #define NEW_LASGN(v,val,loc) NEW_NODE(NODE_LASGN,v,val,0,loc)
319
+ #define NEW_DASGN(v,val,loc) NEW_NODE(NODE_DASGN,v,val,0,loc)
320
+ #define NEW_DASGN_CURR(v,val,loc) NEW_NODE(NODE_DASGN_CURR,v,val,0,loc)
321
+ #define NEW_IASGN(v,val,loc) NEW_NODE(NODE_IASGN,v,val,0,loc)
322
+ #define NEW_CDECL(v,val,path,loc) NEW_NODE(NODE_CDECL,v,val,path,loc)
323
+ #define NEW_CVASGN(v,val,loc) NEW_NODE(NODE_CVASGN,v,val,0,loc)
324
+ #define NEW_OP_ASGN1(p,id,a,loc) NEW_NODE(NODE_OP_ASGN1,p,id,a,loc)
325
+ #define NEW_OP_ASGN2(r,t,i,o,val,loc) NEW_NODE(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o,t,loc),loc)
326
+ #define NEW_OP_ASGN22(i,o,t,loc) NEW_NODE(NODE_OP_ASGN2,i,o,t,loc)
327
+ #define NEW_OP_ASGN_OR(i,val,loc) NEW_NODE(NODE_OP_ASGN_OR,i,val,0,loc)
328
+ #define NEW_OP_ASGN_AND(i,val,loc) NEW_NODE(NODE_OP_ASGN_AND,i,val,0,loc)
329
+ #define NEW_OP_CDECL(v,op,val,loc) NEW_NODE(NODE_OP_CDECL,v,val,op,loc)
330
+ #define NEW_GVAR(v,loc) NEW_NODE(NODE_GVAR,v,0,rb_global_entry(v),loc)
331
+ #define NEW_LVAR(v,loc) NEW_NODE(NODE_LVAR,v,0,0,loc)
332
+ #define NEW_DVAR(v,loc) NEW_NODE(NODE_DVAR,v,0,0,loc)
333
+ #define NEW_IVAR(v,loc) NEW_NODE(NODE_IVAR,v,0,0,loc)
334
+ #define NEW_CONST(v,loc) NEW_NODE(NODE_CONST,v,0,0,loc)
335
+ #define NEW_CVAR(v,loc) NEW_NODE(NODE_CVAR,v,0,0,loc)
336
+ #define NEW_NTH_REF(n,loc) NEW_NODE(NODE_NTH_REF,0,n,0,loc)
337
+ #define NEW_BACK_REF(n,loc) NEW_NODE(NODE_BACK_REF,0,n,0,loc)
338
+ #define NEW_MATCH(c,loc) NEW_NODE(NODE_MATCH,c,0,0,loc)
339
+ #define NEW_MATCH2(n1,n2,loc) NEW_NODE(NODE_MATCH2,n1,n2,0,loc)
340
+ #define NEW_MATCH3(r,n2,loc) NEW_NODE(NODE_MATCH3,r,n2,0,loc)
341
+ #define NEW_LIT(l,loc) NEW_NODE(NODE_LIT,l,0,0,loc)
342
+ #define NEW_STR(s,loc) NEW_NODE(NODE_STR,s,0,0,loc)
343
+ #define NEW_DSTR(s,loc) NEW_NODE(NODE_DSTR,s,1,0,loc)
344
+ #define NEW_XSTR(s,loc) NEW_NODE(NODE_XSTR,s,0,0,loc)
345
+ #define NEW_DXSTR(s,loc) NEW_NODE(NODE_DXSTR,s,0,0,loc)
346
+ #define NEW_DSYM(s,loc) NEW_NODE(NODE_DSYM,s,0,0,loc)
347
+ #define NEW_EVSTR(n,loc) NEW_NODE(NODE_EVSTR,0,(n),0,loc)
348
+ #define NEW_CALL(r,m,a,loc) NEW_NODE(NODE_CALL,r,m,a,loc)
349
+ #define NEW_OPCALL(r,m,a,loc) NEW_NODE(NODE_OPCALL,r,m,a,loc)
350
+ #define NEW_FCALL(m,a,loc) NEW_NODE(NODE_FCALL,0,m,a,loc)
351
+ #define NEW_VCALL(m,loc) NEW_NODE(NODE_VCALL,0,m,0,loc)
352
+ #define NEW_SUPER(a,loc) NEW_NODE(NODE_SUPER,0,0,a,loc)
353
+ #define NEW_ZSUPER(loc) NEW_NODE(NODE_ZSUPER,0,0,0,loc)
354
+ #define NEW_ARGS_AUX(r,b,loc) NEW_NODE(NODE_ARGS_AUX,r,b,0,loc)
355
+ #define NEW_OPT_ARG(i,v,loc) NEW_NODE(NODE_OPT_ARG,i,v,0,loc)
356
+ #define NEW_KW_ARG(i,v,loc) NEW_NODE(NODE_KW_ARG,i,v,0,loc)
357
+ #define NEW_POSTARG(i,v,loc) NEW_NODE(NODE_POSTARG,i,v,0,loc)
358
+ #define NEW_ARGSCAT(a,b,loc) NEW_NODE(NODE_ARGSCAT,a,b,0,loc)
359
+ #define NEW_ARGSPUSH(a,b,loc) NEW_NODE(NODE_ARGSPUSH,a,b,0,loc)
360
+ #define NEW_SPLAT(a,loc) NEW_NODE(NODE_SPLAT,a,0,0,loc)
361
+ #define NEW_BLOCK_PASS(b,loc) NEW_NODE(NODE_BLOCK_PASS,0,b,0,loc)
362
+ #define NEW_ALIAS(n,o,loc) NEW_NODE(NODE_ALIAS,n,o,0,loc)
363
+ #define NEW_VALIAS(n,o,loc) NEW_NODE(NODE_VALIAS,n,o,0,loc)
364
+ #define NEW_UNDEF(i,loc) NEW_NODE(NODE_UNDEF,0,i,0,loc)
365
+ #define NEW_CLASS(n,b,s,loc) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(0,b,loc),(s),loc)
366
+ #define NEW_SCLASS(r,b,loc) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(0,b,loc),0,loc)
367
+ #define NEW_MODULE(n,b,loc) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(0,b,loc),0,loc)
368
+ #define NEW_COLON2(c,i,loc) NEW_NODE(NODE_COLON2,c,i,0,loc)
369
+ #define NEW_COLON3(i,loc) NEW_NODE(NODE_COLON3,0,i,0,loc)
370
+ #define NEW_DOT2(b,e,loc) NEW_NODE(NODE_DOT2,b,e,0,loc)
371
+ #define NEW_DOT3(b,e,loc) NEW_NODE(NODE_DOT3,b,e,0,loc)
372
+ #define NEW_SELF(loc) NEW_NODE(NODE_SELF,0,0,1,loc)
373
+ #define NEW_NIL(loc) NEW_NODE(NODE_NIL,0,0,0,loc)
374
+ #define NEW_TRUE(loc) NEW_NODE(NODE_TRUE,0,0,0,loc)
375
+ #define NEW_FALSE(loc) NEW_NODE(NODE_FALSE,0,0,0,loc)
376
+ #define NEW_ERRINFO(loc) NEW_NODE(NODE_ERRINFO,0,0,0,loc)
377
+ #define NEW_DEFINED(e,loc) NEW_NODE(NODE_DEFINED,e,0,0,loc)
378
+ #define NEW_PREEXE(b,loc) NEW_SCOPE(b,loc)
379
+ #define NEW_POSTEXE(b,loc) NEW_NODE(NODE_POSTEXE,0,b,0,loc)
380
+ #define NEW_ATTRASGN(r,m,a,loc) NEW_NODE(NODE_ATTRASGN,r,m,a,loc)
381
+ #define NEW_METHREF(r,m,loc) NEW_NODE(NODE_METHREF,r,m,0,loc)
382
+
383
+ #define NODE_SPECIAL_REQUIRED_KEYWORD ((NODE *)-1)
384
+ #define NODE_REQUIRED_KEYWORD_P(node) ((node)->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD)
385
+ #define NODE_SPECIAL_NO_NAME_REST ((NODE *)-1)
386
+ #define NODE_NAMED_REST_P(node) ((node) != NODE_SPECIAL_NO_NAME_REST)
387
+ #define NODE_SPECIAL_EXCESSIVE_COMMA ((ID)1)
388
+ #define NODE_SPECIAL_NO_REST_KEYWORD ((NODE *)-1)
389
+
390
+ VALUE rb_node_case_when_optimizable_literal(const NODE *const node);
391
+
392
+ RUBY_SYMBOL_EXPORT_BEGIN
393
+
394
+ typedef struct node_buffer_struct node_buffer_t;
395
+ /* T_IMEMO/ast */
396
+ typedef struct rb_ast_body_struct {
397
+ const NODE *root;
398
+ VALUE compile_option;
399
+ int line_count;
400
+ } rb_ast_body_t;
401
+ typedef struct rb_ast_struct {
402
+ VALUE flags;
403
+ node_buffer_t *node_buffer;
404
+ rb_ast_body_t body;
405
+ } rb_ast_t;
406
+ rb_ast_t *rb_ast_new(void);
407
+ void rb_ast_mark(rb_ast_t*);
408
+ void rb_ast_update_references(rb_ast_t*);
409
+ void rb_ast_dispose(rb_ast_t*);
410
+ void rb_ast_free(rb_ast_t*);
411
+ size_t rb_ast_memsize(const rb_ast_t*);
412
+ void rb_ast_add_mark_object(rb_ast_t*, VALUE);
413
+ NODE *rb_ast_newnode(rb_ast_t*, enum node_type type);
414
+ void rb_ast_delete_node(rb_ast_t*, NODE *n);
415
+
416
+ VALUE rb_parser_new(void);
417
+ VALUE rb_parser_end_seen_p(VALUE);
418
+ VALUE rb_parser_encoding(VALUE);
419
+ VALUE rb_parser_get_yydebug(VALUE);
420
+ VALUE rb_parser_set_yydebug(VALUE, VALUE);
421
+ VALUE rb_parser_dump_tree(const NODE *node, int comment);
422
+ void rb_parser_set_options(VALUE, int, int, int, int);
423
+
424
+ rb_ast_t *rb_parser_compile_cstr(VALUE, const char*, const char*, int, int);
425
+ rb_ast_t *rb_parser_compile_string(VALUE, const char*, VALUE, int);
426
+ rb_ast_t *rb_parser_compile_file(VALUE, const char*, VALUE, int);
427
+ rb_ast_t *rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line);
428
+ rb_ast_t *rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line);
429
+ rb_ast_t *rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int line);
430
+
431
+ rb_ast_t *rb_compile_cstr(const char*, const char*, int, int);
432
+ rb_ast_t *rb_compile_string(const char*, VALUE, int);
433
+ rb_ast_t *rb_compile_file(const char*, VALUE, int);
434
+
435
+ void rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2);
436
+ const char *ruby_node_name(int node);
437
+
438
+ const struct kwtable *rb_reserved_word(const char *, unsigned int);
439
+
440
+ struct rb_args_info {
441
+ NODE *pre_init;
442
+ NODE *post_init;
443
+
444
+ int pre_args_num; /* count of mandatory pre-arguments */
445
+ int post_args_num; /* count of mandatory post-arguments */
446
+
447
+ ID first_post_arg;
448
+
449
+ ID rest_arg;
450
+ ID block_arg;
451
+
452
+ NODE *kw_args;
453
+ NODE *kw_rest_arg;
454
+
455
+ NODE *opt_args;
456
+ int no_kwarg;
457
+ VALUE imemo;
458
+ };
459
+
460
+ struct rb_ary_pattern_info {
461
+ NODE *pre_args;
462
+ NODE *rest_arg;
463
+ NODE *post_args;
464
+ VALUE imemo;
465
+ };
466
+
467
+ struct parser_params;
468
+ void *rb_parser_malloc(struct parser_params *, size_t);
469
+ void *rb_parser_realloc(struct parser_params *, void *, size_t);
470
+ void *rb_parser_calloc(struct parser_params *, size_t, size_t);
471
+ void rb_parser_free(struct parser_params *, void *);
472
+ PRINTF_ARGS(void rb_parser_printf(struct parser_params *parser, const char *fmt, ...), 2, 3);
473
+
474
+ RUBY_SYMBOL_EXPORT_END
475
+
476
+ #if defined(__cplusplus)
477
+ #if 0
478
+ { /* satisfy cc-mode */
479
+ #endif
480
+ } /* extern "C" { */
481
+ #endif
482
+
483
+ #endif /* RUBY_NODE_H */