debase-ruby_core_source 3.2.2 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/addr2line.h +3 -1
  4. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/list/list.h +4 -2
  5. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/dln.h +1 -0
  6. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/eval_intern.h +4 -2
  7. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/insns.inc +2 -0
  8. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/insns_info.inc +280 -198
  9. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/array.h +8 -1
  10. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/bits.h +6 -6
  11. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/class.h +53 -3
  12. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/cmdlineopt.h +2 -0
  13. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/cont.h +3 -0
  14. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/encoding.h +3 -0
  15. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/error.h +3 -0
  16. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/gc.h +3 -0
  17. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/hash.h +1 -0
  18. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/imemo.h +0 -1
  19. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/object.h +1 -0
  20. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/parse.h +7 -32
  21. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/random.h +1 -0
  22. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/string.h +0 -1
  23. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/symbol.h +3 -0
  24. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/thread.h +4 -0
  25. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/transcode.h +3 -0
  26. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/variable.h +5 -4
  27. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/vm.h +9 -2
  28. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/iseq.h +5 -1
  29. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/method.h +7 -7
  30. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/node.h +22 -19
  31. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/node_name.inc +4 -2
  32. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/optunifs.inc +1 -1
  33. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/parse.h +16 -5
  34. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/parser_node.h +32 -0
  35. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/prism_compile.h +29 -0
  36. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ractor_core.h +7 -1
  37. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/regint.h +8 -0
  38. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/regparse.h +2 -1
  39. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/revision.h +5 -0
  40. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/rjit.h +6 -8
  41. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/rjit_c.h +0 -1
  42. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/rubyparser.h +1403 -0
  43. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/shape.h +32 -32
  44. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/symbol.h +1 -2
  45. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/thread_none.h +1 -0
  46. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/thread_pthread.h +166 -0
  47. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/thread_win32.h +1 -1
  48. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/variable.h +11 -2
  49. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/version.h +8 -4
  50. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm.inc +225 -185
  51. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_callinfo.h +12 -1
  52. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_core.h +128 -16
  53. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_insnhelper.h +4 -14
  54. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vmtc.inc +2 -0
  55. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/yjit.h +10 -8
  56. data/lib/debase/ruby_core_source/version.rb +1 -1
  57. metadata +121 -120
  58. data/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_node.h +0 -133
  59. data/lib/debase/ruby_core_source/ruby-3.3.0-preview2/revision.h +0 -5
  60. data/lib/debase/ruby_core_source/ruby-3.3.0-preview2/rubyparser.h +0 -628
  61. data/lib/debase/ruby_core_source/ruby-3.3.0-preview2/thread_pthread.h +0 -126
  62. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/builtin.h +0 -0
  63. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/build_assert/build_assert.h +0 -0
  64. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/check_type/check_type.h +0 -0
  65. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/container_of/container_of.h +0 -0
  66. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/str/str.h +0 -0
  67. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/constant.h +0 -0
  68. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/darray.h +0 -0
  69. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/debug_counter.h +0 -0
  70. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/encindex.h +0 -0
  71. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/hrtime.h +0 -0
  72. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/id.h +0 -0
  73. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/id_table.h +0 -0
  74. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/basic_operators.h +0 -0
  75. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/bignum.h +0 -0
  76. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/compar.h +0 -0
  77. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/compile.h +0 -0
  78. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/compilers.h +0 -0
  79. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/complex.h +0 -0
  80. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/dir.h +0 -0
  81. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/enc.h +0 -0
  82. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/enum.h +0 -0
  83. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/enumerator.h +0 -0
  84. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/eval.h +0 -0
  85. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/file.h +0 -0
  86. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/fixnum.h +0 -0
  87. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/inits.h +0 -0
  88. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/io.h +0 -0
  89. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/load.h +0 -0
  90. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/loadpath.h +0 -0
  91. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/math.h +0 -0
  92. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/missing.h +0 -0
  93. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/numeric.h +0 -0
  94. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/proc.h +0 -0
  95. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/process.h +0 -0
  96. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/ractor.h +0 -0
  97. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/range.h +0 -0
  98. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/rational.h +0 -0
  99. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/re.h +0 -0
  100. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/ruby_parser.h +2 -2
  101. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/sanitizers.h +0 -0
  102. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/serial.h +0 -0
  103. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/signal.h +0 -0
  104. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/static_assert.h +0 -0
  105. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/struct.h +0 -0
  106. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/time.h +0 -0
  107. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/util.h +0 -0
  108. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/warnings.h +0 -0
  109. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal.h +0 -0
  110. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/known_errors.inc +0 -0
  111. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/optinsn.inc +0 -0
  112. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/parser_bits.h +0 -0
  113. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/parser_st.h +0 -0
  114. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/parser_value.h +0 -0
  115. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/probes_helper.h +0 -0
  116. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/regenc.h +0 -0
  117. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ruby_assert.h +0 -0
  118. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ruby_atomic.h +0 -0
  119. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/siphash.h +0 -0
  120. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/timev.h +0 -0
  121. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/transcode_data.h +0 -0
  122. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_call_iseq_optimized.inc +0 -0
  123. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_debug.h +0 -0
  124. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_exec.h +0 -0
  125. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_opts.h +0 -0
  126. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_sync.h +0 -0
