datadog-ruby_core_source 3.4.3 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/extension.h +1 -1
  3. data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/options.h +4 -1
  4. data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/version.h +2 -2
  5. data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/vm_core.h +9 -0
  6. data/lib/datadog/ruby_core_source/version.rb +1 -1
  7. metadata +108 -211
  8. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/id.h +0 -352
  9. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/id_table.h +0 -39
  10. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/array.h +0 -152
  11. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/basic_operators.h +0 -65
  12. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/bignum.h +0 -244
  13. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/bits.h +0 -650
  14. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/class.h +0 -283
  15. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/cmdlineopt.h +0 -61
  16. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/cont.h +0 -35
  17. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/encoding.h +0 -38
  18. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/error.h +0 -244
  19. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/eval.h +0 -33
  20. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/gc.h +0 -333
  21. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/hash.h +0 -193
  22. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/imemo.h +0 -257
  23. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/inits.h +0 -47
  24. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/io.h +0 -143
  25. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/load.h +0 -18
  26. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/numeric.h +0 -274
  27. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/object.h +0 -63
  28. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/re.h +0 -28
  29. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/sanitizers.h +0 -330
  30. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/signal.h +0 -24
  31. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/st.h +0 -11
  32. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/string.h +0 -199
  33. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/struct.h +0 -119
  34. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/symbol.h +0 -47
  35. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/thread.h +0 -108
  36. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/time.h +0 -37
  37. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/variable.h +0 -70
  38. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/vm.h +0 -137
  39. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal.h +0 -108
  40. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/iseq.h +0 -351
  41. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/method.h +0 -258
  42. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/ast.h +0 -7964
  43. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/diagnostic.h +0 -451
  44. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/options.h +0 -442
  45. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/parser.h +0 -933
  46. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/prism.h +0 -383
  47. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/regexp.h +0 -43
  48. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/util/pm_buffer.h +0 -228
  49. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/util/pm_integer.h +0 -126
  50. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/util/pm_list.h +0 -97
  51. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/util/pm_string.h +0 -190
  52. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/version.h +0 -29
  53. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism_compile.h +0 -105
  54. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/ractor_core.h +0 -382
  55. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/ruby_atomic.h +0 -23
  56. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/rubyparser.h +0 -1380
  57. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/shape.h +0 -234
  58. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/thread_pthread.h +0 -167
  59. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/vm_core.h +0 -2235
  60. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/vm_debug.h +0 -124
  61. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/build_assert/build_assert.h +0 -40
  62. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/check_type/check_type.h +0 -63
  63. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/container_of/container_of.h +0 -142
  64. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/list/list.h +0 -791
  65. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/str/str.h +0 -17
  66. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/compar.h +0 -29
  67. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/compile.h +0 -34
  68. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/compilers.h +0 -107
  69. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/complex.h +0 -29
  70. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/dir.h +0 -16
  71. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/enc.h +0 -19
  72. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/enum.h +0 -18
  73. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/enumerator.h +0 -21
  74. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/file.h +0 -38
  75. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/fixnum.h +0 -185
  76. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/loadpath.h +0 -16
  77. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/math.h +0 -23
  78. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/missing.h +0 -19
  79. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/parse.h +0 -131
  80. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/proc.h +0 -30
  81. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/process.h +0 -124
  82. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/ractor.h +0 -10
  83. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/random.h +0 -17
  84. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/range.h +0 -40
  85. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/rational.h +0 -71
  86. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/ruby_parser.h +0 -102
  87. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/serial.h +0 -23
  88. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/static_assert.h +0 -16
  89. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/transcode.h +0 -23
  90. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/util.h +0 -27
  91. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/warnings.h +0 -16
  92. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/node.h +0 -122
  93. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/parser_st.h +0 -162
  94. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/parser_value.h +0 -106
  95. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/defines.h +0 -260
  96. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/encoding.h +0 -283
  97. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/extension.h +0 -19
  98. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/node.h +0 -129
  99. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/pack.h +0 -163
  100. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/prettyprint.h +0 -34
  101. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/static_literals.h +0 -121
  102. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_char.h +0 -204
  103. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_constant_pool.h +0 -218
  104. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_memchr.h +0 -29
  105. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_newline_list.h +0 -113
  106. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_strncasecmp.h +0 -32
  107. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_strpbrk.h +0 -46
  108. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ruby_assert.h +0 -14
  109. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/thread_none.h +0 -21
  110. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/vm_opts.h +0 -67
  111. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
  112. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/check_type/check_type.h +0 -0
  113. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/container_of/container_of.h +0 -0
  114. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/list/list.h +0 -0
  115. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/str/str.h +0 -0
  116. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/id.h +0 -0
  117. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/id_table.h +0 -0
  118. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/array.h +0 -0
  119. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/basic_operators.h +0 -0
  120. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/bignum.h +0 -0
  121. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/bits.h +0 -0
  122. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/box.h +0 -0
  123. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/class.h +0 -0
  124. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/cmdlineopt.h +0 -0
  125. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compar.h +0 -0
  126. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compile.h +0 -0
  127. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compilers.h +0 -0
  128. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/complex.h +0 -0
  129. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/concurrent_set.h +0 -0
  130. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/cont.h +0 -0
  131. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/dir.h +0 -0
  132. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enc.h +0 -0
  133. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/encoding.h +0 -0
  134. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enum.h +0 -0
  135. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enumerator.h +0 -0
  136. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/error.h +0 -0
  137. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/eval.h +0 -0
  138. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/file.h +0 -0
  139. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/fixnum.h +0 -0
  140. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/gc.h +0 -0
  141. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/hash.h +0 -0
  142. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/imemo.h +0 -0
  143. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/inits.h +0 -0
  144. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/io.h +0 -0
  145. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/load.h +0 -0
  146. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/loadpath.h +0 -0
  147. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/math.h +0 -0
  148. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/missing.h +0 -0
  149. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/numeric.h +0 -0
  150. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/object.h +0 -0
  151. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/parse.h +0 -0
  152. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/proc.h +0 -0
  153. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/process.h +0 -0
  154. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ractor.h +0 -0
  155. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/random.h +0 -0
  156. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/range.h +0 -0
  157. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/rational.h +0 -0
  158. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/re.h +0 -0
  159. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ruby_parser.h +0 -0
  160. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/sanitizers.h +0 -0
  161. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/serial.h +0 -0
  162. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/set_table.h +0 -0
  163. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/signal.h +0 -0
  164. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/st.h +0 -0
  165. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/static_assert.h +0 -0
  166. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/string.h +0 -0
  167. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/struct.h +0 -0
  168. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/symbol.h +0 -0
  169. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/thread.h +0 -0
  170. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/time.h +0 -0
  171. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/transcode.h +0 -0
  172. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/util.h +0 -0
  173. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/variable.h +0 -0
  174. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/vm.h +0 -0
  175. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/warnings.h +0 -0
  176. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal.h +0 -0
  177. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/iseq.h +0 -0
  178. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/method.h +0 -0
  179. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/node.h +0 -0
  180. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_st.h +0 -0
  181. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_value.h +0 -0
  182. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/ast.h +0 -0
  183. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/defines.h +0 -0
  184. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/diagnostic.h +0 -0
  185. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/encoding.h +0 -0
  186. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/node.h +0 -0
  187. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/pack.h +0 -0
  188. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/parser.h +0 -0
  189. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/prettyprint.h +0 -0
  190. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/prism.h +0 -0
  191. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/regexp.h +0 -0
  192. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/static_literals.h +0 -0
  193. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/util/pm_buffer.h +0 -0
  194. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_char.h +0 -0
  195. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_constant_pool.h +0 -0
  196. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/util/pm_integer.h +0 -0
  197. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/util/pm_list.h +0 -0
  198. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_memchr.h +0 -0
  199. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_newline_list.h +0 -0
  200. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/util/pm_string.h +0 -0
  201. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strncasecmp.h +0 -0
  202. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strpbrk.h +0 -0
  203. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism_compile.h +0 -0
  204. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/ractor_core.h +0 -0
  205. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ruby_assert.h +0 -0
  206. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/ruby_atomic.h +0 -0
  207. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/rubyparser.h +0 -0
  208. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/shape.h +0 -0
  209. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/thread_none.h +0 -0
  210. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/thread_pthread.h +0 -0
  211. /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/vm_debug.h +0 -0
  212. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/vm_opts.h +0 -0
