debase-ruby_core_source 3.3.6 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (293) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +6 -0
  4. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/builtin.h +7 -1
  5. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/darray.h +1 -3
  6. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/id.h +5 -0
  7. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/insns.inc +2 -0
  8. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/insns_info.inc +310 -175
  9. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/basic_operators.h +1 -0
  10. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/bits.h +82 -0
  11. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/encoding.h +2 -0
  12. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/error.h +26 -0
  13. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/fixnum.h +1 -0
  14. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/gc.h +14 -6
  15. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/imemo.h +6 -1
  16. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/io.h +1 -1
  17. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/parse.h +2 -1
  18. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/proc.h +1 -0
  19. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/ractor.h +4 -0
  20. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/sanitizers.h +31 -39
  21. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/string.h +22 -10
  22. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/thread.h +23 -0
  23. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/vm.h +1 -1
  24. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/method.h +1 -0
  25. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/optunifs.inc +1 -1
  26. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/parse.h +2 -2
  27. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/ast.h +427 -3
  28. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/defines.h +8 -7
  29. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/diagnostic.h +1 -0
  30. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/extension.h +1 -1
  31. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/prism/prism.h +47 -11
  32. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/version.h +2 -2
  33. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism_compile.h +5 -5
  34. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/ractor_core.h +6 -6
  35. data/lib/debase/ruby_core_source/ruby-3.4.0/revision.h +5 -0
  36. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/rubyparser.h +3 -2
  37. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/thread_pthread.h +0 -1
  38. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/version.h +1 -1
  39. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/vm.inc +151 -88
  40. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/vm_core.h +40 -12
  41. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/vm_sync.h +3 -3
  42. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/vmtc.inc +2 -0
  43. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/yjit.h +1 -0
  44. data/lib/debase/ruby_core_source/version.rb +1 -1
  45. metadata +147 -293
  46. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/darray.h +0 -191
  47. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/debug_counter.h +0 -423
  48. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/dln.h +0 -34
  49. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id.h +0 -343
  50. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns.inc +0 -259
  51. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns_info.inc +0 -9530
  52. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/array.h +0 -151
  53. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/basic_operators.h +0 -63
  54. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bits.h +0 -568
  55. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h +0 -283
  56. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/error.h +0 -216
  57. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/fixnum.h +0 -184
  58. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/gc.h +0 -334
  59. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/hash.h +0 -191
  60. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/imemo.h +0 -260
  61. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/io.h +0 -140
  62. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/parse.h +0 -117
  63. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ractor.h +0 -6
  64. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/sanitizers.h +0 -297
  65. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/string.h +0 -182
  66. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/thread.h +0 -79
  67. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/vm.h +0 -137
  68. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/known_errors.inc +0 -1419
  69. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/method.h +0 -255
  70. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optunifs.inc +0 -43
  71. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parse.h +0 -243
  72. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/ast.h +0 -6245
  73. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/defines.h +0 -206
  74. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/diagnostic.h +0 -433
  75. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/extension.h +0 -19
  76. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/node.h +0 -150
  77. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/options.h +0 -305
  78. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/parser.h +0 -891
  79. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h +0 -33
  80. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/static_literals.h +0 -120
  81. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_char.h +0 -205
  82. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_constant_pool.h +0 -226
  83. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_integer.h +0 -119
  84. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_newline_list.h +0 -102
  85. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string.h +0 -174
  86. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h +0 -44
  87. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/version.h +0 -29
  88. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism_compile.h +0 -88
  89. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ractor_core.h +0 -393
  90. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regint.h +0 -1010
  91. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h +0 -5
  92. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rubyparser.h +0 -1430
  93. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/shape.h +0 -233
  94. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/symbol.h +0 -118
  95. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_pthread.h +0 -166
  96. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/version.h +0 -69
  97. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm.inc +0 -5643
  98. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_callinfo.h +0 -605
  99. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_core.h +0 -2236
  100. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_insnhelper.h +0 -272
  101. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_sync.h +0 -137
  102. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vmtc.inc +0 -253
  103. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/addr2line.h +0 -22
  104. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/builtin.h +0 -119
  105. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/build_assert/build_assert.h +0 -40
  106. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/check_type/check_type.h +0 -63
  107. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/container_of/container_of.h +0 -142
  108. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/list/list.h +0 -791
  109. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/str/str.h +0 -17
  110. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/constant.h +0 -53
  111. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/encindex.h +0 -70
  112. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/eval_intern.h +0 -324
  113. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/hrtime.h +0 -237
  114. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/id_table.h +0 -39
  115. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bignum.h +0 -244
  116. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cmdlineopt.h +0 -65
  117. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compar.h +0 -29
  118. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compile.h +0 -34
  119. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compilers.h +0 -107
  120. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/complex.h +0 -29
  121. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cont.h +0 -35
  122. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/dir.h +0 -16
  123. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enc.h +0 -19
  124. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/encoding.h +0 -36
  125. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enum.h +0 -18
  126. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enumerator.h +0 -21
  127. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/eval.h +0 -33
  128. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/file.h +0 -38
  129. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/inits.h +0 -47
  130. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/load.h +0 -18
  131. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/loadpath.h +0 -16
  132. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/math.h +0 -23
  133. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/missing.h +0 -19
  134. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/numeric.h +0 -274
  135. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/object.h +0 -63
  136. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/proc.h +0 -30
  137. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/process.h +0 -124
  138. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/random.h +0 -17
  139. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/range.h +0 -40
  140. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/rational.h +0 -71
  141. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/re.h +0 -28
  142. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/ruby_parser.h +0 -102
  143. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/serial.h +0 -23
  144. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/signal.h +0 -24
  145. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/st.h +0 -11
  146. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/static_assert.h +0 -16
  147. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/struct.h +0 -127
  148. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/symbol.h +0 -45
  149. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/time.h +0 -34
  150. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/transcode.h +0 -23
  151. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/util.h +0 -27
  152. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/variable.h +0 -72
  153. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/warnings.h +0 -16
  154. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal.h +0 -108
  155. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/iseq.h +0 -340
  156. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node.h +0 -111
  157. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node_name.inc +0 -224
  158. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/optinsn.inc +0 -128
  159. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_bits.h +0 -564
  160. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_node.h +0 -32
  161. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_st.h +0 -162
  162. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_value.h +0 -106
  163. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/encoding.h +0 -283
  164. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/pack.h +0 -163
  165. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prettyprint.h +0 -34
  166. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prism.h +0 -336
  167. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_buffer.h +0 -218
  168. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_list.h +0 -97
  169. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_memchr.h +0 -29
  170. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strncasecmp.h +0 -32
  171. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strpbrk.h +0 -46
  172. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/probes_helper.h +0 -42
  173. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regenc.h +0 -254
  174. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regparse.h +0 -371
  175. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/revision.h +0 -5
  176. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit.h +0 -101
  177. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h +0 -165
  178. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_assert.h +0 -14
  179. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h +0 -23
  180. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/siphash.h +0 -48
  181. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_none.h +0 -21
  182. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_win32.h +0 -58
  183. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/timev.h +0 -58
  184. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/transcode_data.h +0 -138
  185. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/variable.h +0 -39
  186. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_call_iseq_optimized.inc +0 -244
  187. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_debug.h +0 -124
  188. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_exec.h +0 -199
  189. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_opts.h +0 -67
  190. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/yjit.h +0 -79
  191. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/addr2line.h +0 -0
  192. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/ccan/build_assert/build_assert.h +0 -0
  193. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/ccan/check_type/check_type.h +0 -0
  194. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/ccan/container_of/container_of.h +0 -0
  195. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/ccan/list/list.h +0 -0
  196. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/ccan/str/str.h +0 -0
  197. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/constant.h +0 -0
  198. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/debug_counter.h +0 -0
  199. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/dln.h +0 -0
  200. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/encindex.h +0 -0
  201. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/eval_intern.h +0 -0
  202. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/hrtime.h +0 -0
  203. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/id_table.h +0 -0
  204. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/array.h +0 -0
  205. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/bignum.h +0 -0
  206. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/class.h +0 -0
  207. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/cmdlineopt.h +0 -0
  208. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/compar.h +0 -0
  209. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/compile.h +0 -0
  210. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/compilers.h +0 -0
  211. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/complex.h +0 -0
  212. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/cont.h +0 -0
  213. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/dir.h +0 -0
  214. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/enc.h +0 -0
  215. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/enum.h +0 -0
  216. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/enumerator.h +0 -0
  217. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/eval.h +0 -0
  218. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/file.h +0 -0
  219. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/internal/hash.h +0 -0
  220. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/inits.h +0 -0
  221. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/load.h +0 -0
  222. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/loadpath.h +0 -0
  223. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/math.h +0 -0
  224. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/missing.h +0 -0
  225. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/numeric.h +0 -0
  226. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/object.h +0 -0
  227. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/process.h +0 -0
  228. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/random.h +0 -0
  229. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/range.h +0 -0
  230. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/rational.h +0 -0
  231. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/re.h +0 -0
  232. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/ruby_parser.h +0 -0
  233. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/serial.h +0 -0
  234. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/signal.h +0 -0
  235. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/st.h +0 -0
  236. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/static_assert.h +0 -0
  237. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/struct.h +0 -0
  238. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/symbol.h +0 -0
  239. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/time.h +0 -0
  240. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/transcode.h +0 -0
  241. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/util.h +0 -0
  242. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/variable.h +0 -0
  243. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal/warnings.h +0 -0
  244. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/internal.h +0 -0
  245. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/iseq.h +0 -0
  246. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/known_errors.inc +0 -0
  247. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/node.h +0 -0
  248. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/node_name.inc +0 -0
  249. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/optinsn.inc +0 -0
  250. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/parser_bits.h +0 -0
  251. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/parser_node.h +0 -0
  252. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/parser_st.h +0 -0
  253. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/parser_value.h +0 -0
  254. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/prism/encoding.h +0 -0
  255. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/node.h +0 -0
  256. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/options.h +0 -0
  257. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/prism/pack.h +0 -0
  258. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/parser.h +0 -0
  259. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/prism/prettyprint.h +0 -0
  260. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/regexp.h +0 -0
  261. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/static_literals.h +0 -0
  262. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/prism/util/pm_buffer.h +0 -0
  263. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/util/pm_char.h +0 -0
  264. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/util/pm_constant_pool.h +0 -0
  265. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/util/pm_integer.h +0 -0
  266. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/prism/util/pm_list.h +0 -0
  267. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/prism/util/pm_memchr.h +0 -0
  268. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/util/pm_newline_list.h +0 -0
  269. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/prism/util/pm_string.h +0 -0
  270. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/prism/util/pm_strncasecmp.h +0 -0
  271. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/prism/util/pm_strpbrk.h +0 -0
  272. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/probes_helper.h +0 -0
  273. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/regenc.h +0 -0
  274. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/regint.h +0 -0
  275. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/regparse.h +0 -0
  276. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/rjit.h +0 -0
  277. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/rjit_c.h +0 -0
  278. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/ruby_assert.h +0 -0
  279. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/ruby_atomic.h +0 -0
  280. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/shape.h +0 -0
  281. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/siphash.h +0 -0
  282. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/symbol.h +0 -0
  283. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/thread_none.h +0 -0
  284. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/thread_win32.h +0 -0
  285. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/timev.h +0 -0
  286. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/transcode_data.h +0 -0
  287. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/variable.h +0 -0
  288. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/vm_call_iseq_optimized.inc +0 -0
  289. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/vm_callinfo.h +0 -0
  290. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/vm_debug.h +0 -0
  291. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/vm_exec.h +0 -0
  292. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0}/vm_insnhelper.h +0 -0
  293. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0}/vm_opts.h +0 -0
