debase-ruby_core_source 3.3.1 → 3.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. checksums.yaml +4 -4
  2. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/addr2line.h +22 -0
  3. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/builtin.h +117 -0
  4. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/build_assert/build_assert.h +40 -0
  5. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/check_type/check_type.h +63 -0
  6. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/container_of/container_of.h +142 -0
  7. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/list/list.h +791 -0
  8. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/str/str.h +17 -0
  9. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/constant.h +53 -0
  10. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/darray.h +246 -0
  11. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/debug_counter.h +423 -0
  12. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/dln.h +32 -0
  13. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/encindex.h +70 -0
  14. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/eval_intern.h +343 -0
  15. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/hrtime.h +227 -0
  16. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/id.h +343 -0
  17. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/id_table.h +39 -0
  18. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/insns.inc +251 -0
  19. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/insns_info.inc +9215 -0
  20. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/array.h +151 -0
  21. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/basic_operators.h +63 -0
  22. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/bignum.h +244 -0
  23. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/bits.h +568 -0
  24. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/class.h +277 -0
  25. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/cmdlineopt.h +65 -0
  26. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/compar.h +29 -0
  27. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/compile.h +34 -0
  28. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/compilers.h +107 -0
  29. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/complex.h +29 -0
  30. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/cont.h +35 -0
  31. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/dir.h +16 -0
  32. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/enc.h +19 -0
  33. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/encoding.h +35 -0
  34. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/enum.h +18 -0
  35. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/enumerator.h +21 -0
  36. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/error.h +216 -0
  37. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/eval.h +33 -0
  38. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/file.h +38 -0
  39. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/fixnum.h +184 -0
  40. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/gc.h +364 -0
  41. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/hash.h +191 -0
  42. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/imemo.h +240 -0
  43. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/inits.h +50 -0
  44. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/io.h +137 -0
  45. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/load.h +18 -0
  46. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/loadpath.h +16 -0
  47. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/math.h +23 -0
  48. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/missing.h +18 -0
  49. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/numeric.h +273 -0
  50. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/object.h +62 -0
  51. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/parse.h +108 -0
  52. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/proc.h +30 -0
  53. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/process.h +124 -0
  54. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/ractor.h +6 -0
  55. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/random.h +17 -0
  56. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/range.h +40 -0
  57. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/rational.h +71 -0
  58. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/re.h +28 -0
  59. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/ruby_parser.h +69 -0
  60. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/sanitizers.h +186 -0
  61. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/serial.h +23 -0
  62. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/signal.h +25 -0
  63. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/static_assert.h +16 -0
  64. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/string.h +160 -0
  65. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/struct.h +127 -0
  66. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/symbol.h +45 -0
  67. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/thread.h +78 -0
  68. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/time.h +34 -0
  69. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/transcode.h +23 -0
  70. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/util.h +27 -0
  71. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/variable.h +72 -0
  72. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/vm.h +136 -0
  73. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/warnings.h +16 -0
  74. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal.h +112 -0
  75. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/iseq.h +338 -0
  76. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/known_errors.inc +791 -0
  77. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/method.h +254 -0
  78. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/node.h +128 -0
  79. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/node_name.inc +212 -0
  80. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/optinsn.inc +128 -0
  81. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/optunifs.inc +43 -0
  82. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parse.h +243 -0
  83. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_bits.h +564 -0
  84. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_node.h +32 -0
  85. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_st.h +162 -0
  86. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_value.h +106 -0
  87. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/ast.h +4612 -0
  88. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/defines.h +94 -0
  89. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/diagnostic.h +297 -0
  90. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/encoding.h +248 -0
  91. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/extension.h +18 -0
  92. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/node.h +57 -0
  93. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/options.h +204 -0
  94. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/pack.h +152 -0
  95. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/parser.h +716 -0
  96. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/prettyprint.h +26 -0
  97. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/prism.h +272 -0
  98. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/regexp.h +33 -0
  99. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_buffer.h +146 -0
  100. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_char.h +205 -0
  101. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_constant_pool.h +191 -0
  102. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_list.h +97 -0
  103. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_memchr.h +29 -0
  104. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_newline_list.h +104 -0
  105. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_state_stack.h +42 -0
  106. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_string.h +150 -0
  107. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_string_list.h +44 -0
  108. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_strncasecmp.h +32 -0
  109. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_strpbrk.h +43 -0
  110. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/version.h +29 -0
  111. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism_compile.h +29 -0
  112. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/probes_helper.h +42 -0
  113. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ractor_core.h +393 -0
  114. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/regenc.h +254 -0
  115. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/regint.h +1006 -0
  116. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/regparse.h +371 -0
  117. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/revision.h +5 -0
  118. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/rjit.h +101 -0
  119. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/rjit_c.h +164 -0
  120. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ruby_assert.h +14 -0
  121. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ruby_atomic.h +23 -0
  122. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/rubyparser.h +1405 -0
  123. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/shape.h +233 -0
  124. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/siphash.h +48 -0
  125. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/symbol.h +118 -0
  126. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/thread_none.h +21 -0
  127. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/thread_pthread.h +166 -0
  128. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/thread_win32.h +58 -0
  129. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/timev.h +58 -0
  130. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/transcode_data.h +138 -0
  131. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/variable.h +39 -0
  132. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/version.h +69 -0
  133. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm.inc +5436 -0
  134. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_call_iseq_optimized.inc +244 -0
  135. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_callinfo.h +614 -0
  136. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_core.h +2202 -0
  137. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_debug.h +122 -0
  138. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_exec.h +199 -0
  139. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_insnhelper.h +261 -0
  140. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_opts.h +67 -0
  141. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_sync.h +137 -0
  142. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vmtc.inc +245 -0
  143. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/yjit.h +72 -0
  144. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/addr2line.h +22 -0
  145. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/builtin.h +119 -0
  146. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/build_assert/build_assert.h +40 -0
  147. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/check_type/check_type.h +63 -0
  148. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/container_of/container_of.h +142 -0
  149. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/list/list.h +791 -0
  150. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/str/str.h +17 -0
  151. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/constant.h +53 -0
  152. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/darray.h +191 -0
  153. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/debug_counter.h +423 -0
  154. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/dln.h +34 -0
  155. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/encindex.h +70 -0
  156. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/eval_intern.h +324 -0
  157. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/hrtime.h +237 -0
  158. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id.h +343 -0
  159. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id_table.h +39 -0
  160. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns.inc +259 -0
  161. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns_info.inc +9530 -0
  162. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/array.h +151 -0
  163. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/basic_operators.h +63 -0
  164. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bignum.h +244 -0
  165. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bits.h +568 -0
  166. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h +283 -0
  167. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cmdlineopt.h +65 -0
  168. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compar.h +29 -0
  169. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compile.h +34 -0
  170. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compilers.h +107 -0
  171. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/complex.h +29 -0
  172. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cont.h +35 -0
  173. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/dir.h +16 -0
  174. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enc.h +19 -0
  175. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/encoding.h +36 -0
  176. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enum.h +18 -0
  177. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enumerator.h +21 -0
  178. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/error.h +216 -0
  179. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/eval.h +33 -0
  180. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/file.h +38 -0
  181. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/fixnum.h +184 -0
  182. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/gc.h +334 -0
  183. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/hash.h +191 -0
  184. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/imemo.h +260 -0
  185. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/inits.h +47 -0
  186. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/io.h +140 -0
  187. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/load.h +18 -0
  188. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/loadpath.h +16 -0
  189. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/math.h +23 -0
  190. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/missing.h +19 -0
  191. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/numeric.h +274 -0
  192. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/object.h +63 -0
  193. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/parse.h +117 -0
  194. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/proc.h +30 -0
  195. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/process.h +124 -0
  196. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ractor.h +6 -0
  197. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/random.h +17 -0
  198. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/range.h +40 -0
  199. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/rational.h +71 -0
  200. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/re.h +28 -0
  201. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ruby_parser.h +102 -0
  202. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/sanitizers.h +297 -0
  203. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/serial.h +23 -0
  204. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/signal.h +24 -0
  205. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/st.h +11 -0
  206. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/static_assert.h +16 -0
  207. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/string.h +182 -0
  208. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/struct.h +127 -0
  209. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/symbol.h +45 -0
  210. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/thread.h +79 -0
  211. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/time.h +34 -0
  212. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/transcode.h +23 -0
  213. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/util.h +27 -0
  214. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/variable.h +72 -0
  215. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/vm.h +137 -0
  216. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/warnings.h +16 -0
  217. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal.h +108 -0
  218. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/iseq.h +340 -0
  219. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/known_errors.inc +1419 -0
  220. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/method.h +255 -0
  221. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node.h +111 -0
  222. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node_name.inc +224 -0
  223. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optinsn.inc +128 -0
  224. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optunifs.inc +43 -0
  225. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parse.h +243 -0
  226. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_bits.h +564 -0
  227. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_node.h +32 -0
  228. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_st.h +162 -0
  229. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_value.h +106 -0
  230. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/ast.h +6245 -0
  231. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/defines.h +206 -0
  232. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/diagnostic.h +433 -0
  233. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/encoding.h +283 -0
  234. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/extension.h +19 -0
  235. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/node.h +150 -0
  236. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/options.h +305 -0
  237. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/pack.h +163 -0
  238. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/parser.h +891 -0
  239. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prettyprint.h +34 -0
  240. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prism.h +347 -0
  241. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h +33 -0
  242. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/static_literals.h +120 -0
  243. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_buffer.h +218 -0
  244. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_char.h +205 -0
  245. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_constant_pool.h +226 -0
  246. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_integer.h +119 -0
  247. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_list.h +97 -0
  248. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_memchr.h +29 -0
  249. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_newline_list.h +102 -0
  250. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string.h +174 -0
  251. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h +44 -0
  252. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strncasecmp.h +32 -0
  253. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strpbrk.h +46 -0
  254. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/version.h +29 -0
  255. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism_compile.h +88 -0
  256. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/probes_helper.h +42 -0
  257. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ractor_core.h +393 -0
  258. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regenc.h +254 -0
  259. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regint.h +1010 -0
  260. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regparse.h +371 -0
  261. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h +5 -0
  262. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit.h +101 -0
  263. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit_c.h +165 -0
  264. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_assert.h +14 -0
  265. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_atomic.h +23 -0
  266. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rubyparser.h +1430 -0
  267. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/shape.h +233 -0
  268. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/siphash.h +48 -0
  269. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/symbol.h +118 -0
  270. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_none.h +21 -0
  271. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_pthread.h +166 -0
  272. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_win32.h +58 -0
  273. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/timev.h +58 -0
  274. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/transcode_data.h +138 -0
  275. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/variable.h +39 -0
  276. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/version.h +69 -0
  277. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm.inc +5643 -0
  278. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_call_iseq_optimized.inc +244 -0
  279. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_callinfo.h +605 -0
  280. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_core.h +2236 -0
  281. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_debug.h +124 -0
  282. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_exec.h +199 -0
  283. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_insnhelper.h +272 -0
  284. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_opts.h +67 -0
  285. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_sync.h +137 -0
  286. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vmtc.inc +253 -0
  287. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/yjit.h +79 -0
  288. data/lib/debase/ruby_core_source/version.rb +1 -1
  289. metadata +289 -3