@@ -1,628 +0,0 @@
1
- #ifndef RUBY_RUBYPARSER_H
2
- #define RUBY_RUBYPARSER_H 1
3
- /*
4
- * This is a header file for librubyparser interface
5
- */
6
-
7
- #include <stdarg.h> /* for va_list */
8
-
9
- #ifdef UNIVERSAL_PARSER
10
-
11
- #define rb_encoding void
12
- #define OnigCodePoint unsigned int
13
- #include "parser_st.h"
14
- #ifndef RUBY_RUBY_H
15
- #include "parser_value.h"
16
- #endif
17
-
18
- #else
19
-
20
- #include "ruby/encoding.h"
21
-
22
- #endif
23
-
24
- /*
25
- * AST Node
26
- */
27
- enum node_type {
28
- NODE_SCOPE,
29
- NODE_BLOCK,
30
- NODE_IF,
31
- NODE_UNLESS,
32
- NODE_CASE,
33
- NODE_CASE2,
34
- NODE_CASE3,
35
- NODE_WHEN,
36
- NODE_IN,
37
- NODE_WHILE,
38
- NODE_UNTIL,
39
- NODE_ITER,
40
- NODE_FOR,
41
- NODE_FOR_MASGN,
42
- NODE_BREAK,
43
- NODE_NEXT,
44
- NODE_REDO,
45
- NODE_RETRY,
46
- NODE_BEGIN,
47
- NODE_RESCUE,
48
- NODE_RESBODY,
49
- NODE_ENSURE,
50
- NODE_AND,
51
- NODE_OR,
52
- NODE_MASGN,
53
- NODE_LASGN,
54
- NODE_DASGN,
55
- NODE_GASGN,
56
- NODE_IASGN,
57
- NODE_CDECL,
58
- NODE_CVASGN,
59
- NODE_OP_ASGN1,
60
- NODE_OP_ASGN2,
61
- NODE_OP_ASGN_AND,
62
- NODE_OP_ASGN_OR,
63
- NODE_OP_CDECL,
64
- NODE_CALL,
65
- NODE_OPCALL,
66
- NODE_FCALL,
67
- NODE_VCALL,
68
- NODE_QCALL,
69
- NODE_SUPER,
70
- NODE_ZSUPER,
71
- NODE_LIST,
72
- NODE_ZLIST,
73
- NODE_VALUES,
74
- NODE_HASH,
75
- NODE_RETURN,
76
- NODE_YIELD,
77
- NODE_LVAR,
78
- NODE_DVAR,
79
- NODE_GVAR,
80
- NODE_IVAR,
81
- NODE_CONST,
82
- NODE_CVAR,
83
- NODE_NTH_REF,
84
- NODE_BACK_REF,
85
- NODE_MATCH,
86
- NODE_MATCH2,
87
- NODE_MATCH3,
88
- NODE_LIT,
89
- NODE_STR,
90
- NODE_DSTR,
91
- NODE_XSTR,
92
- NODE_DXSTR,
93
- NODE_EVSTR,
94
- NODE_DREGX,
95
- NODE_ONCE,
96
- NODE_ARGS,
97
- NODE_ARGS_AUX,
98
- NODE_OPT_ARG,
99
- NODE_KW_ARG,
100
- NODE_POSTARG,
101
- NODE_ARGSCAT,
102
- NODE_ARGSPUSH,
103
- NODE_SPLAT,
104
- NODE_BLOCK_PASS,
105
- NODE_DEFN,
106
- NODE_DEFS,
107
- NODE_ALIAS,
108
- NODE_VALIAS,
109
- NODE_UNDEF,
110
- NODE_CLASS,
111
- NODE_MODULE,
112
- NODE_SCLASS,
113
- NODE_COLON2,
114
- NODE_COLON3,
115
- NODE_DOT2,
116
- NODE_DOT3,
117
- NODE_FLIP2,
118
- NODE_FLIP3,
119
- NODE_SELF,
120
- NODE_NIL,
121
- NODE_TRUE,
122
- NODE_FALSE,
123
- NODE_ERRINFO,
124
- NODE_DEFINED,
125
- NODE_POSTEXE,
126
- NODE_DSYM,
127
- NODE_ATTRASGN,
128
- NODE_LAMBDA,
129
- NODE_ARYPTN,
130
- NODE_HSHPTN,
131
- NODE_FNDPTN,
132
- NODE_ERROR,
133
- NODE_LAST
134
- };
135
-
136
-
137
- #define nd_head u1.node
138
- #define nd_alen u2.argc
139
- #define nd_next u3.node
140
-
141
- #define nd_cond u1.node
142
- #define nd_body u2.node
143
- #define nd_else u3.node
144
-
145
- #define nd_resq u2.node
146
- #define nd_ensr u3.node
147
-
148
- #define nd_1st u1.node
149
- #define nd_2nd u2.node
150
-
151
- #define nd_stts u1.node
152
-
153
- #define nd_vid u1.id
154
-
155
- #define nd_var u1.node
156
- #define nd_iter u3.node
157
-
158
- #define nd_value u2.node
159
- #define nd_aid u3.id
160
-
161
- #define nd_lit u1.value
162
-
163
- #define nd_recv u1.node
164
- #define nd_mid u2.id
165
- #define nd_args u3.node
166
- #define nd_ainfo u3.args
167
-
168
- #define nd_defn u3.node
169
-
170
- #define nd_cpath u1.node
171
- #define nd_super u3.node
172
-
173
- #define nd_beg u1.node
174
- #define nd_end u2.node
175
- #define nd_state u3.state
176
-
177
- #define nd_nth u2.argc
178
-
179
- #define nd_alias u1.id
180
- #define nd_orig u2.id
181
- #define nd_undef u2.node
182
-
183
- #define nd_brace u2.argc
184
-
185
- #define nd_pconst u1.node
186
- #define nd_pkwargs u2.node
187
- #define nd_pkwrestarg u3.node
188
-
189
- #define nd_apinfo u3.apinfo
190
-
191
- #define nd_fpinfo u3.fpinfo
192
-
193
- // for NODE_SCOPE
194
- #define nd_tbl u1.tbl
195
-
196
- // for NODE_ARGS_AUX
197
- #define nd_pid u1.id
198
- #define nd_plen u2.argc
199
- #define nd_cflag u2.id
200
-
201
- // for ripper
202
- #define nd_cval u3.value
203
- #define nd_rval u2.value
204
- #define nd_tag u1.id
205
-
206
- #ifndef FLEX_ARY_LEN
207
- /* From internal/compilers.h */
208
- /* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
209
- #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
210
- # define FLEX_ARY_LEN /* VALUE ary[]; */
211
- #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
212
- # define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
213
- #else
214
- # define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
215
- #endif
216
- #endif
217
-
218
- typedef struct rb_ast_id_table {
219
- int size;
220
- ID ids[FLEX_ARY_LEN];
221
- } rb_ast_id_table_t;
222
-
223
- typedef struct rb_code_position_struct {
224
- int lineno;
225
- int column;
226
- } rb_code_position_t;
227
-
228
- typedef struct rb_code_location_struct {
229
- rb_code_position_t beg_pos;
230
- rb_code_position_t end_pos;
231
- } rb_code_location_t;
232
-
233
- typedef struct RNode {
234
- VALUE flags;
235
- union {
236
- struct RNode *node;
237
- ID id;
238
- VALUE value;
239
- rb_ast_id_table_t *tbl;
240
- } u1;
241
- union {
242
- struct RNode *node;
243
- ID id;
244
- long argc;
245
- VALUE value;
246
- } u2;
247
- union {
248
- struct RNode *node;
249
- ID id;
250
- long state;
251
- struct rb_args_info *args;
252
- struct rb_ary_pattern_info *apinfo;
253
- struct rb_fnd_pattern_info *fpinfo;
254
- VALUE value;
255
- } u3;
256
- rb_code_location_t nd_loc;
257
- int node_id;
258
- } NODE;
259
-
260
- /* FL : 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: FINALIZE, 8: UNUSED, 9: UNUSED, 10: EXIVAR, 11: FREEZE */
261
- /* NODE_FL: 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: NODE_FL_NEWLINE,
262
- * 8..14: nd_type,
263
- * 15..: nd_line
264
- */
265
- #define NODE_FL_NEWLINE (((VALUE)1)<<7)
266
-
267
- #define NODE_TYPESHIFT 8
268
- #define NODE_TYPEMASK (((VALUE)0x7f)<<NODE_TYPESHIFT)
269
-
270
- #define nd_type(n) ((int) (((n)->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT))
271
- #define nd_set_type(n,t) \
272
- rb_node_set_type(n, t)
273
- #define nd_init_type(n,t) \
274
- (n)->flags=(((n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))<<NODE_TYPESHIFT)&NODE_TYPEMASK))
275
-
276
- struct rb_args_info {
277
- NODE *pre_init;
278
- NODE *post_init;
279
-
280
- int pre_args_num; /* count of mandatory pre-arguments */
281
- int post_args_num; /* count of mandatory post-arguments */
282
-
283
- ID first_post_arg;
284
-
285
- ID rest_arg;
286
- ID block_arg;
287
-
288
- NODE *kw_args;
289
- NODE *kw_rest_arg;
290
-
291
- NODE *opt_args;
292
- unsigned int no_kwarg: 1;
293
- unsigned int ruby2_keywords: 1;
294
- unsigned int forwarding: 1;
295
-
296
- VALUE imemo;
297
- };
298
-
299
- struct rb_ary_pattern_info {
300
- NODE *pre_args;
301
- NODE *rest_arg;
302
- NODE *post_args;
303
- };
304
-
305
- struct rb_fnd_pattern_info {
306
- NODE *pre_rest_arg;
307
- NODE *args;
308
- NODE *post_rest_arg;
309
- };
310
-
311
- typedef struct node_buffer_struct node_buffer_t;
312
- /* T_IMEMO/ast */
313
- typedef struct rb_ast_body_struct {
314
- const NODE *root;
315
- VALUE script_lines;
316
- // script_lines is either:
317
- // - a Fixnum that represents the line count of the original source, or
318
- // - an Array that contains the lines of the original source
319
- signed int frozen_string_literal:2; /* -1: not specified, 0: false, 1: true */
320
- signed int coverage_enabled:2; /* -1: not specified, 0: false, 1: true */
321
- } rb_ast_body_t;
322
- typedef struct rb_ast_struct {
323
- VALUE flags;
324
- node_buffer_t *node_buffer;
325
- rb_ast_body_t body;
326
- } rb_ast_t;
327
-
328
-
329
-
330
- /*
331
- * Parser Interface
332
- */
333
-
334
-
335
- typedef struct parser_params rb_parser_t;
336
- #ifndef INTERNAL_IMEMO_H
337
- typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t;
338
- #endif
339
-
340
- #ifdef UNIVERSAL_PARSER
341
- typedef struct rb_parser_config_struct {
342
- /*
343
- * Reference counter.
344
- * This is needed because both parser and ast refer
345
- * same config pointer.
346
- * We can remove this, once decuple parser and ast from Ruby GC.
347
- */
348
- int counter;
349
-
350
- /* Memory */
351
- void *(*malloc)(size_t size);
352
- void *(*calloc)(size_t number, size_t size);
353
- void *(*realloc)(void *ptr, size_t newsiz);
354
- void (*free)(void *ptr);
355
- void *(*alloc_n)(size_t nelems, size_t elemsiz);
356
- void *(*alloc)(size_t elemsiz);
357
- void *(*realloc_n)(void *ptr, size_t newelems, size_t newsiz);
358
- void *(*zalloc)(size_t elemsiz);
359
- void *(*rb_memmove)(void *dest, const void *src, size_t t, size_t n);
360
- void *(*nonempty_memcpy)(void *dest, const void *src, size_t t, size_t n);
361
- void *(*xmalloc_mul_add)(size_t x, size_t y, size_t z);
362
-
363
- /* imemo */
364
- // TODO: Should it return `rb_strterm_t *'?
365
- VALUE (*new_strterm)(VALUE v1, VALUE v2, VALUE v3, VALUE v0, int heredoc);
366
- int (*strterm_is_heredoc)(VALUE strterm);
367
- VALUE (*tmpbuf_auto_free_pointer)(void);
368
- void *(*tmpbuf_set_ptr)(VALUE v, void *ptr);
369
- rb_imemo_tmpbuf_t *(*tmpbuf_parser_heap)(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
370
- rb_ast_t *(*ast_new)(VALUE nb);
371
-
372
- // VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
373
- VALUE (*compile_callback)(VALUE (*func)(VALUE), VALUE arg);
374
- NODE *(*reg_named_capture_assign)(struct parser_params* p, VALUE regexp, const rb_code_location_t *loc);
375
-
376
- /* Object */
377
- VALUE (*obj_freeze)(VALUE obj);
378
- VALUE (*obj_hide)(VALUE obj);
379
- int (*obj_frozen)(VALUE obj);
380
- int (*type_p)(VALUE, int);
381
- void (*obj_freeze_raw)(VALUE obj);
382
-
383
- int (*fixnum_p)(VALUE);
384
- int (*symbol_p)(VALUE);
385
-
386
- /* Variable */
387
- VALUE (*attr_get)(VALUE obj, ID id);
388
-
389
- /* Array */
390
- VALUE (*ary_new)(void);
391
- VALUE (*ary_push)(VALUE ary, VALUE elem);
392
- VALUE (*ary_new_from_args)(long n, ...);
393
- VALUE (*ary_pop)(VALUE ary);
394
- VALUE (*ary_last)(int argc, const VALUE *argv, VALUE ary);
395
- VALUE (*ary_unshift)(VALUE ary, VALUE item);
396
- VALUE (*ary_new2)(long capa); // ary_new_capa
397
- VALUE (*ary_entry)(VALUE ary, long offset);
398
- VALUE (*ary_join)(VALUE ary, VALUE sep);
399
- VALUE (*ary_reverse)(VALUE ary);
400
- VALUE (*ary_clear)(VALUE ary);
401
- long (*array_len)(VALUE a);
402
- VALUE (*array_aref)(VALUE, long);
403
-
404
- /* Symbol */
405
- VALUE (*sym_intern_ascii_cstr)(const char *ptr);
406
- ID (*make_temporary_id)(size_t n);
407
- int (*is_local_id)(ID);
408
- int (*is_attrset_id)(ID);
409
- int (*is_global_name_punct)(const int c);
410
- int (*id_type)(ID id);
411
- ID (*id_attrset)(ID);
412
- ID (*intern)(const char *name);
413
- ID (*intern2)(const char *name, long len);
414
- ID (*intern3)(const char *name, long len, rb_encoding *enc);
415
- ID (*intern_str)(VALUE str);
416
- int (*is_notop_id)(ID);
417
- int (*enc_symname_type)(const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset);
418
- VALUE (*str_intern)(VALUE str);
419
- const char *(*id2name)(ID id);
420
- VALUE (*id2str)(ID id);
421
- VALUE (*id2sym)(ID x);
422
- ID (*sym2id)(VALUE sym);
423
-
424
- /* String */
425
- VALUE (*str_catf)(VALUE str, const char *format, ...);
426
- VALUE (*str_cat_cstr)(VALUE str, const char *ptr);
427
- VALUE (*str_subseq)(VALUE str, long beg, long len);
428
- VALUE (*str_dup)(VALUE str);
429
- VALUE (*str_new_frozen)(VALUE orig);
430
- VALUE (*str_buf_new)(long capa);
431
- VALUE (*str_buf_cat)(VALUE, const char*, long);
432
- void (*str_modify)(VALUE str);
433
- void (*str_set_len)(VALUE str, long len);
434
- VALUE (*str_cat)(VALUE str, const char *ptr, long len);
435
- VALUE (*str_resize)(VALUE str, long len);
436
- VALUE (*str_new)(const char *ptr, long len);
437
- VALUE (*str_new_cstr)(const char *ptr);
438
- VALUE (*fstring)(VALUE);
439
- int (*is_ascii_string)(VALUE str);
440
- VALUE (*enc_str_new)(const char *ptr, long len, rb_encoding *enc);
441
- VALUE (*enc_str_buf_cat)(VALUE str, const char *ptr, long len, rb_encoding *enc);
442
- VALUE (*str_buf_append)(VALUE str, VALUE str2);
443
- VALUE (*str_vcatf)(VALUE str, const char *fmt, va_list ap);
444
- char *(*string_value_cstr)(volatile VALUE *ptr);
445
- VALUE (*rb_sprintf)(const char *format, ...);
446
- char *(*rstring_ptr)(VALUE str);
447
- char *(*rstring_end)(VALUE str);
448
- long (*rstring_len)(VALUE str);
449
- VALUE (*filesystem_str_new_cstr)(const char *ptr);
450
- VALUE (*obj_as_string)(VALUE);
451
-
452
- /* Hash */
453
- VALUE (*hash_clear)(VALUE hash);
454
- VALUE (*hash_new)(void);
455
- VALUE (*hash_aset)(VALUE hash, VALUE key, VALUE val);
456
- VALUE (*hash_lookup)(VALUE hash, VALUE key);
457
- VALUE (*ident_hash_new)(void);
458
-
459
- /* Fixnum */
460
- VALUE (*int2fix)(long i);
461
-
462
- /* Bignum */
463
- void (*bignum_negate)(VALUE b);
464
- VALUE (*big_norm)(VALUE x);
465
- VALUE (*cstr_to_inum)(const char *str, int base, int badcheck);
466
-
467
- /* Float */
468
- VALUE (*float_new)(double d);
469
- double (*float_value)(VALUE v);
470
-
471
- /* Numeric */
472
- int (*num2int)(VALUE val);
473
- VALUE (*int_positive_pow)(long x, unsigned long y);
474
- VALUE (*int2num)(int v);
475
- long (*fix2long)(VALUE val);
476
-
477
- /* Rational */
478
- VALUE (*rational_new)(VALUE x, VALUE y);
479
- VALUE (*rational_raw1)(VALUE x);
480
- void (*rational_set_num)(VALUE r, VALUE n);
481
- VALUE (*rational_get_num)(VALUE obj);
482
-
483
- /* Complex */
484
- VALUE (*complex_raw)(VALUE x, VALUE y);
485
- void (*rcomplex_set_real)(VALUE cmp, VALUE r);
486
- void (*rcomplex_set_imag)(VALUE cmp, VALUE i);
487
- VALUE (*rcomplex_get_real)(VALUE obj);
488
- VALUE (*rcomplex_get_imag)(VALUE obj);
489
-
490
- /* IO */
491
- int (*stderr_tty_p)(void);
492
- void (*write_error_str)(VALUE mesg);
493
- VALUE (*default_rs)(void);
494
- VALUE (*io_write)(VALUE io, VALUE str);
495
- VALUE (*io_flush)(VALUE io);
496
- VALUE (*io_puts)(int argc, const VALUE *argv, VALUE out);
497
- VALUE (*io_gets_internal)(VALUE io);
498
-
499
- /* IO (Ractor) */
500
- VALUE (*debug_output_stdout)(void);
501
- VALUE (*debug_output_stderr)(void);
502
-
503
- /* Encoding */
504
- int (*is_usascii_enc)(rb_encoding *enc);
505
- int (*enc_isalnum)(OnigCodePoint c, rb_encoding *enc);
506
- int (*enc_precise_mbclen)(const char *p, const char *e, rb_encoding *enc);
507
- int (*mbclen_charfound_p)(int len);
508
- const char *(*enc_name)(rb_encoding *enc);
509
- char *(*enc_prev_char)(const char *s, const char *p, const char *e, rb_encoding *enc);
510
- rb_encoding* (*enc_get)(VALUE obj);
511
- int (*enc_asciicompat)(rb_encoding *enc);
512
- rb_encoding *(*utf8_encoding)(void);
513
- VALUE (*enc_associate)(VALUE obj, rb_encoding *enc);
514
- rb_encoding *(*ascii8bit_encoding)(void);
515
- int (*enc_codelen)(int c, rb_encoding *enc);
516
- int (*enc_mbcput)(unsigned int c, void *buf, rb_encoding *enc);
517
- int (*char_to_option_kcode)(int c, int *option, int *kcode);
518
- int (*ascii8bit_encindex)(void);
519
- int (*enc_find_index)(const char *name);
520
- rb_encoding *(*enc_from_index)(int idx);
521
- VALUE (*enc_associate_index)(VALUE obj, int encindex);
522
- int (*enc_isspace)(OnigCodePoint c, rb_encoding *enc);
523
- int enc_coderange_7bit;
524
- int enc_coderange_unknown;
525
- rb_encoding *(*enc_compatible)(VALUE str1, VALUE str2);
526
- VALUE (*enc_from_encoding)(rb_encoding *enc);
527
- int (*encoding_get)(VALUE obj);
528
- void (*encoding_set)(VALUE obj, int encindex);
529
- int (*encoding_is_ascii8bit)(VALUE obj);
530
- rb_encoding *(*usascii_encoding)(void);
531
-
532
- /* Ractor */
533
- VALUE (*ractor_make_shareable)(VALUE obj);
534
-
535
- /* Compile */
536
- // int rb_local_defined(ID id, const rb_iseq_t *iseq);
537
- int (*local_defined)(ID, const void*);
538
- // int rb_dvar_defined(ID id, const rb_iseq_t *iseq);
539
- int (*dvar_defined)(ID, const void*);
540
-
541
- /* Compile (parse.y) */
542
- int (*literal_cmp)(VALUE val, VALUE lit);
543
- parser_st_index_t (*literal_hash)(VALUE a);
544
-
545
- /* Error (Exception) */
546
- const char *(*builtin_class_name)(VALUE x);
547
- VALUE (*syntax_error_append)(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list);
548
- void (*raise)(VALUE exc, const char *fmt, ...);
549
- VALUE (*syntax_error_new)(void);
550
-
551
- /* Eval */
552
- VALUE (*errinfo)(void);
553
- void (*set_errinfo)(VALUE err);
554
- void (*exc_raise)(VALUE mesg);
555
- VALUE (*make_exception)(int argc, const VALUE *argv);
556
-
557
- /* GC */
558
- void (*sized_xfree)(void *x, size_t size);
559
- void *(*sized_realloc_n)(void *ptr, size_t new_count, size_t element_size, size_t old_count);
560
- VALUE (*obj_write)(VALUE, VALUE *, VALUE);
561
- VALUE (*obj_written)(VALUE, VALUE, VALUE);
562
- void (*gc_register_mark_object)(VALUE object);
563
- void (*gc_guard)(VALUE);
564
- void (*gc_mark)(VALUE);
565
- void (*gc_mark_movable)(VALUE ptr);
566
- VALUE (*gc_location)(VALUE value);
567
-
568
- /* Re */
569
- VALUE (*reg_compile)(VALUE str, int options, const char *sourcefile, int sourceline);
570
- VALUE (*reg_check_preprocess)(VALUE str);
571
- int (*memcicmp)(const void *x, const void *y, long len);
572
-
573
- /* Error */
574
- void (*compile_warn)(const char *file, int line, const char *fmt, ...);
575
- void (*compile_warning)(const char *file, int line, const char *fmt, ...);
576
- void (*bug)(const char *fmt, ...);
577
- void (*fatal)(const char *fmt, ...);
578
- VALUE (*verbose)(void);
579
-
580
- /* VM */
581
- VALUE (*make_backtrace)(void);
582
-
583
- /* Util */
584
- unsigned long (*scan_hex)(const char *start, size_t len, size_t *retlen);
585
- unsigned long (*scan_oct)(const char *start, size_t len, size_t *retlen);
586
- unsigned long (*scan_digits)(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
587
- double (*strtod)(const char *s00, char **se);
588
-
589
- /* Misc */
590
- VALUE (*rbool)(VALUE);
591
- int (*undef_p)(VALUE);
592
- int (*rtest)(VALUE obj);
593
- int (*nil_p)(VALUE obj);
594
- int (*flonum_p)(VALUE obj);
595
- VALUE qnil;
596
- VALUE qtrue;
597
- VALUE qfalse;
598
- VALUE qundef;
599
- VALUE eArgError;
600
- VALUE mRubyVMFrozenCore;
601
- int (*long2int)(long);
602
- int (*special_const_p)(VALUE);
603
- int (*builtin_type)(VALUE);
604
-
605
- VALUE (*node_case_when_optimizable_literal)(const NODE *const node);
606
-
607
- /* For Ripper */
608
- VALUE (*static_id2sym)(ID id);
609
- long (*str_coderange_scan_restartable)(const char *s, const char *e, rb_encoding *enc, int *cr);
610
- } rb_parser_config_t;
611
-
612
- #undef rb_encoding
613
- #undef OnigCodePoint
614
- #endif /* UNIVERSAL_PARSER */
615
-
616
- RUBY_SYMBOL_EXPORT_BEGIN
617
- void rb_ruby_parser_free(void *ptr);
618
- rb_ast_t* rb_ruby_parser_compile_string(rb_parser_t *p, const char *f, VALUE s, int line);
619
-
620
- #ifdef UNIVERSAL_PARSER
621
- rb_parser_config_t *rb_ruby_parser_config_new(void *(*malloc)(size_t size));
622
- void rb_ruby_parser_config_free(rb_parser_config_t *config);
623
- rb_parser_t *rb_ruby_parser_allocate(rb_parser_config_t *config);
624
- rb_parser_t *rb_ruby_parser_new(rb_parser_config_t *config);
625
- #endif
626
- RUBY_SYMBOL_EXPORT_END
627
-
628
- #endif /* RUBY_RUBYPARSER_H */