@@ -1,383 +0,0 @@
1
- /**
2
- * @file prism.h
3
- *
4
- * The main header file for the prism parser.
5
- */
6
- #ifndef PRISM_H
7
- #define PRISM_H
8
-
9
- #include "prism/defines.h"
10
- #include "prism/util/pm_buffer.h"
11
- #include "prism/util/pm_char.h"
12
- #include "prism/util/pm_integer.h"
13
- #include "prism/util/pm_memchr.h"
14
- #include "prism/util/pm_strncasecmp.h"
15
- #include "prism/util/pm_strpbrk.h"
16
- #include "prism/ast.h"
17
- #include "prism/diagnostic.h"
18
- #include "prism/node.h"
19
- #include "prism/options.h"
20
- #include "prism/pack.h"
21
- #include "prism/parser.h"
22
- #include "prism/prettyprint.h"
23
- #include "prism/regexp.h"
24
- #include "prism/static_literals.h"
25
- #include "prism/version.h"
26
-
27
- #include <assert.h>
28
- #include <errno.h>
29
- #include <locale.h>
30
- #include <math.h>
31
- #include <stdarg.h>
32
- #include <stdbool.h>
33
- #include <stdint.h>
34
- #include <stdio.h>
35
- #include <stdlib.h>
36
- #include <string.h>
37
-
38
- #ifndef _WIN32
39
- #include <strings.h>
40
- #endif
41
-
42
- /**
43
- * The prism version and the serialization format.
44
- *
45
- * @returns The prism version as a constant string.
46
- */
47
- PRISM_EXPORTED_FUNCTION const char * pm_version(void);
48
-
49
- /**
50
- * Initialize a parser with the given start and end pointers.
51
- *
52
- * @param parser The parser to initialize.
53
- * @param source The source to parse.
54
- * @param size The size of the source.
55
- * @param options The optional options to use when parsing.
56
- */
57
- PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm_options_t *options);
58
-
59
- /**
60
- * Register a callback that will be called whenever prism changes the encoding
61
- * it is using to parse based on the magic comment.
62
- *
63
- * @param parser The parser to register the callback with.
64
- * @param callback The callback to register.
65
- */
66
- PRISM_EXPORTED_FUNCTION void pm_parser_register_encoding_changed_callback(pm_parser_t *parser, pm_encoding_changed_callback_t callback);
67
-
68
- /**
69
- * Free any memory associated with the given parser.
70
- *
71
- * @param parser The parser to free.
72
- */
73
- PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser);
74
-
75
- /**
76
- * Initiate the parser with the given parser.
77
- *
78
- * @param parser The parser to use.
79
- * @return The AST representing the source.
80
- */
81
- PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse(pm_parser_t *parser);
82
-
83
- /**
84
- * This function is used in pm_parse_stream to retrieve a line of input from a
85
- * stream. It closely mirrors that of fgets so that fgets can be used as the
86
- * default implementation.
87
- */
88
- typedef char * (pm_parse_stream_fgets_t)(char *string, int size, void *stream);
89
-
90
- /**
91
- * Parse a stream of Ruby source and return the tree.
92
- *
93
- * @param parser The parser to use.
94
- * @param buffer The buffer to use.
95
- * @param stream The stream to parse.
96
- * @param stream_fgets The function to use to read from the stream.
97
- * @param options The optional options to use when parsing.
98
- * @return The AST representing the source.
99
- */
100
- PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, const pm_options_t *options);
101
-
102
- // We optionally support serializing to a binary string. For systems that don't
103
- // want or need this functionality, it can be turned off with the
104
- // PRISM_EXCLUDE_SERIALIZATION define.
105
- #ifndef PRISM_EXCLUDE_SERIALIZATION
106
-
107
- /**
108
- * Parse and serialize the AST represented by the source that is read out of the
109
- * given stream into to the given buffer.
110
- *
111
- * @param buffer The buffer to serialize to.
112
- * @param stream The stream to parse.
113
- * @param stream_fgets The function to use to read from the stream.
114
- * @param data The optional data to pass to the parser.
115
- */
116
- PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, const char *data);
117
-
118
- /**
119
- * Serialize the given list of comments to the given buffer.
120
- *
121
- * @param parser The parser to serialize.
122
- * @param list The list of comments to serialize.
123
- * @param buffer The buffer to serialize to.
124
- */
125
- void pm_serialize_comment_list(pm_parser_t *parser, pm_list_t *list, pm_buffer_t *buffer);
126
-
127
- /**
128
- * Serialize the name of the encoding to the buffer.
129
- *
130
- * @param encoding The encoding to serialize.
131
- * @param buffer The buffer to serialize to.
132
- */
133
- void pm_serialize_encoding(const pm_encoding_t *encoding, pm_buffer_t *buffer);
134
-
135
- /**
136
- * Serialize the encoding, metadata, nodes, and constant pool.
137
- *
138
- * @param parser The parser to serialize.
139
- * @param node The node to serialize.
140
- * @param buffer The buffer to serialize to.
141
- */
142
- void pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer);
143
-
144
- /**
145
- * Serialize the AST represented by the given node to the given buffer.
146
- *
147
- * @param parser The parser to serialize.
148
- * @param node The node to serialize.
149
- * @param buffer The buffer to serialize to.
150
- */
151
- PRISM_EXPORTED_FUNCTION void pm_serialize(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer);
152
-
153
- /**
154
- * Parse the given source to the AST and dump the AST to the given buffer.
155
- *
156
- * @param buffer The buffer to serialize to.
157
- * @param source The source to parse.
158
- * @param size The size of the source.
159
- * @param data The optional data to pass to the parser.
160
- */
161
- PRISM_EXPORTED_FUNCTION void pm_serialize_parse(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data);
162
-
163
- /**
164
- * Parse and serialize the comments in the given source to the given buffer.
165
- *
166
- * @param buffer The buffer to serialize to.
167
- * @param source The source to parse.
168
- * @param size The size of the source.
169
- * @param data The optional data to pass to the parser.
170
- */
171
- PRISM_EXPORTED_FUNCTION void pm_serialize_parse_comments(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data);
172
-
173
- /**
174
- * Lex the given source and serialize to the given buffer.
175
- *
176
- * @param source The source to lex.
177
- * @param size The size of the source.
178
- * @param buffer The buffer to serialize to.
179
- * @param data The optional data to pass to the lexer.
180
- */
181
- PRISM_EXPORTED_FUNCTION void pm_serialize_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data);
182
-
183
- /**
184
- * Parse and serialize both the AST and the tokens represented by the given
185
- * source to the given buffer.
186
- *
187
- * @param buffer The buffer to serialize to.
188
- * @param source The source to parse.
189
- * @param size The size of the source.
190
- * @param data The optional data to pass to the parser.
191
- */
192
- PRISM_EXPORTED_FUNCTION void pm_serialize_parse_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data);
193
-
194
- #endif
195
-
196
- /**
197
- * Parse the source and return true if it parses without errors or warnings.
198
- *
199
- * @param source The source to parse.
200
- * @param size The size of the source.
201
- * @param data The optional data to pass to the parser.
202
- * @return True if the source parses without errors or warnings.
203
- */
204
- PRISM_EXPORTED_FUNCTION bool pm_parse_success_p(const uint8_t *source, size_t size, const char *data);
205
-
206
- /**
207
- * Returns a string representation of the given token type.
208
- *
209
- * @param token_type The token type to convert to a string.
210
- * @return A string representation of the given token type.
211
- */
212
- PRISM_EXPORTED_FUNCTION const char * pm_token_type_name(pm_token_type_t token_type);
213
-
214
- /**
215
- * Returns the human name of the given token type.
216
- *
217
- * @param token_type The token type to convert to a human name.
218
- * @return The human name of the given token type.
219
- */
220
- const char * pm_token_type_human(pm_token_type_t token_type);
221
-
222
- // We optionally support dumping to JSON. For systems that don't want or need
223
- // this functionality, it can be turned off with the PRISM_EXCLUDE_JSON define.
224
- #ifndef PRISM_EXCLUDE_JSON
225
-
226
- /**
227
- * Dump JSON to the given buffer.
228
- *
229
- * @param buffer The buffer to serialize to.
230
- * @param parser The parser that parsed the node.
231
- * @param node The node to serialize.
232
- */
233
- PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *node);
234
-
235
- #endif
236
-
237
- /**
238
- * Represents the results of a slice query.
239
- */
240
- typedef enum {
241
- /** Returned if the encoding given to a slice query was invalid. */
242
- PM_STRING_QUERY_ERROR = -1,
243
-
244
- /** Returned if the result of the slice query is false. */
245
- PM_STRING_QUERY_FALSE,
246
-
247
- /** Returned if the result of the slice query is true. */
248
- PM_STRING_QUERY_TRUE
249
- } pm_string_query_t;
250
-
251
- /**
252
- * Check that the slice is a valid local variable name.
253
- *
254
- * @param source The source to check.
255
- * @param length The length of the source.
256
- * @param encoding_name The name of the encoding of the source.
257
- * @return PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
258
- * the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
259
- */
260
- PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_local(const uint8_t *source, size_t length, const char *encoding_name);
261
-
262
- /**
263
- * Check that the slice is a valid constant name.
264
- *
265
- * @param source The source to check.
266
- * @param length The length of the source.
267
- * @param encoding_name The name of the encoding of the source.
268
- * @return PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
269
- * the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
270
- */
271
- PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_constant(const uint8_t *source, size_t length, const char *encoding_name);
272
-
273
- /**
274
- * Check that the slice is a valid method name.
275
- *
276
- * @param source The source to check.
277
- * @param length The length of the source.
278
- * @param encoding_name The name of the encoding of the source.
279
- * @return PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
280
- * the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
281
- */
282
- PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint8_t *source, size_t length, const char *encoding_name);
283
-
284
- /**
285
- * @mainpage
286
- *
287
- * Prism is a parser for the Ruby programming language. It is designed to be
288
- * portable, error tolerant, and maintainable. It is written in C99 and has no
289
- * dependencies. It is currently being integrated into
290
- * [CRuby](https://github.com/ruby/ruby),
291
- * [JRuby](https://github.com/jruby/jruby),
292
- * [TruffleRuby](https://github.com/oracle/truffleruby),
293
- * [Sorbet](https://github.com/sorbet/sorbet), and
294
- * [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree).
295
- *
296
- * @section getting-started Getting started
297
- *
298
- * If you're vendoring this project and compiling it statically then as long as
299
- * you have a C99 compiler you will be fine. If you're linking against it as
300
- * shared library, then you should compile with `-fvisibility=hidden` and
301
- * `-DPRISM_EXPORT_SYMBOLS` to tell prism to make only its public interface
302
- * visible.
303
- *
304
- * @section parsing Parsing
305
- *
306
- * In order to parse Ruby code, the structures and functions that you're going
307
- * to want to use and be aware of are:
308
- *
309
- * * `pm_parser_t` - the main parser structure
310
- * * `pm_parser_init` - initialize a parser
311
- * * `pm_parse` - parse and return the root node
312
- * * `pm_node_destroy` - deallocate the root node returned by `pm_parse`
313
- * * `pm_parser_free` - free the internal memory of the parser
314
- *
315
- * Putting all of this together would look something like:
316
- *
317
- * ```c
318
- * void parse(const uint8_t *source, size_t length) {
319
- * pm_parser_t parser;
320
- * pm_parser_init(&parser, source, length, NULL);
321
- *
322
- * pm_node_t *root = pm_parse(&parser);
323
- * printf("PARSED!\n");
324
- *
325
- * pm_node_destroy(&parser, root);
326
- * pm_parser_free(&parser);
327
- * }
328
- * ```
329
- *
330
- * All of the nodes "inherit" from `pm_node_t` by embedding those structures as
331
- * their first member. This means you can downcast and upcast any node in the
332
- * tree to a `pm_node_t`.
333
- *
334
- * @section serializing Serializing
335
- *
336
- * Prism provides the ability to serialize the AST and its related metadata into
337
- * a binary format. This format is designed to be portable to different
338
- * languages and runtimes so that you only need to make one FFI call in order to
339
- * parse Ruby code. The structures and functions that you're going to want to
340
- * use and be aware of are:
341
- *
342
- * * `pm_buffer_t` - a small buffer object that will hold the serialized AST
343
- * * `pm_buffer_free` - free the memory associated with the buffer
344
- * * `pm_serialize` - serialize the AST into a buffer
345
- * * `pm_serialize_parse` - parse and serialize the AST into a buffer
346
- *
347
- * Putting all of this together would look something like:
348
- *
349
- * ```c
350
- * void serialize(const uint8_t *source, size_t length) {
351
- * pm_buffer_t buffer = { 0 };
352
- *
353
- * pm_serialize_parse(&buffer, source, length, NULL);
354
- * printf("SERIALIZED!\n");
355
- *
356
- * pm_buffer_free(&buffer);
357
- * }
358
- * ```
359
- *
360
- * @section inspecting Inspecting
361
- *
362
- * Prism provides the ability to inspect the AST by pretty-printing nodes. You
363
- * can do this with the `pm_prettyprint` function, which you would use like:
364
- *
365
- * ```c
366
- * void prettyprint(const uint8_t *source, size_t length) {
367
- * pm_parser_t parser;
368
- * pm_parser_init(&parser, source, length, NULL);
369
- *
370
- * pm_node_t *root = pm_parse(&parser);
371
- * pm_buffer_t buffer = { 0 };
372
- *
373
- * pm_prettyprint(&buffer, &parser, root);
374
- * printf("%*.s\n", (int) buffer.length, buffer.value);
375
- *
376
- * pm_buffer_free(&buffer);
377
- * pm_node_destroy(&parser, root);
378
- * pm_parser_free(&parser);
379
- * }
380
- * ```
381
- */
382
-
383
- #endif
@@ -1,43 +0,0 @@
1
- /**
2
- * @file regexp.h
3
- *
4
- * A regular expression parser.
5
- */
6
- #ifndef PRISM_REGEXP_H
7
- #define PRISM_REGEXP_H
8
-
9
- #include "prism/defines.h"
10
- #include "prism/parser.h"
11
- #include "prism/encoding.h"
12
- #include "prism/util/pm_memchr.h"
13
- #include "prism/util/pm_string.h"
14
-
15
- #include <stdbool.h>
16
- #include <stddef.h>
17
- #include <string.h>
18
-
19
- /**
20
- * This callback is called when a named capture group is found.
21
- */
22
- typedef void (*pm_regexp_name_callback_t)(const pm_string_t *name, void *data);
23
-
24
- /**
25
- * This callback is called when a parse error is found.
26
- */
27
- typedef void (*pm_regexp_error_callback_t)(const uint8_t *start, const uint8_t *end, const char *message, void *data);
28
-
29
- /**
30
- * Parse a regular expression.
31
- *
32
- * @param parser The parser that is currently being used.
33
- * @param source The source code to parse.
34
- * @param size The size of the source code.
35
- * @param extended_mode Whether to parse the regular expression in extended mode.
36
- * @param name_callback The optional callback to call when a named capture group is found.
37
- * @param name_data The optional data to pass to the name callback.
38
- * @param error_callback The callback to call when a parse error is found.
39
- * @param error_data The data to pass to the error callback.
40
- */
41
- PRISM_EXPORTED_FUNCTION void pm_regexp_parse(pm_parser_t *parser, const uint8_t *source, size_t size, bool extended_mode, pm_regexp_name_callback_t name_callback, void *name_data, pm_regexp_error_callback_t error_callback, void *error_data);
42
-
43
- #endif
@@ -1,228 +0,0 @@
1
- /**
2
- * @file pm_buffer.h
3
- *
4
- * A wrapper around a contiguous block of allocated memory.
5
- */
6
- #ifndef PRISM_BUFFER_H
7
- #define PRISM_BUFFER_H
8
-
9
- #include "prism/defines.h"
10
- #include "prism/util/pm_char.h"
11
-
12
- #include <assert.h>
13
- #include <stdbool.h>
14
- #include <stdint.h>
15
- #include <stdlib.h>
16
- #include <string.h>
17
-
18
- /**
19
- * A pm_buffer_t is a simple memory buffer that stores data in a contiguous
20
- * block of memory.
21
- */
22
- typedef struct {
23
- /** The length of the buffer in bytes. */
24
- size_t length;
25
-
26
- /** The capacity of the buffer in bytes that has been allocated. */
27
- size_t capacity;
28
-
29
- /** A pointer to the start of the buffer. */
30
- char *value;
31
- } pm_buffer_t;
32
-
33
- /**
34
- * Return the size of the pm_buffer_t struct.
35
- *
36
- * @returns The size of the pm_buffer_t struct.
37
- */
38
- PRISM_EXPORTED_FUNCTION size_t pm_buffer_sizeof(void);
39
-
40
- /**
41
- * Initialize a pm_buffer_t with the given capacity.
42
- *
43
- * @param buffer The buffer to initialize.
44
- * @param capacity The capacity of the buffer.
45
- * @returns True if the buffer was initialized successfully, false otherwise.
46
- */
47
- bool pm_buffer_init_capacity(pm_buffer_t *buffer, size_t capacity);
48
-
49
- /**
50
- * Initialize a pm_buffer_t with its default values.
51
- *
52
- * @param buffer The buffer to initialize.
53
- * @returns True if the buffer was initialized successfully, false otherwise.
54
- */
55
- PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer);
56
-
57
- /**
58
- * Return the value of the buffer.
59
- *
60
- * @param buffer The buffer to get the value of.
61
- * @returns The value of the buffer.
62
- */
63
- PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer);
64
-
65
- /**
66
- * Return the length of the buffer.
67
- *
68
- * @param buffer The buffer to get the length of.
69
- * @returns The length of the buffer.
70
- */
71
- PRISM_EXPORTED_FUNCTION size_t pm_buffer_length(const pm_buffer_t *buffer);
72
-
73
- /**
74
- * Append the given amount of space as zeroes to the buffer.
75
- *
76
- * @param buffer The buffer to append to.
77
- * @param length The amount of space to append and zero.
78
- */
79
- void pm_buffer_append_zeroes(pm_buffer_t *buffer, size_t length);
80
-
81
- /**
82
- * Append a formatted string to the buffer.
83
- *
84
- * @param buffer The buffer to append to.
85
- * @param format The format string to append.
86
- * @param ... The arguments to the format string.
87
- */
88
- void pm_buffer_append_format(pm_buffer_t *buffer, const char *format, ...) PRISM_ATTRIBUTE_FORMAT(2, 3);
89
-
90
- /**
91
- * Append a string to the buffer.
92
- *
93
- * @param buffer The buffer to append to.
94
- * @param value The string to append.
95
- * @param length The length of the string to append.
96
- */
97
- void pm_buffer_append_string(pm_buffer_t *buffer, const char *value, size_t length);
98
-
99
- /**
100
- * Append a list of bytes to the buffer.
101
- *
102
- * @param buffer The buffer to append to.
103
- * @param value The bytes to append.
104
- * @param length The length of the bytes to append.
105
- */
106
- void pm_buffer_append_bytes(pm_buffer_t *buffer, const uint8_t *value, size_t length);
107
-
108
- /**
109
- * Append a single byte to the buffer.
110
- *
111
- * @param buffer The buffer to append to.
112
- * @param value The byte to append.
113
- */
114
- void pm_buffer_append_byte(pm_buffer_t *buffer, uint8_t value);
115
-
116
- /**
117
- * Append a 32-bit unsigned integer to the buffer as a variable-length integer.
118
- *
119
- * @param buffer The buffer to append to.
120
- * @param value The integer to append.
121
- */
122
- void pm_buffer_append_varuint(pm_buffer_t *buffer, uint32_t value);
123
-
124
- /**
125
- * Append a 32-bit signed integer to the buffer as a variable-length integer.
126
- *
127
- * @param buffer The buffer to append to.
128
- * @param value The integer to append.
129
- */
130
- void pm_buffer_append_varsint(pm_buffer_t *buffer, int32_t value);
131
-
132
- /**
133
- * Append a double to the buffer.
134
- *
135
- * @param buffer The buffer to append to.
136
- * @param value The double to append.
137
- */
138
- void pm_buffer_append_double(pm_buffer_t *buffer, double value);
139
-
140
- /**
141
- * Append a unicode codepoint to the buffer.
142
- *
143
- * @param buffer The buffer to append to.
144
- * @param value The character to append.
145
- * @returns True if the codepoint was valid and appended successfully, false
146
- * otherwise.
147
- */
148
- bool pm_buffer_append_unicode_codepoint(pm_buffer_t *buffer, uint32_t value);
149
-
150
- /**
151
- * The different types of escaping that can be performed by the buffer when
152
- * appending a slice of Ruby source code.
153
- */
154
- typedef enum {
155
- PM_BUFFER_ESCAPING_RUBY,
156
- PM_BUFFER_ESCAPING_JSON
157
- } pm_buffer_escaping_t;
158
-
159
- /**
160
- * Append a slice of source code to the buffer.
161
- *
162
- * @param buffer The buffer to append to.
163
- * @param source The source code to append.
164
- * @param length The length of the source code to append.
165
- * @param escaping The type of escaping to perform.
166
- */
167
- void pm_buffer_append_source(pm_buffer_t *buffer, const uint8_t *source, size_t length, pm_buffer_escaping_t escaping);
168
-
169
- /**
170
- * Prepend the given string to the buffer.
171
- *
172
- * @param buffer The buffer to prepend to.
173
- * @param value The string to prepend.
174
- * @param length The length of the string to prepend.
175
- */
176
- void pm_buffer_prepend_string(pm_buffer_t *buffer, const char *value, size_t length);
177
-
178
- /**
179
- * Concatenate one buffer onto another.
180
- *
181
- * @param destination The buffer to concatenate onto.
182
- * @param source The buffer to concatenate.
183
- */
184
- void pm_buffer_concat(pm_buffer_t *destination, const pm_buffer_t *source);
185
-
186
- /**
187
- * Clear the buffer by reducing its size to 0. This does not free the allocated
188
- * memory, but it does allow the buffer to be reused.
189
- *
190
- * @param buffer The buffer to clear.
191
- */
192
- void pm_buffer_clear(pm_buffer_t *buffer);
193
-
194
- /**
195
- * Strip the whitespace from the end of the buffer.
196
- *
197
- * @param buffer The buffer to strip.
198
- */
199
- void pm_buffer_rstrip(pm_buffer_t *buffer);
200
-
201
- /**
202
- * Checks if the buffer includes the given value.
203
- *
204
- * @param buffer The buffer to check.
205
- * @param value The value to check for.
206
- * @returns The index of the first occurrence of the value in the buffer, or
207
- * SIZE_MAX if the value is not found.
208
- */
209
- size_t pm_buffer_index(const pm_buffer_t *buffer, char value);
210
-
211
- /**
212
- * Insert the given string into the buffer at the given index.
213
- *
214
- * @param buffer The buffer to insert into.
215
- * @param index The index to insert at.
216
- * @param value The string to insert.
217
- * @param length The length of the string to insert.
218
- */
219
- void pm_buffer_insert(pm_buffer_t *buffer, size_t index, const char *value, size_t length);
220
-
221
- /**
222
- * Free the memory associated with the buffer.
223
- *
224
- * @param buffer The buffer to free.
225
- */
226
- PRISM_EXPORTED_FUNCTION void pm_buffer_free(pm_buffer_t *buffer);
227
-
228
- #endif