@@ -0,0 +1,119 @@
1
+ /**
2
+ * @file pm_integer.h
3
+ *
4
+ * This module provides functions for working with arbitrary-sized integers.
5
+ */
6
+ #ifndef PRISM_NUMBER_H
7
+ #define PRISM_NUMBER_H
8
+
9
+ #include "prism/defines.h"
10
+ #include "prism/util/pm_buffer.h"
11
+
12
+ #include <assert.h>
13
+ #include <stdbool.h>
14
+ #include <stdint.h>
15
+ #include <stdlib.h>
16
+
17
+ /**
18
+ * A structure represents an arbitrary-sized integer.
19
+ */
20
+ typedef struct {
21
+ /**
22
+ * Embedded value for small integer. This value is set to 0 if the value
23
+ * does not fit into uint32_t.
24
+ */
25
+ uint32_t value;
26
+
27
+ /**
28
+ * The number of allocated values. length is set to 0 if the integer fits
29
+ * into uint32_t.
30
+ */
31
+ size_t length;
32
+
33
+ /**
34
+ * List of 32-bit integers. Set to NULL if the integer fits into uint32_t.
35
+ */
36
+ uint32_t *values;
37
+
38
+ /**
39
+ * Whether or not the integer is negative. It is stored this way so that a
40
+ * zeroed pm_integer_t is always positive zero.
41
+ */
42
+ bool negative;
43
+ } pm_integer_t;
44
+
45
+ /**
46
+ * An enum controlling the base of an integer. It is expected that the base is
47
+ * already known before parsing the integer, even though it could be derived
48
+ * from the string itself.
49
+ */
50
+ typedef enum {
51
+ /** The binary base, indicated by a 0b or 0B prefix. */
52
+ PM_INTEGER_BASE_BINARY,
53
+
54
+ /** The octal base, indicated by a 0, 0o, or 0O prefix. */
55
+ PM_INTEGER_BASE_OCTAL,
56
+
57
+ /** The decimal base, indicated by a 0d, 0D, or empty prefix. */
58
+ PM_INTEGER_BASE_DECIMAL,
59
+
60
+ /** The hexadecimal base, indicated by a 0x or 0X prefix. */
61
+ PM_INTEGER_BASE_HEXADECIMAL,
62
+
63
+ /**
64
+ * An unknown base, in which case pm_integer_parse will derive it based on
65
+ * the content of the string. This is less efficient and does more
66
+ * comparisons, so if callers know the base ahead of time, they should use
67
+ * that instead.
68
+ */
69
+ PM_INTEGER_BASE_UNKNOWN
70
+ } pm_integer_base_t;
71
+
72
+ /**
73
+ * Parse an integer from a string. This assumes that the format of the integer
74
+ * has already been validated, as internal validation checks are not performed
75
+ * here.
76
+ *
77
+ * @param integer The integer to parse into.
78
+ * @param base The base of the integer.
79
+ * @param start The start of the string.
80
+ * @param end The end of the string.
81
+ */
82
+ PRISM_EXPORTED_FUNCTION void pm_integer_parse(pm_integer_t *integer, pm_integer_base_t base, const uint8_t *start, const uint8_t *end);
83
+
84
+ /**
85
+ * Return the memory size of the integer.
86
+ *
87
+ * @param integer The integer to get the memory size of.
88
+ * @return The size of the memory associated with the integer.
89
+ */
90
+ size_t pm_integer_memsize(const pm_integer_t *integer);
91
+
92
+ /**
93
+ * Compare two integers. This function returns -1 if the left integer is less
94
+ * than the right integer, 0 if they are equal, and 1 if the left integer is
95
+ * greater than the right integer.
96
+ *
97
+ * @param left The left integer to compare.
98
+ * @param right The right integer to compare.
99
+ * @return The result of the comparison.
100
+ */
101
+ int pm_integer_compare(const pm_integer_t *left, const pm_integer_t *right);
102
+
103
+ /**
104
+ * Convert an integer to a decimal string.
105
+ *
106
+ * @param buffer The buffer to append the string to.
107
+ * @param integer The integer to convert to a string.
108
+ */
109
+ PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_integer_t *integer);
110
+
111
+ /**
112
+ * Free the internal memory of an integer. This memory will only be allocated if
113
+ * the integer exceeds the size of a single node in the linked list.
114
+ *
115
+ * @param integer The integer to free.
116
+ */
117
+ PRISM_EXPORTED_FUNCTION void pm_integer_free(pm_integer_t *integer);
118
+
119
+ #endif
@@ -0,0 +1,97 @@
1
+ /**
2
+ * @file pm_list.h
3
+ *
4
+ * An abstract linked list.
5
+ */
6
+ #ifndef PRISM_LIST_H
7
+ #define PRISM_LIST_H
8
+
9
+ #include "prism/defines.h"
10
+
11
+ #include <stdbool.h>
12
+ #include <stddef.h>
13
+ #include <stdint.h>
14
+ #include <stdlib.h>
15
+
16
+ /**
17
+ * This struct represents an abstract linked list that provides common
18
+ * functionality. It is meant to be used any time a linked list is necessary to
19
+ * store data.
20
+ *
21
+ * The linked list itself operates off a set of pointers. Because the pointers
22
+ * are not necessarily sequential, they can be of any size. We use this fact to
23
+ * allow the consumer of this linked list to extend the node struct to include
24
+ * any data they want. This is done by using the pm_list_node_t as the first
25
+ * member of the struct.
26
+ *
27
+ * For example, if we want to store a list of integers, we can do the following:
28
+ *
29
+ * ```c
30
+ * typedef struct {
31
+ * pm_list_node_t node;
32
+ * int value;
33
+ * } pm_int_node_t;
34
+ *
35
+ * pm_list_t list = { 0 };
36
+ * pm_int_node_t *node = xmalloc(sizeof(pm_int_node_t));
37
+ * node->value = 5;
38
+ *
39
+ * pm_list_append(&list, &node->node);
40
+ * ```
41
+ *
42
+ * The pm_list_t struct is used to represent the overall linked list. It
43
+ * contains a pointer to the head and tail of the list. This allows for easy
44
+ * iteration and appending of new nodes.
45
+ */
46
+ typedef struct pm_list_node {
47
+ /** A pointer to the next node in the list. */
48
+ struct pm_list_node *next;
49
+ } pm_list_node_t;
50
+
51
+ /**
52
+ * This represents the overall linked list. It keeps a pointer to the head and
53
+ * tail so that iteration is easy and pushing new nodes is easy.
54
+ */
55
+ typedef struct {
56
+ /** The size of the list. */
57
+ size_t size;
58
+
59
+ /** A pointer to the head of the list. */
60
+ pm_list_node_t *head;
61
+
62
+ /** A pointer to the tail of the list. */
63
+ pm_list_node_t *tail;
64
+ } pm_list_t;
65
+
66
+ /**
67
+ * Returns true if the given list is empty.
68
+ *
69
+ * @param list The list to check.
70
+ * @return True if the given list is empty, otherwise false.
71
+ */
72
+ PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list);
73
+
74
+ /**
75
+ * Returns the size of the list.
76
+ *
77
+ * @param list The list to check.
78
+ * @return The size of the list.
79
+ */
80
+ PRISM_EXPORTED_FUNCTION size_t pm_list_size(pm_list_t *list);
81
+
82
+ /**
83
+ * Append a node to the given list.
84
+ *
85
+ * @param list The list to append to.
86
+ * @param node The node to append.
87
+ */
88
+ void pm_list_append(pm_list_t *list, pm_list_node_t *node);
89
+
90
+ /**
91
+ * Deallocate the internal state of the given list.
92
+ *
93
+ * @param list The list to free.
94
+ */
95
+ PRISM_EXPORTED_FUNCTION void pm_list_free(pm_list_t *list);
96
+
97
+ #endif
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @file pm_memchr.h
3
+ *
4
+ * A custom memchr implementation.
5
+ */
6
+ #ifndef PRISM_MEMCHR_H
7
+ #define PRISM_MEMCHR_H
8
+
9
+ #include "prism/defines.h"
10
+ #include "prism/encoding.h"
11
+
12
+ #include <stddef.h>
13
+
14
+ /**
15
+ * We need to roll our own memchr to handle cases where the encoding changes and
16
+ * we need to search for a character in a buffer that could be the trailing byte
17
+ * of a multibyte character.
18
+ *
19
+ * @param source The source string.
20
+ * @param character The character to search for.
21
+ * @param number The maximum number of bytes to search.
22
+ * @param encoding_changed Whether the encoding changed.
23
+ * @param encoding A pointer to the encoding.
24
+ * @return A pointer to the first occurrence of the character in the source
25
+ * string, or NULL if no such character exists.
26
+ */
27
+ void * pm_memchr(const void *source, int character, size_t number, bool encoding_changed, const pm_encoding_t *encoding);
28
+
29
+ #endif
@@ -0,0 +1,102 @@
1
+ /**
2
+ * @file pm_newline_list.h
3
+ *
4
+ * A list of byte offsets of newlines in a string.
5
+ *
6
+ * When compiling the syntax tree, it's necessary to know the line and column
7
+ * of many nodes. This is necessary to support things like error messages,
8
+ * tracepoints, etc.
9
+ *
10
+ * It's possible that we could store the start line, start column, end line, and
11
+ * end column on every node in addition to the offsets that we already store,
12
+ * but that would be quite a lot of memory overhead.
13
+ */
14
+ #ifndef PRISM_NEWLINE_LIST_H
15
+ #define PRISM_NEWLINE_LIST_H
16
+
17
+ #include "prism/defines.h"
18
+
19
+ #include <assert.h>
20
+ #include <stdbool.h>
21
+ #include <stddef.h>
22
+ #include <stdlib.h>
23
+
24
+ /**
25
+ * A list of offsets of newlines in a string. The offsets are assumed to be
26
+ * sorted/inserted in ascending order.
27
+ */
28
+ typedef struct {
29
+ /** A pointer to the start of the source string. */
30
+ const uint8_t *start;
31
+
32
+ /** The number of offsets in the list. */
33
+ size_t size;
34
+
35
+ /** The capacity of the list that has been allocated. */
36
+ size_t capacity;
37
+
38
+ /** The list of offsets. */
39
+ size_t *offsets;
40
+ } pm_newline_list_t;
41
+
42
+ /**
43
+ * A line and column in a string.
44
+ */
45
+ typedef struct {
46
+ /** The line number. */
47
+ int32_t line;
48
+
49
+ /** The column number. */
50
+ uint32_t column;
51
+ } pm_line_column_t;
52
+
53
+ /**
54
+ * Initialize a new newline list with the given capacity. Returns true if the
55
+ * allocation of the offsets succeeds, otherwise returns false.
56
+ *
57
+ * @param list The list to initialize.
58
+ * @param start A pointer to the start of the source string.
59
+ * @param capacity The initial capacity of the list.
60
+ * @return True if the allocation of the offsets succeeds, otherwise false.
61
+ */
62
+ bool pm_newline_list_init(pm_newline_list_t *list, const uint8_t *start, size_t capacity);
63
+
64
+ /**
65
+ * Clear out the newlines that have been appended to the list.
66
+ *
67
+ * @param list The list to clear.
68
+ */
69
+ void
70
+ pm_newline_list_clear(pm_newline_list_t *list);
71
+
72
+ /**
73
+ * Append a new offset to the newline list. Returns true if the reallocation of
74
+ * the offsets succeeds (if one was necessary), otherwise returns false.
75
+ *
76
+ * @param list The list to append to.
77
+ * @param cursor A pointer to the offset to append.
78
+ * @return True if the reallocation of the offsets succeeds (if one was
79
+ * necessary), otherwise false.
80
+ */
81
+ bool pm_newline_list_append(pm_newline_list_t *list, const uint8_t *cursor);
82
+
83
+ /**
84
+ * Returns the line and column of the given offset. If the offset is not in the
85
+ * list, the line and column of the closest offset less than the given offset
86
+ * are returned.
87
+ *
88
+ * @param list The list to search.
89
+ * @param cursor A pointer to the offset to search for.
90
+ * @param start_line The line to start counting from.
91
+ * @return The line and column of the given offset.
92
+ */
93
+ pm_line_column_t pm_newline_list_line_column(const pm_newline_list_t *list, const uint8_t *cursor, int32_t start_line);
94
+
95
+ /**
96
+ * Free the internal memory allocated for the newline list.
97
+ *
98
+ * @param list The list to free.
99
+ */
100
+ void pm_newline_list_free(pm_newline_list_t *list);
101
+
102
+ #endif
@@ -0,0 +1,174 @@
1
+ /**
2
+ * @file pm_string.h
3
+ *
4
+ * A generic string type that can have various ownership semantics.
5
+ */
6
+ #ifndef PRISM_STRING_H
7
+ #define PRISM_STRING_H
8
+
9
+ #include "prism/defines.h"
10
+
11
+ #include <assert.h>
12
+ #include <stdbool.h>
13
+ #include <stddef.h>
14
+ #include <stdlib.h>
15
+ #include <string.h>
16
+
17
+ // The following headers are necessary to read files using demand paging.
18
+ #ifdef _WIN32
19
+ #include <windows.h>
20
+ #elif defined(_POSIX_MAPPED_FILES)
21
+ #include <fcntl.h>
22
+ #include <sys/mman.h>
23
+ #include <sys/stat.h>
24
+ #endif
25
+
26
+ /**
27
+ * A generic string type that can have various ownership semantics.
28
+ */
29
+ typedef struct {
30
+ /** A pointer to the start of the string. */
31
+ const uint8_t *source;
32
+
33
+ /** The length of the string in bytes of memory. */
34
+ size_t length;
35
+
36
+ /** The type of the string. This field determines how the string should be freed. */
37
+ enum {
38
+ /** This string is a constant string, and should not be freed. */
39
+ PM_STRING_CONSTANT,
40
+
41
+ /** This is a slice of another string, and should not be freed. */
42
+ PM_STRING_SHARED,
43
+
44
+ /** This string owns its memory, and should be freed using `pm_string_free`. */
45
+ PM_STRING_OWNED,
46
+
47
+ #ifdef PRISM_HAS_MMAP
48
+ /** This string is a memory-mapped file, and should be freed using `pm_string_free`. */
49
+ PM_STRING_MAPPED
50
+ #endif
51
+ } type;
52
+ } pm_string_t;
53
+
54
+ /**
55
+ * Returns the size of the pm_string_t struct. This is necessary to allocate the
56
+ * correct amount of memory in the FFI backend.
57
+ *
58
+ * @return The size of the pm_string_t struct.
59
+ */
60
+ PRISM_EXPORTED_FUNCTION size_t pm_string_sizeof(void);
61
+
62
+ /**
63
+ * Defines an empty string. This is useful for initializing a string that will
64
+ * be filled in later.
65
+ */
66
+ #define PM_STRING_EMPTY ((pm_string_t) { .type = PM_STRING_CONSTANT, .source = NULL, .length = 0 })
67
+
68
+ /**
69
+ * Initialize a shared string that is based on initial input.
70
+ *
71
+ * @param string The string to initialize.
72
+ * @param start The start of the string.
73
+ * @param end The end of the string.
74
+ */
75
+ void pm_string_shared_init(pm_string_t *string, const uint8_t *start, const uint8_t *end);
76
+
77
+ /**
78
+ * Initialize an owned string that is responsible for freeing allocated memory.
79
+ *
80
+ * @param string The string to initialize.
81
+ * @param source The source of the string.
82
+ * @param length The length of the string.
83
+ */
84
+ void pm_string_owned_init(pm_string_t *string, uint8_t *source, size_t length);
85
+
86
+ /**
87
+ * Initialize a constant string that doesn't own its memory source.
88
+ *
89
+ * @param string The string to initialize.
90
+ * @param source The source of the string.
91
+ * @param length The length of the string.
92
+ */
93
+ void pm_string_constant_init(pm_string_t *string, const char *source, size_t length);
94
+
95
+ /**
96
+ * Read the file indicated by the filepath parameter into source and load its
97
+ * contents and size into the given `pm_string_t`. The given `pm_string_t`
98
+ * should be freed using `pm_string_free` when it is no longer used.
99
+ *
100
+ * We want to use demand paging as much as possible in order to avoid having to
101
+ * read the entire file into memory (which could be detrimental to performance
102
+ * for large files). This means that if we're on windows we'll use
103
+ * `MapViewOfFile`, on POSIX systems that have access to `mmap` we'll use
104
+ * `mmap`, and on other POSIX systems we'll use `read`.
105
+ *
106
+ * @param string The string to initialize.
107
+ * @param filepath The filepath to read.
108
+ * @return Whether or not the file was successfully mapped.
109
+ */
110
+ PRISM_EXPORTED_FUNCTION bool pm_string_mapped_init(pm_string_t *string, const char *filepath);
111
+
112
+ /**
113
+ * Read the file indicated by the filepath parameter into source and load its
114
+ * contents and size into the given `pm_string_t`. The given `pm_string_t`
115
+ * should be freed using `pm_string_free` when it is no longer used.
116
+ *
117
+ * @param string The string to initialize.
118
+ * @param filepath The filepath to read.
119
+ * @return Whether or not the file was successfully read.
120
+ */
121
+ PRISM_EXPORTED_FUNCTION bool pm_string_file_init(pm_string_t *string, const char *filepath);
122
+
123
+ /**
124
+ * Returns the memory size associated with the string.
125
+ *
126
+ * @param string The string to get the memory size of.
127
+ * @return The size of the memory associated with the string.
128
+ */
129
+ size_t pm_string_memsize(const pm_string_t *string);
130
+
131
+ /**
132
+ * Ensure the string is owned. If it is not, then reinitialize it as owned and
133
+ * copy over the previous source.
134
+ *
135
+ * @param string The string to ensure is owned.
136
+ */
137
+ void pm_string_ensure_owned(pm_string_t *string);
138
+
139
+ /**
140
+ * Compare the underlying lengths and bytes of two strings. Returns 0 if the
141
+ * strings are equal, a negative number if the left string is less than the
142
+ * right string, and a positive number if the left string is greater than the
143
+ * right string.
144
+ *
145
+ * @param left The left string to compare.
146
+ * @param right The right string to compare.
147
+ * @return The comparison result.
148
+ */
149
+ int pm_string_compare(const pm_string_t *left, const pm_string_t *right);
150
+
151
+ /**
152
+ * Returns the length associated with the string.
153
+ *
154
+ * @param string The string to get the length of.
155
+ * @return The length of the string.
156
+ */
157
+ PRISM_EXPORTED_FUNCTION size_t pm_string_length(const pm_string_t *string);
158
+
159
+ /**
160
+ * Returns the start pointer associated with the string.
161
+ *
162
+ * @param string The string to get the start pointer of.
163
+ * @return The start pointer of the string.
164
+ */
165
+ PRISM_EXPORTED_FUNCTION const uint8_t * pm_string_source(const pm_string_t *string);
166
+
167
+ /**
168
+ * Free the associated memory of the given string.
169
+ *
170
+ * @param string The string to free.
171
+ */
172
+ PRISM_EXPORTED_FUNCTION void pm_string_free(pm_string_t *string);
173
+
174
+ #endif
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @file pm_string_list.h
3
+ *
4
+ * A list of strings.
5
+ */
6
+ #ifndef PRISM_STRING_LIST_H
7
+ #define PRISM_STRING_LIST_H
8
+
9
+ #include "prism/defines.h"
10
+ #include "prism/util/pm_string.h"
11
+
12
+ #include <stddef.h>
13
+ #include <stdlib.h>
14
+
15
+ /**
16
+ * A list of strings.
17
+ */
18
+ typedef struct {
19
+ /** The length of the string list. */
20
+ size_t length;
21
+
22
+ /** The capacity of the string list that has been allocated. */
23
+ size_t capacity;
24
+
25
+ /** A pointer to the start of the string list. */
26
+ pm_string_t *strings;
27
+ } pm_string_list_t;
28
+
29
+ /**
30
+ * Append a pm_string_t to the given string list.
31
+ *
32
+ * @param string_list The string list to append to.
33
+ * @param string The string to append.
34
+ */
35
+ void pm_string_list_append(pm_string_list_t *string_list, pm_string_t *string);
36
+
37
+ /**
38
+ * Free the memory associated with the string list.
39
+ *
40
+ * @param string_list The string list to free.
41
+ */
42
+ PRISM_EXPORTED_FUNCTION void pm_string_list_free(pm_string_list_t *string_list);
43
+
44
+ #endif
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @file pm_strncasecmp.h
3
+ *
4
+ * A custom strncasecmp implementation.
5
+ */
6
+ #ifndef PRISM_STRNCASECMP_H
7
+ #define PRISM_STRNCASECMP_H
8
+
9
+ #include "prism/defines.h"
10
+
11
+ #include <ctype.h>
12
+ #include <stddef.h>
13
+ #include <stdint.h>
14
+
15
+ /**
16
+ * Compare two strings, ignoring case, up to the given length. Returns 0 if the
17
+ * strings are equal, a negative number if string1 is less than string2, or a
18
+ * positive number if string1 is greater than string2.
19
+ *
20
+ * Note that this is effectively our own implementation of strncasecmp, but it's
21
+ * not available on all of the platforms we want to support so we're rolling it
22
+ * here.
23
+ *
24
+ * @param string1 The first string to compare.
25
+ * @param string2 The second string to compare
26
+ * @param length The maximum number of characters to compare.
27
+ * @return 0 if the strings are equal, a negative number if string1 is less than
28
+ * string2, or a positive number if string1 is greater than string2.
29
+ */
30
+ int pm_strncasecmp(const uint8_t *string1, const uint8_t *string2, size_t length);
31
+
32
+ #endif
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @file pm_strpbrk.h
3
+ *
4
+ * A custom strpbrk implementation.
5
+ */
6
+ #ifndef PRISM_STRPBRK_H
7
+ #define PRISM_STRPBRK_H
8
+
9
+ #include "prism/defines.h"
10
+ #include "prism/diagnostic.h"
11
+ #include "prism/parser.h"
12
+
13
+ #include <stddef.h>
14
+ #include <string.h>
15
+
16
+ /**
17
+ * Here we have rolled our own version of strpbrk. The standard library strpbrk
18
+ * has undefined behavior when the source string is not null-terminated. We want
19
+ * to support strings that are not null-terminated because pm_parse does not
20
+ * have the contract that the string is null-terminated. (This is desirable
21
+ * because it means the extension can call pm_parse with the result of a call to
22
+ * mmap).
23
+ *
24
+ * The standard library strpbrk also does not support passing a maximum length
25
+ * to search. We want to support this for the reason mentioned above, but we
26
+ * also don't want it to stop on null bytes. Ruby actually allows null bytes
27
+ * within strings, comments, regular expressions, etc. So we need to be able to
28
+ * skip past them.
29
+ *
30
+ * Finally, we want to support encodings wherein the charset could contain
31
+ * characters that are trailing bytes of multi-byte characters. For example, in
32
+ * Shift-JIS, the backslash character can be a trailing byte. In that case we
33
+ * need to take a slower path and iterate one multi-byte character at a time.
34
+ *
35
+ * @param parser The parser.
36
+ * @param source The source to search.
37
+ * @param charset The charset to search for.
38
+ * @param length The maximum number of bytes to search.
39
+ * @param validate Whether to validate that the source string is valid in the
40
+ * current encoding of the parser.
41
+ * @return A pointer to the first character in the source string that is in the
42
+ * charset, or NULL if no such character exists.
43
+ */
44
+ const uint8_t * pm_strpbrk(pm_parser_t *parser, const uint8_t *source, const uint8_t *charset, ptrdiff_t length, bool validate);
45
+
46
+ #endif
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @file version.h
3
+ *
4
+ * The version of the Prism library.
5
+ */
6
+ #ifndef PRISM_VERSION_H
7
+ #define PRISM_VERSION_H
8
+
9
+ /**
10
+ * The major version of the Prism library as an int.
11
+ */
12
+ #define PRISM_VERSION_MAJOR 0
13
+
14
+ /**
15
+ * The minor version of the Prism library as an int.
16
+ */
17
+ #define PRISM_VERSION_MINOR 29
18
+
19
+ /**
20
+ * The patch version of the Prism library as an int.
21
+ */
22
+ #define PRISM_VERSION_PATCH 0
23
+
24
+ /**
25
+ * The version of the Prism library as a constant string.
26
+ */
27
+ #define PRISM_VERSION "0.29.0"
28
+
29
+ #endif