@@ -1,150 +0,0 @@
1
- /**
2
- * @file node.h
3
- *
4
- * Functions related to nodes in the AST.
5
- */
6
- #ifndef PRISM_NODE_H
7
- #define PRISM_NODE_H
8
-
9
- #include "prism/defines.h"
10
- #include "prism/parser.h"
11
- #include "prism/util/pm_buffer.h"
12
-
13
- /**
14
- * Loop through each node in the node list, writing each node to the given
15
- * pm_node_t pointer.
16
- */
17
- #define PM_NODE_LIST_FOREACH(list, index, node) \
18
- for (size_t index = 0; index < (list)->size && ((node) = (list)->nodes[index]); index++)
19
-
20
- /**
21
- * Append a new node onto the end of the node list.
22
- *
23
- * @param list The list to append to.
24
- * @param node The node to append.
25
- */
26
- void pm_node_list_append(pm_node_list_t *list, pm_node_t *node);
27
-
28
- /**
29
- * Prepend a new node onto the beginning of the node list.
30
- *
31
- * @param list The list to prepend to.
32
- * @param node The node to prepend.
33
- */
34
- void pm_node_list_prepend(pm_node_list_t *list, pm_node_t *node);
35
-
36
- /**
37
- * Concatenate the given node list onto the end of the other node list.
38
- *
39
- * @param list The list to concatenate onto.
40
- * @param other The list to concatenate.
41
- */
42
- void pm_node_list_concat(pm_node_list_t *list, pm_node_list_t *other);
43
-
44
- /**
45
- * Free the internal memory associated with the given node list.
46
- *
47
- * @param list The list to free.
48
- */
49
- void pm_node_list_free(pm_node_list_t *list);
50
-
51
- /**
52
- * Deallocate a node and all of its children.
53
- *
54
- * @param parser The parser that owns the node.
55
- * @param node The node to deallocate.
56
- */
57
- PRISM_EXPORTED_FUNCTION void pm_node_destroy(pm_parser_t *parser, struct pm_node *node);
58
-
59
- /**
60
- * This struct stores the information gathered by the pm_node_memsize function.
61
- * It contains both the memory footprint and additionally metadata about the
62
- * shape of the tree.
63
- */
64
- typedef struct {
65
- /** The total memory footprint of the node and all of its children. */
66
- size_t memsize;
67
-
68
- /** The number of children the node has. */
69
- size_t node_count;
70
- } pm_memsize_t;
71
-
72
- /**
73
- * Calculates the memory footprint of a given node.
74
- *
75
- * @param node The node to calculate the memory footprint of.
76
- * @param memsize The memory footprint of the node and all of its children.
77
- */
78
- PRISM_EXPORTED_FUNCTION void pm_node_memsize(pm_node_t *node, pm_memsize_t *memsize);
79
-
80
- /**
81
- * Returns a string representation of the given node type.
82
- *
83
- * @param node_type The node type to convert to a string.
84
- * @return A string representation of the given node type.
85
- */
86
- PRISM_EXPORTED_FUNCTION const char * pm_node_type_to_str(pm_node_type_t node_type);
87
-
88
- /**
89
- * Visit each of the nodes in this subtree using the given visitor callback. The
90
- * callback function will be called for each node in the subtree. If it returns
91
- * false, then that node's children will not be visited. If it returns true,
92
- * then the children will be visited. The data parameter is treated as an opaque
93
- * pointer and is passed to the visitor callback for consumers to use as they
94
- * see fit.
95
- *
96
- * As an example:
97
- *
98
- * ```c
99
- * #include "prism.h"
100
- *
101
- * bool visit(const pm_node_t *node, void *data) {
102
- * size_t *indent = (size_t *) data;
103
- * for (size_t i = 0; i < *indent * 2; i++) putc(' ', stdout);
104
- * printf("%s\n", pm_node_type_to_str(node->type));
105
- *
106
- * size_t next_indent = *indent + 1;
107
- * size_t *next_data = &next_indent;
108
- * pm_visit_child_nodes(node, visit, next_data);
109
- *
110
- * return false;
111
- * }
112
- *
113
- * int main(void) {
114
- * const char *source = "1 + 2; 3 + 4";
115
- * size_t size = strlen(source);
116
- *
117
- * pm_parser_t parser;
118
- * pm_options_t options = { 0 };
119
- * pm_parser_init(&parser, (const uint8_t *) source, size, &options);
120
- *
121
- * size_t indent = 0;
122
- * pm_node_t *node = pm_parse(&parser);
123
- *
124
- * size_t *data = &indent;
125
- * pm_visit_node(node, visit, data);
126
- *
127
- * pm_node_destroy(&parser, node);
128
- * pm_parser_free(&parser);
129
- * return EXIT_SUCCESS;
130
- * }
131
- * ```
132
- *
133
- * @param node The root node to start visiting from.
134
- * @param visitor The callback to call for each node in the subtree.
135
- * @param data An opaque pointer that is passed to the visitor callback.
136
- */
137
- PRISM_EXPORTED_FUNCTION void pm_visit_node(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data);
138
-
139
- /**
140
- * Visit the children of the given node with the given callback. This is the
141
- * default behavior for walking the tree that is called from pm_visit_node if
142
- * the callback returns true.
143
- *
144
- * @param node The node to visit the children of.
145
- * @param visitor The callback to call for each child node.
146
- * @param data An opaque pointer that is passed to the visitor callback.
147
- */
148
- PRISM_EXPORTED_FUNCTION void pm_visit_child_nodes(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data);
149
-
150
- #endif
@@ -1,305 +0,0 @@
1
- /**
2
- * @file options.h
3
- *
4
- * The options that can be passed to parsing.
5
- */
6
- #ifndef PRISM_OPTIONS_H
7
- #define PRISM_OPTIONS_H
8
-
9
- #include "prism/defines.h"
10
- #include "prism/util/pm_string.h"
11
-
12
- #include <stdbool.h>
13
- #include <stddef.h>
14
- #include <stdint.h>
15
-
16
- /**
17
- * String literals should be made frozen.
18
- */
19
- #define PM_OPTIONS_FROZEN_STRING_LITERAL_DISABLED ((int8_t) -1)
20
-
21
- /**
22
- * String literals may be frozen or mutable depending on the implementation
23
- * default.
24
- */
25
- #define PM_OPTIONS_FROZEN_STRING_LITERAL_UNSET ((int8_t) 0)
26
-
27
- /**
28
- * String literals should be made mutable.
29
- */
30
- #define PM_OPTIONS_FROZEN_STRING_LITERAL_ENABLED ((int8_t) 1)
31
-
32
- /**
33
- * A scope of locals surrounding the code that is being parsed.
34
- */
35
- typedef struct pm_options_scope {
36
- /** The number of locals in the scope. */
37
- size_t locals_count;
38
-
39
- /** The names of the locals in the scope. */
40
- pm_string_t *locals;
41
- } pm_options_scope_t;
42
-
43
- /**
44
- * The version of Ruby syntax that we should be parsing with. This is used to
45
- * allow consumers to specify which behavior they want in case they need to
46
- * parse in the same way as a specific version of CRuby would have.
47
- */
48
- typedef enum {
49
- /** The current version of prism. */
50
- PM_OPTIONS_VERSION_LATEST = 0,
51
-
52
- /** The vendored version of prism in CRuby 3.3.x. */
53
- PM_OPTIONS_VERSION_CRUBY_3_3 = 1
54
- } pm_options_version_t;
55
-
56
- /**
57
- * The options that can be passed to the parser.
58
- */
59
- typedef struct {
60
- /** The name of the file that is currently being parsed. */
61
- pm_string_t filepath;
62
-
63
- /**
64
- * The line within the file that the parse starts on. This value is
65
- * 1-indexed.
66
- */
67
- int32_t line;
68
-
69
- /**
70
- * The name of the encoding that the source file is in. Note that this must
71
- * correspond to a name that can be found with Encoding.find in Ruby.
72
- */
73
- pm_string_t encoding;
74
-
75
- /**
76
- * The number of scopes surrounding the code that is being parsed.
77
- */
78
- size_t scopes_count;
79
-
80
- /**
81
- * The scopes surrounding the code that is being parsed. For most parses
82
- * this will be NULL, but for evals it will be the locals that are in scope
83
- * surrounding the eval. Scopes are ordered from the outermost scope to the
84
- * innermost one.
85
- */
86
- pm_options_scope_t *scopes;
87
-
88
- /**
89
- * The version of prism that we should be parsing with. This is used to
90
- * allow consumers to specify which behavior they want in case they need to
91
- * parse exactly as a specific version of CRuby.
92
- */
93
- pm_options_version_t version;
94
-
95
- /** A bitset of the various options that were set on the command line. */
96
- uint8_t command_line;
97
-
98
- /**
99
- * Whether or not the frozen string literal option has been set.
100
- * May be:
101
- * - PM_OPTIONS_FROZEN_STRING_LITERAL_DISABLED
102
- * - PM_OPTIONS_FROZEN_STRING_LITERAL_ENABLED
103
- * - PM_OPTIONS_FROZEN_STRING_LITERAL_UNSET
104
- */
105
- int8_t frozen_string_literal;
106
- } pm_options_t;
107
-
108
- /**
109
- * A bit representing whether or not the command line -a option was set. -a
110
- * splits the input line $_ into $F.
111
- */
112
- static const uint8_t PM_OPTIONS_COMMAND_LINE_A = 0x1;
113
-
114
- /**
115
- * A bit representing whether or not the command line -e option was set. -e
116
- * allow the user to specify a script to be executed. This is necessary for
117
- * prism to know because certain warnings are not generated when -e is used.
118
- */
119
- static const uint8_t PM_OPTIONS_COMMAND_LINE_E = 0x2;
120
-
121
- /**
122
- * A bit representing whether or not the command line -l option was set. -l
123
- * chomps the input line by default.
124
- */
125
- static const uint8_t PM_OPTIONS_COMMAND_LINE_L = 0x4;
126
-
127
- /**
128
- * A bit representing whether or not the command line -n option was set. -n
129
- * wraps the script in a while gets loop.
130
- */
131
- static const uint8_t PM_OPTIONS_COMMAND_LINE_N = 0x8;
132
-
133
- /**
134
- * A bit representing whether or not the command line -p option was set. -p
135
- * prints the value of $_ at the end of each loop.
136
- */
137
- static const uint8_t PM_OPTIONS_COMMAND_LINE_P = 0x10;
138
-
139
- /**
140
- * A bit representing whether or not the command line -x option was set. -x
141
- * searches the input file for a shebang that matches the current Ruby engine.
142
- */
143
- static const uint8_t PM_OPTIONS_COMMAND_LINE_X = 0x20;
144
-
145
- /**
146
- * Set the filepath option on the given options struct.
147
- *
148
- * @param options The options struct to set the filepath on.
149
- * @param filepath The filepath to set.
150
- */
151
- PRISM_EXPORTED_FUNCTION void pm_options_filepath_set(pm_options_t *options, const char *filepath);
152
-
153
- /**
154
- * Set the line option on the given options struct.
155
- *
156
- * @param options The options struct to set the line on.
157
- * @param line The line to set.
158
- */
159
- PRISM_EXPORTED_FUNCTION void pm_options_line_set(pm_options_t *options, int32_t line);
160
-
161
- /**
162
- * Set the encoding option on the given options struct.
163
- *
164
- * @param options The options struct to set the encoding on.
165
- * @param encoding The encoding to set.
166
- */
167
- PRISM_EXPORTED_FUNCTION void pm_options_encoding_set(pm_options_t *options, const char *encoding);
168
-
169
- /**
170
- * Set the frozen string literal option on the given options struct.
171
- *
172
- * @param options The options struct to set the frozen string literal value on.
173
- * @param frozen_string_literal The frozen string literal value to set.
174
- */
175
- PRISM_EXPORTED_FUNCTION void pm_options_frozen_string_literal_set(pm_options_t *options, bool frozen_string_literal);
176
-
177
- /**
178
- * Sets the command line option on the given options struct.
179
- *
180
- * @param options The options struct to set the command line option on.
181
- * @param command_line The command_line value to set.
182
- */
183
- PRISM_EXPORTED_FUNCTION void pm_options_command_line_set(pm_options_t *options, uint8_t command_line);
184
-
185
- /**
186
- * Set the version option on the given options struct by parsing the given
187
- * string. If the string contains an invalid option, this returns false.
188
- * Otherwise, it returns true.
189
- *
190
- * @param options The options struct to set the version on.
191
- * @param version The version to set.
192
- * @param length The length of the version string.
193
- * @return Whether or not the version was parsed successfully.
194
- */
195
- PRISM_EXPORTED_FUNCTION bool pm_options_version_set(pm_options_t *options, const char *version, size_t length);
196
-
197
- /**
198
- * Allocate and zero out the scopes array on the given options struct.
199
- *
200
- * @param options The options struct to initialize the scopes array on.
201
- * @param scopes_count The number of scopes to allocate.
202
- * @return Whether or not the scopes array was initialized successfully.
203
- */
204
- PRISM_EXPORTED_FUNCTION bool pm_options_scopes_init(pm_options_t *options, size_t scopes_count);
205
-
206
- /**
207
- * Return a pointer to the scope at the given index within the given options.
208
- *
209
- * @param options The options struct to get the scope from.
210
- * @param index The index of the scope to get.
211
- * @return A pointer to the scope at the given index.
212
- */
213
- PRISM_EXPORTED_FUNCTION const pm_options_scope_t * pm_options_scope_get(const pm_options_t *options, size_t index);
214
-
215
- /**
216
- * Create a new options scope struct. This will hold a set of locals that are in
217
- * scope surrounding the code that is being parsed.
218
- *
219
- * @param scope The scope struct to initialize.
220
- * @param locals_count The number of locals to allocate.
221
- * @return Whether or not the scope was initialized successfully.
222
- */
223
- PRISM_EXPORTED_FUNCTION bool pm_options_scope_init(pm_options_scope_t *scope, size_t locals_count);
224
-
225
- /**
226
- * Return a pointer to the local at the given index within the given scope.
227
- *
228
- * @param scope The scope struct to get the local from.
229
- * @param index The index of the local to get.
230
- * @return A pointer to the local at the given index.
231
- */
232
- PRISM_EXPORTED_FUNCTION const pm_string_t * pm_options_scope_local_get(const pm_options_scope_t *scope, size_t index);
233
-
234
- /**
235
- * Free the internal memory associated with the options.
236
- *
237
- * @param options The options struct whose internal memory should be freed.
238
- */
239
- PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options);
240
-
241
- /**
242
- * Deserialize an options struct from the given binary string. This is used to
243
- * pass options to the parser from an FFI call so that consumers of the library
244
- * from an FFI perspective don't have to worry about the structure of our
245
- * options structs. Since the source of these calls will be from Ruby
246
- * implementation internals we assume it is from a trusted source.
247
- *
248
- * `data` is assumed to be a valid pointer pointing to well-formed data. The
249
- * layout of this data should be the same every time, and is described below:
250
- *
251
- * | # bytes | field |
252
- * | ------- | -------------------------- |
253
- * | `4` | the length of the filepath |
254
- * | ... | the filepath bytes |
255
- * | `4` | the line number |
256
- * | `4` | the length the encoding |
257
- * | ... | the encoding bytes |
258
- * | `1` | frozen string literal |
259
- * | `1` | -p command line option |
260
- * | `1` | -n command line option |
261
- * | `1` | -l command line option |
262
- * | `1` | -a command line option |
263
- * | `1` | the version |
264
- * | `4` | the number of scopes |
265
- * | ... | the scopes |
266
- *
267
- * The version field is an enum, so it should be one of the following values:
268
- *
269
- * | value | version |
270
- * | ----- | ------------------------- |
271
- * | `0` | use the latest version of prism |
272
- * | `1` | use the version of prism that is vendored in CRuby 3.3.0 |
273
- *
274
- * Each scope is laid out as follows:
275
- *
276
- * | # bytes | field |
277
- * | ------- | -------------------------- |
278
- * | `4` | the number of locals |
279
- * | ... | the locals |
280
- *
281
- * Each local is laid out as follows:
282
- *
283
- * | # bytes | field |
284
- * | ------- | -------------------------- |
285
- * | `4` | the length of the local |
286
- * | ... | the local bytes |
287
- *
288
- * Some additional things to note about this layout:
289
- *
290
- * * The filepath can have a length of 0, in which case we'll consider it an
291
- * empty string.
292
- * * The line number should be 0-indexed.
293
- * * The encoding can have a length of 0, in which case we'll use the default
294
- * encoding (UTF-8). If it's not 0, it should correspond to a name of an
295
- * encoding that can be passed to `Encoding.find` in Ruby.
296
- * * The frozen string literal and suppress warnings fields are booleans, so
297
- * their values should be either 0 or 1.
298
- * * The number of scopes can be 0.
299
- *
300
- * @param options The options struct to deserialize into.
301
- * @param data The binary string to deserialize from.
302
- */
303
- void pm_options_read(pm_options_t *options, const char *data);
304
-
305
- #endif