debase-ruby_core_source 3.3.6 → 4.0.0.preview2

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 (306) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +10 -0
  4. data/Rakefile +3 -1
  5. data/debase-ruby_core_source.gemspec +1 -0
  6. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/builtin.h +7 -1
  7. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/darray.h +1 -3
  8. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/id.h +5 -0
  9. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/insns.inc +2 -0
  10. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/insns_info.inc +310 -175
  11. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/basic_operators.h +1 -0
  12. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/bits.h +82 -0
  13. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/encoding.h +2 -0
  14. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/error.h +26 -0
  15. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/fixnum.h +1 -0
  16. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/gc.h +14 -6
  17. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/imemo.h +6 -1
  18. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/io.h +1 -1
  19. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/parse.h +2 -1
  20. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/proc.h +1 -0
  21. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/ractor.h +4 -0
  22. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/sanitizers.h +31 -39
  23. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/string.h +22 -10
  24. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/thread.h +23 -0
  25. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/vm.h +1 -1
  26. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/method.h +1 -0
  27. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/optunifs.inc +1 -1
  28. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/parse.h +2 -2
  29. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/ast.h +427 -3
  30. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/defines.h +8 -7
  31. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/diagnostic.h +1 -0
  32. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/extension.h +1 -1
  33. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/prism.h +47 -11
  34. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/version.h +2 -2
  35. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism_compile.h +5 -5
  36. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/ractor_core.h +6 -6
  37. data/lib/debase/ruby_core_source/ruby-3.4.0-p-1/revision.h +5 -0
  38. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/rubyparser.h +3 -2
  39. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/thread_pthread.h +0 -1
  40. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/version.h +1 -1
  41. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm.inc +151 -88
  42. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_core.h +40 -12
  43. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_sync.h +3 -3
  44. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vmtc.inc +2 -0
  45. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/yjit.h +1 -0
  46. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/builtin.h +7 -1
  47. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/darray.h +101 -14
  48. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/debug_counter.h +6 -4
  49. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/dln.h +1 -2
  50. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/eval_intern.h +7 -0
  51. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/id.h +16 -5
  52. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/id_table.h +15 -0
  53. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/insns.inc +49 -6
  54. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/insns_info.inc +2432 -721
  55. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/array.h +3 -0
  56. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/basic_operators.h +2 -0
  57. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/bignum.h +1 -0
  58. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/bits.h +82 -0
  59. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/box.h +81 -0
  60. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/class.h +805 -0
  61. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/cmdlineopt.h +3 -4
  62. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/concurrent_set.h +21 -0
  63. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/encoding.h +4 -1
  64. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/error.h +35 -0
  65. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/eval.h +8 -0
  66. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/fixnum.h +1 -0
  67. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/gc.h +54 -30
  68. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/hash.h +3 -0
  69. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/imemo.h +94 -32
  70. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/inits.h +4 -0
  71. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/io.h +30 -7
  72. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/load.h +2 -0
  73. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/numeric.h +1 -0
  74. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/object.h +1 -1
  75. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/parse.h +18 -4
  76. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/proc.h +1 -1
  77. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/ractor.h +4 -0
  78. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/re.h +7 -2
  79. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/sanitizers.h +88 -39
  80. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/set_table.h +70 -0
  81. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/signal.h +1 -0
  82. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/st.h +1 -1
  83. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/string.h +39 -18
  84. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/struct.h +38 -5
  85. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/symbol.h +4 -3
  86. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/thread.h +42 -9
  87. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/time.h +4 -1
  88. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/variable.h +13 -11
  89. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/vm.h +6 -7
  90. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal.h +0 -3
  91. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/iseq.h +19 -2
  92. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/known_errors.inc +103 -103
  93. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/method.h +18 -2
  94. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/node.h +14 -3
  95. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/optunifs.inc +1 -3
  96. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/parse.h +37 -36
  97. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/ast.h +2495 -507
  98. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/defines.h +61 -7
  99. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/diagnostic.h +31 -6
  100. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/extension.h +5 -5
  101. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/node.h +0 -21
  102. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/options.h +186 -6
  103. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/parser.h +85 -40
  104. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/prism.h +88 -16
  105. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/regexp.h +43 -0
  106. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/static_literals.h +3 -2
  107. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_buffer.h +18 -0
  108. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_char.h +1 -2
  109. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_constant_pool.h +0 -8
  110. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_integer.h +26 -15
  111. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_list.h +6 -0
  112. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_newline_list.h +11 -0
  113. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_string.h +39 -13
  114. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/version.h +3 -3
  115. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism_compile.h +30 -12
  116. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/ractor_core.h +47 -134
  117. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/regenc.h +9 -4
  118. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/regint.h +0 -5
  119. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/regparse.h +2 -2
  120. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/revision.h +5 -0
  121. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ruby_atomic.h +66 -0
  122. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/rubyparser.h +214 -250
  123. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/shape.h +444 -0
  124. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/symbol.h +8 -10
  125. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/thread_pthread.h +36 -27
  126. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/variable.h +8 -20
  127. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm.inc +884 -344
  128. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_callinfo.h +110 -75
  129. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_core.h +220 -106
  130. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_exec.h +15 -4
  131. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_insnhelper.h +11 -6
  132. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_sync.h +23 -4
  133. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vmtc.inc +42 -6
  134. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/yjit.h +5 -3
  135. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/zjit.h +47 -0
  136. data/lib/debase/ruby_core_source/version.rb +1 -1
  137. data/lib/debase/ruby_core_source.rb +4 -2
  138. data/test/deduce_source_dir_test.rb +31 -0
  139. metadata +307 -293
  140. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h +0 -283
  141. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h +0 -33
  142. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h +0 -44
  143. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h +0 -5
  144. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/shape.h +0 -233
  145. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/revision.h +0 -5
  146. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit.h +0 -101
  147. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h +0 -165
  148. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h +0 -23
  149. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/addr2line.h +0 -0
  150. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/build_assert/build_assert.h +0 -0
  151. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/check_type/check_type.h +0 -0
  152. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/container_of/container_of.h +0 -0
  153. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/list/list.h +0 -0
  154. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/str/str.h +0 -0
  155. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/constant.h +0 -0
  156. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/debug_counter.h +0 -0
  157. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/dln.h +0 -0
  158. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/encindex.h +0 -0
  159. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/eval_intern.h +0 -0
  160. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/hrtime.h +0 -0
  161. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/id_table.h +0 -0
  162. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/array.h +0 -0
  163. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/bignum.h +0 -0
  164. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/class.h +0 -0
  165. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/cmdlineopt.h +0 -0
  166. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/compar.h +0 -0
  167. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/compile.h +0 -0
  168. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/compilers.h +0 -0
  169. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/complex.h +0 -0
  170. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/cont.h +0 -0
  171. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/dir.h +0 -0
  172. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/enc.h +0 -0
  173. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/enum.h +0 -0
  174. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/enumerator.h +0 -0
  175. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/eval.h +0 -0
  176. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/file.h +0 -0
  177. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/hash.h +0 -0
  178. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/inits.h +0 -0
  179. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/load.h +0 -0
  180. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/loadpath.h +0 -0
  181. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/math.h +0 -0
  182. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/missing.h +0 -0
  183. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/numeric.h +0 -0
  184. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/object.h +0 -0
  185. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/process.h +0 -0
  186. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/random.h +0 -0
  187. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/range.h +0 -0
  188. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/rational.h +0 -0
  189. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/re.h +0 -0
  190. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/ruby_parser.h +0 -0
  191. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/serial.h +0 -0
  192. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/signal.h +0 -0
  193. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/st.h +0 -0
  194. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/static_assert.h +0 -0
  195. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/struct.h +0 -0
  196. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/symbol.h +0 -0
  197. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/time.h +0 -0
  198. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/transcode.h +0 -0
  199. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/util.h +0 -0
  200. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/variable.h +0 -0
  201. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/warnings.h +0 -0
  202. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal.h +0 -0
  203. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/iseq.h +0 -0
  204. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/known_errors.inc +0 -0
  205. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/node.h +0 -0
  206. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/node_name.inc +0 -0
  207. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/optinsn.inc +0 -0
  208. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_bits.h +0 -0
  209. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_node.h +0 -0
  210. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_st.h +0 -0
  211. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_value.h +0 -0
  212. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/encoding.h +0 -0
  213. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/node.h +0 -0
  214. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/options.h +0 -0
  215. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/pack.h +0 -0
  216. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/parser.h +0 -0
  217. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/prettyprint.h +0 -0
  218. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/regexp.h +0 -0
  219. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/static_literals.h +0 -0
  220. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_buffer.h +0 -0
  221. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_char.h +0 -0
  222. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_constant_pool.h +0 -0
  223. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_integer.h +0 -0
  224. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_list.h +0 -0
  225. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_memchr.h +0 -0
  226. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_newline_list.h +0 -0
  227. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_string.h +0 -0
  228. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_strncasecmp.h +0 -0
  229. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_strpbrk.h +0 -0
  230. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/probes_helper.h +0 -0
  231. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/regenc.h +0 -0
  232. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/regint.h +0 -0
  233. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/regparse.h +0 -0
  234. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/rjit.h +0 -0
  235. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/rjit_c.h +0 -0
  236. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ruby_assert.h +0 -0
  237. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ruby_atomic.h +0 -0
  238. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/shape.h +0 -0
  239. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/siphash.h +0 -0
  240. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/symbol.h +0 -0
  241. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/thread_none.h +0 -0
  242. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/thread_win32.h +0 -0
  243. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/timev.h +0 -0
  244. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/transcode_data.h +0 -0
  245. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/variable.h +0 -0
  246. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_call_iseq_optimized.inc +0 -0
  247. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_callinfo.h +0 -0
  248. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_debug.h +0 -0
  249. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_exec.h +0 -0
  250. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_insnhelper.h +0 -0
  251. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_opts.h +0 -0
  252. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/addr2line.h +0 -0
  253. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/build_assert/build_assert.h +0 -0
  254. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/check_type/check_type.h +0 -0
  255. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/container_of/container_of.h +0 -0
  256. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/list/list.h +0 -0
  257. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/str/str.h +0 -0
  258. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/constant.h +0 -0
  259. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/encindex.h +0 -0
  260. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/hrtime.h +0 -0
  261. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/compar.h +0 -0
  262. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/compile.h +0 -0
  263. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/compilers.h +0 -0
  264. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/complex.h +0 -0
  265. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/cont.h +0 -0
  266. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/dir.h +0 -0
  267. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/enc.h +0 -0
  268. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/enum.h +0 -0
  269. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/enumerator.h +0 -0
  270. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/file.h +0 -0
  271. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/loadpath.h +0 -0
  272. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/math.h +0 -0
  273. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/missing.h +0 -0
  274. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/process.h +0 -0
  275. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/random.h +0 -0
  276. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/range.h +0 -0
  277. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/rational.h +0 -0
  278. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/ruby_parser.h +0 -0
  279. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/serial.h +0 -0
  280. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/static_assert.h +0 -0
  281. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/transcode.h +0 -0
  282. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/util.h +0 -0
  283. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/warnings.h +0 -0
  284. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/node_name.inc +0 -0
  285. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/optinsn.inc +0 -0
  286. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_bits.h +0 -0
  287. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_node.h +0 -0
  288. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_st.h +0 -0
  289. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_value.h +0 -0
  290. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/encoding.h +0 -0
  291. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/pack.h +0 -0
  292. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/prettyprint.h +0 -0
  293. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_memchr.h +0 -0
  294. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_strncasecmp.h +0 -0
  295. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_strpbrk.h +0 -0
  296. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/probes_helper.h +0 -0
  297. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ruby_assert.h +0 -0
  298. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/siphash.h +0 -0
  299. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/thread_none.h +0 -0
  300. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/thread_win32.h +0 -0
  301. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/timev.h +0 -0
  302. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/transcode_data.h +0 -0
  303. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/version.h +0 -0
  304. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_call_iseq_optimized.inc +0 -0
  305. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_debug.h +0 -0
  306. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_opts.h +0 -0
@@ -23,8 +23,20 @@
23
23
  * some platforms they aren't included unless this is already defined.
24
24
  */
25
25
  #define __STDC_FORMAT_MACROS
26
+ // Include sys/types.h before inttypes.h to work around issue with
27
+ // certain versions of GCC and newlib which causes omission of PRIx64
28
+ #include <sys/types.h>
26
29
  #include <inttypes.h>
27
30
 
31
+ /**
32
+ * When we are parsing using recursive descent, we want to protect against
33
+ * malicious payloads that could attempt to crash our parser. We do this by
34
+ * specifying a maximum depth to which we are allowed to recurse.
35
+ */
36
+ #ifndef PRISM_DEPTH_MAXIMUM
37
+ #define PRISM_DEPTH_MAXIMUM 10000
38
+ #endif
39
+
28
40
  /**
29
41
  * By default, we compile with -fvisibility=hidden. When this is enabled, we
30
42
  * need to mark certain functions as being publically-visible. This macro does
@@ -119,14 +131,24 @@
119
131
  #endif
120
132
 
121
133
  /**
122
- * isinf on Windows is defined as accepting a float, but on POSIX systems it
123
- * accepts a float, a double, or a long double. We want to mirror this behavior
124
- * on windows.
134
+ * If PRISM_HAS_NO_FILESYSTEM is defined, then we want to exclude all filesystem
135
+ * related code from the library. All filesystem related code should be guarded
136
+ * by PRISM_HAS_FILESYSTEM.
125
137
  */
126
- #ifdef _WIN32
127
- # include <float.h>
128
- # undef isinf
129
- # define isinf(x) (sizeof(x) == sizeof(float) ? !_finitef(x) : !_finite(x))
138
+ #ifndef PRISM_HAS_NO_FILESYSTEM
139
+ # define PRISM_HAS_FILESYSTEM
140
+ #endif
141
+
142
+ /**
143
+ * isinf on POSIX systems it accepts a float, a double, or a long double.
144
+ * But mingw didn't provide an isinf macro, only an isinf function that only
145
+ * accepts floats, so we need to use _finite instead.
146
+ */
147
+ #ifdef __MINGW64__
148
+ #include <float.h>
149
+ #define PRISM_ISINF(x) (!_finite(x))
150
+ #else
151
+ #define PRISM_ISINF(x) isinf(x)
130
152
  #endif
131
153
 
132
154
  /**
@@ -203,4 +225,36 @@
203
225
  #define PRISM_ENCODING_EXCLUDE_FULL
204
226
  #endif
205
227
 
228
+ /**
229
+ * Support PRISM_LIKELY and PRISM_UNLIKELY to help the compiler optimize its
230
+ * branch predication.
231
+ */
232
+ #if defined(__GNUC__) || defined(__clang__)
233
+ /** The compiler should predicate that this branch will be taken. */
234
+ #define PRISM_LIKELY(x) __builtin_expect(!!(x), 1)
235
+
236
+ /** The compiler should predicate that this branch will not be taken. */
237
+ #define PRISM_UNLIKELY(x) __builtin_expect(!!(x), 0)
238
+ #else
239
+ /** Void because this platform does not support branch prediction hints. */
240
+ #define PRISM_LIKELY(x) (x)
241
+
242
+ /** Void because this platform does not support branch prediction hints. */
243
+ #define PRISM_UNLIKELY(x) (x)
244
+ #endif
245
+
246
+ /**
247
+ * We use -Wimplicit-fallthrough to guard potentially unintended fall-through between cases of a switch.
248
+ * Use PRISM_FALLTHROUGH to explicitly annotate cases where the fallthrough is intentional.
249
+ */
250
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L // C23 or later
251
+ #define PRISM_FALLTHROUGH [[fallthrough]];
252
+ #elif defined(__GNUC__) || defined(__clang__)
253
+ #define PRISM_FALLTHROUGH __attribute__((fallthrough));
254
+ #elif defined(_MSC_VER)
255
+ #define PRISM_FALLTHROUGH __fallthrough;
256
+ #else
257
+ #define PRISM_FALLTHROUGH
258
+ #endif
259
+
206
260
  #endif
@@ -1,10 +1,12 @@
1
- /******************************************************************************/
1
+ /* :markup: markdown */
2
+
3
+ /*----------------------------------------------------------------------------*/
2
4
  /* This file is generated by the templates/template.rb script and should not */
3
5
  /* be modified manually. See */
4
6
  /* templates/include/prism/diagnostic.h.erb */
5
7
  /* if you are looking to modify the */
6
8
  /* template */
7
- /******************************************************************************/
9
+ /*----------------------------------------------------------------------------*/
8
10
 
9
11
  /**
10
12
  * @file diagnostic.h
@@ -44,7 +46,6 @@ typedef enum {
44
46
  PM_ERR_ARGUMENT_FORMAL_GLOBAL,
45
47
  PM_ERR_ARGUMENT_FORMAL_IVAR,
46
48
  PM_ERR_ARGUMENT_FORWARDING_UNBOUND,
47
- PM_ERR_ARGUMENT_IN,
48
49
  PM_ERR_ARGUMENT_NO_FORWARDING_AMPERSAND,
49
50
  PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES,
50
51
  PM_ERR_ARGUMENT_NO_FORWARDING_STAR,
@@ -90,6 +91,7 @@ typedef enum {
90
91
  PM_ERR_CONDITIONAL_WHILE_PREDICATE,
91
92
  PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT,
92
93
  PM_ERR_DEF_ENDLESS,
94
+ PM_ERR_DEF_ENDLESS_PARAMETERS,
93
95
  PM_ERR_DEF_ENDLESS_SETTER,
94
96
  PM_ERR_DEF_NAME,
95
97
  PM_ERR_DEF_PARAMS_TERM,
@@ -110,8 +112,10 @@ typedef enum {
110
112
  PM_ERR_ESCAPE_INVALID_META_REPEAT,
111
113
  PM_ERR_ESCAPE_INVALID_UNICODE,
112
114
  PM_ERR_ESCAPE_INVALID_UNICODE_CM_FLAGS,
115
+ PM_ERR_ESCAPE_INVALID_UNICODE_LIST,
113
116
  PM_ERR_ESCAPE_INVALID_UNICODE_LITERAL,
114
117
  PM_ERR_ESCAPE_INVALID_UNICODE_LONG,
118
+ PM_ERR_ESCAPE_INVALID_UNICODE_SHORT,
115
119
  PM_ERR_ESCAPE_INVALID_UNICODE_TERM,
116
120
  PM_ERR_EXPECT_ARGUMENT,
117
121
  PM_ERR_EXPECT_EOL_AFTER_STATEMENT,
@@ -126,14 +130,18 @@ typedef enum {
126
130
  PM_ERR_EXPECT_EXPRESSION_AFTER_SPLAT,
127
131
  PM_ERR_EXPECT_EXPRESSION_AFTER_SPLAT_HASH,
128
132
  PM_ERR_EXPECT_EXPRESSION_AFTER_STAR,
133
+ PM_ERR_EXPECT_FOR_DELIMITER,
129
134
  PM_ERR_EXPECT_IDENT_REQ_PARAMETER,
130
135
  PM_ERR_EXPECT_IN_DELIMITER,
136
+ PM_ERR_EXPECT_LPAREN_AFTER_NOT_LPAREN,
137
+ PM_ERR_EXPECT_LPAREN_AFTER_NOT_OTHER,
131
138
  PM_ERR_EXPECT_LPAREN_REQ_PARAMETER,
132
139
  PM_ERR_EXPECT_MESSAGE,
133
140
  PM_ERR_EXPECT_RBRACKET,
134
141
  PM_ERR_EXPECT_RPAREN,
135
142
  PM_ERR_EXPECT_RPAREN_AFTER_MULTI,
136
143
  PM_ERR_EXPECT_RPAREN_REQ_PARAMETER,
144
+ PM_ERR_EXPECT_SINGLETON_CLASS_DELIMITER,
137
145
  PM_ERR_EXPECT_STRING_CONTENT,
138
146
  PM_ERR_EXPECT_WHEN_DELIMITER,
139
147
  PM_ERR_EXPRESSION_BARE_HASH,
@@ -143,6 +151,7 @@ typedef enum {
143
151
  PM_ERR_EXPRESSION_NOT_WRITABLE_FILE,
144
152
  PM_ERR_EXPRESSION_NOT_WRITABLE_LINE,
145
153
  PM_ERR_EXPRESSION_NOT_WRITABLE_NIL,
154
+ PM_ERR_EXPRESSION_NOT_WRITABLE_NUMBERED,
146
155
  PM_ERR_EXPRESSION_NOT_WRITABLE_SELF,
147
156
  PM_ERR_EXPRESSION_NOT_WRITABLE_TRUE,
148
157
  PM_ERR_FLOAT_PARSE,
@@ -166,6 +175,7 @@ typedef enum {
166
175
  PM_ERR_INSTANCE_VARIABLE_BARE,
167
176
  PM_ERR_INVALID_BLOCK_EXIT,
168
177
  PM_ERR_INVALID_CHARACTER,
178
+ PM_ERR_INVALID_COMMA,
169
179
  PM_ERR_INVALID_ENCODING_MAGIC_COMMENT,
170
180
  PM_ERR_INVALID_ESCAPE_CHARACTER,
171
181
  PM_ERR_INVALID_FLOAT_EXPONENT,
@@ -182,6 +192,7 @@ typedef enum {
182
192
  PM_ERR_INVALID_NUMBER_UNDERSCORE_INNER,
183
193
  PM_ERR_INVALID_NUMBER_UNDERSCORE_TRAILING,
184
194
  PM_ERR_INVALID_PERCENT,
195
+ PM_ERR_INVALID_PERCENT_EOF,
185
196
  PM_ERR_INVALID_PRINTABLE_CHARACTER,
186
197
  PM_ERR_INVALID_RETRY_AFTER_ELSE,
187
198
  PM_ERR_INVALID_RETRY_AFTER_ENSURE,
@@ -210,12 +221,15 @@ typedef enum {
210
221
  PM_ERR_MODULE_TERM,
211
222
  PM_ERR_MULTI_ASSIGN_MULTI_SPLATS,
212
223
  PM_ERR_MULTI_ASSIGN_UNEXPECTED_REST,
224
+ PM_ERR_NESTING_TOO_DEEP,
213
225
  PM_ERR_NO_LOCAL_VARIABLE,
226
+ PM_ERR_NON_ASSOCIATIVE_OPERATOR,
214
227
  PM_ERR_NOT_EXPRESSION,
215
228
  PM_ERR_NUMBER_LITERAL_UNDERSCORE,
229
+ PM_ERR_NUMBERED_PARAMETER_INNER_BLOCK,
216
230
  PM_ERR_NUMBERED_PARAMETER_IT,
217
231
  PM_ERR_NUMBERED_PARAMETER_ORDINARY,
218
- PM_ERR_NUMBERED_PARAMETER_OUTER_SCOPE,
232
+ PM_ERR_NUMBERED_PARAMETER_OUTER_BLOCK,
219
233
  PM_ERR_OPERATOR_MULTI_ASSIGN,
220
234
  PM_ERR_OPERATOR_WRITE_ARGUMENTS,
221
235
  PM_ERR_OPERATOR_WRITE_BLOCK,
@@ -232,9 +246,11 @@ typedef enum {
232
246
  PM_ERR_PARAMETER_SPLAT_MULTI,
233
247
  PM_ERR_PARAMETER_STAR,
234
248
  PM_ERR_PARAMETER_UNEXPECTED_FWD,
235
- PM_ERR_PARAMETER_WILD_LOOSE_COMMA,
236
249
  PM_ERR_PARAMETER_UNEXPECTED_NO_KW,
250
+ PM_ERR_PARAMETER_WILD_LOOSE_COMMA,
251
+ PM_ERR_PATTERN_ARRAY_MULTIPLE_RESTS,
237
252
  PM_ERR_PATTERN_CAPTURE_DUPLICATE,
253
+ PM_ERR_PATTERN_CAPTURE_IN_ALTERNATIVE,
238
254
  PM_ERR_PATTERN_EXPRESSION_AFTER_BRACKET,
239
255
  PM_ERR_PATTERN_EXPRESSION_AFTER_COMMA,
240
256
  PM_ERR_PATTERN_EXPRESSION_AFTER_HROCKET,
@@ -245,6 +261,7 @@ typedef enum {
245
261
  PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE,
246
262
  PM_ERR_PATTERN_EXPRESSION_AFTER_RANGE,
247
263
  PM_ERR_PATTERN_EXPRESSION_AFTER_REST,
264
+ PM_ERR_PATTERN_FIND_MISSING_INNER,
248
265
  PM_ERR_PATTERN_HASH_IMPLICIT,
249
266
  PM_ERR_PATTERN_HASH_KEY,
250
267
  PM_ERR_PATTERN_HASH_KEY_DUPLICATE,
@@ -262,6 +279,7 @@ typedef enum {
262
279
  PM_ERR_REGEXP_INCOMPAT_CHAR_ENCODING,
263
280
  PM_ERR_REGEXP_INVALID_UNICODE_RANGE,
264
281
  PM_ERR_REGEXP_NON_ESCAPED_MBC,
282
+ PM_ERR_REGEXP_PARSE_ERROR,
265
283
  PM_ERR_REGEXP_TERM,
266
284
  PM_ERR_REGEXP_UNKNOWN_OPTIONS,
267
285
  PM_ERR_REGEXP_UTF8_CHAR_NON_UTF8_REGEXP,
@@ -286,11 +304,16 @@ typedef enum {
286
304
  PM_ERR_TERNARY_COLON,
287
305
  PM_ERR_TERNARY_EXPRESSION_FALSE,
288
306
  PM_ERR_TERNARY_EXPRESSION_TRUE,
307
+ PM_ERR_UNARY_DISALLOWED,
289
308
  PM_ERR_UNARY_RECEIVER,
290
309
  PM_ERR_UNDEF_ARGUMENT,
291
310
  PM_ERR_UNEXPECTED_BLOCK_ARGUMENT,
292
311
  PM_ERR_UNEXPECTED_INDEX_BLOCK,
293
312
  PM_ERR_UNEXPECTED_INDEX_KEYWORDS,
313
+ PM_ERR_UNEXPECTED_LABEL,
314
+ PM_ERR_UNEXPECTED_MULTI_WRITE,
315
+ PM_ERR_UNEXPECTED_PARAMETER_DEFAULT_VALUE,
316
+ PM_ERR_UNEXPECTED_RANGE_OPERATOR,
294
317
  PM_ERR_UNEXPECTED_SAFE_NAVIGATION,
295
318
  PM_ERR_UNEXPECTED_TOKEN_CLOSE_CONTEXT,
296
319
  PM_ERR_UNEXPECTED_TOKEN_IGNORE,
@@ -303,6 +326,7 @@ typedef enum {
303
326
  PM_ERR_XSTRING_TERM,
304
327
 
305
328
  // These are the warning diagnostics.
329
+ PM_WARN_AMBIGUOUS_BINARY_OPERATOR,
306
330
  PM_WARN_AMBIGUOUS_FIRST_ARGUMENT_MINUS,
307
331
  PM_WARN_AMBIGUOUS_FIRST_ARGUMENT_PLUS,
308
332
  PM_WARN_AMBIGUOUS_PREFIX_AMPERSAND,
@@ -318,10 +342,11 @@ typedef enum {
318
342
  PM_WARN_DUPLICATED_WHEN_CLAUSE,
319
343
  PM_WARN_FLOAT_OUT_OF_RANGE,
320
344
  PM_WARN_IGNORED_FROZEN_STRING_LITERAL,
345
+ PM_WARN_INDENTATION_MISMATCH,
321
346
  PM_WARN_INTEGER_IN_FLIP_FLOP,
322
347
  PM_WARN_INVALID_CHARACTER,
348
+ PM_WARN_INVALID_MAGIC_COMMENT_VALUE,
323
349
  PM_WARN_INVALID_NUMBERED_REFERENCE,
324
- PM_WARN_INVALID_SHAREABLE_CONSTANT_VALUE,
325
350
  PM_WARN_KEYWORD_EOL,
326
351
  PM_WARN_LITERAL_IN_CONDITION_DEFAULT,
327
352
  PM_WARN_LITERAL_IN_CONDITION_VERBOSE,
@@ -1,19 +1,19 @@
1
1
  #ifndef PRISM_EXT_NODE_H
2
2
  #define PRISM_EXT_NODE_H
3
3
 
4
- #define EXPECTED_PRISM_VERSION "0.29.0"
4
+ #define EXPECTED_PRISM_VERSION "1.6.0"
5
5
 
6
6
  #include <ruby.h>
7
7
  #include <ruby/encoding.h>
8
8
  #include "prism.h"
9
9
 
10
- VALUE pm_source_new(const pm_parser_t *parser, rb_encoding *encoding);
11
- VALUE pm_token_new(const pm_parser_t *parser, const pm_token_t *token, rb_encoding *encoding, VALUE source);
12
- VALUE pm_ast_new(const pm_parser_t *parser, const pm_node_t *node, rb_encoding *encoding, VALUE source);
10
+ VALUE pm_source_new(const pm_parser_t *parser, rb_encoding *encoding, bool freeze);
11
+ VALUE pm_token_new(const pm_parser_t *parser, const pm_token_t *token, rb_encoding *encoding, VALUE source, bool freeze);
12
+ VALUE pm_ast_new(const pm_parser_t *parser, const pm_node_t *node, rb_encoding *encoding, VALUE source, bool freeze);
13
13
  VALUE pm_integer_new(const pm_integer_t *integer);
14
14
 
15
15
  void Init_prism_api_node(void);
16
16
  void Init_prism_pack(void);
17
- PRISM_EXPORTED_FUNCTION void Init_prism(void);
17
+ RUBY_FUNC_EXPORTED void Init_prism(void);
18
18
 
19
19
  #endif
@@ -56,27 +56,6 @@ void pm_node_list_free(pm_node_list_t *list);
56
56
  */
57
57
  PRISM_EXPORTED_FUNCTION void pm_node_destroy(pm_parser_t *parser, struct pm_node *node);
58
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
59
  /**
81
60
  * Returns a string representation of the given node type.
82
61
  *
@@ -7,6 +7,7 @@
7
7
  #define PRISM_OPTIONS_H
8
8
 
9
9
  #include "prism/defines.h"
10
+ #include "prism/util/pm_char.h"
10
11
  #include "prism/util/pm_string.h"
11
12
 
12
13
  #include <stdbool.h>
@@ -38,25 +39,84 @@ typedef struct pm_options_scope {
38
39
 
39
40
  /** The names of the locals in the scope. */
40
41
  pm_string_t *locals;
42
+
43
+ /** Flags for the set of forwarding parameters in this scope. */
44
+ uint8_t forwarding;
41
45
  } pm_options_scope_t;
42
46
 
47
+ /** The default value for parameters. */
48
+ static const uint8_t PM_OPTIONS_SCOPE_FORWARDING_NONE = 0x0;
49
+
50
+ /** When the scope is fowarding with the * parameter. */
51
+ static const uint8_t PM_OPTIONS_SCOPE_FORWARDING_POSITIONALS = 0x1;
52
+
53
+ /** When the scope is fowarding with the ** parameter. */
54
+ static const uint8_t PM_OPTIONS_SCOPE_FORWARDING_KEYWORDS = 0x2;
55
+
56
+ /** When the scope is fowarding with the & parameter. */
57
+ static const uint8_t PM_OPTIONS_SCOPE_FORWARDING_BLOCK = 0x4;
58
+
59
+ /** When the scope is fowarding with the ... parameter. */
60
+ static const uint8_t PM_OPTIONS_SCOPE_FORWARDING_ALL = 0x8;
61
+
62
+ // Forward declaration needed by the callback typedef.
63
+ struct pm_options;
64
+
65
+ /**
66
+ * The callback called when additional switches are found in a shebang comment
67
+ * that need to be processed by the runtime.
68
+ *
69
+ * @param options The options struct that may be updated by this callback.
70
+ * Certain fields will be checked for changes, specifically encoding,
71
+ * command_line, and frozen_string_literal.
72
+ * @param source The source of the shebang comment.
73
+ * @param length The length of the source.
74
+ * @param shebang_callback_data Any additional data that should be passed along
75
+ * to the callback.
76
+ */
77
+ typedef void (*pm_options_shebang_callback_t)(struct pm_options *options, const uint8_t *source, size_t length, void *shebang_callback_data);
78
+
43
79
  /**
44
80
  * The version of Ruby syntax that we should be parsing with. This is used to
45
81
  * allow consumers to specify which behavior they want in case they need to
46
82
  * parse in the same way as a specific version of CRuby would have.
47
83
  */
48
84
  typedef enum {
49
- /** The current version of prism. */
50
- PM_OPTIONS_VERSION_LATEST = 0,
85
+ /** If an explicit version is not provided, the current version of prism will be used. */
86
+ PM_OPTIONS_VERSION_UNSET = 0,
51
87
 
52
88
  /** The vendored version of prism in CRuby 3.3.x. */
53
- PM_OPTIONS_VERSION_CRUBY_3_3 = 1
89
+ PM_OPTIONS_VERSION_CRUBY_3_3 = 1,
90
+
91
+ /** The vendored version of prism in CRuby 3.4.x. */
92
+ PM_OPTIONS_VERSION_CRUBY_3_4 = 2,
93
+
94
+ /** The vendored version of prism in CRuby 4.0.x. */
95
+ PM_OPTIONS_VERSION_CRUBY_3_5 = 3,
96
+
97
+ /** The vendored version of prism in CRuby 4.0.x. */
98
+ PM_OPTIONS_VERSION_CRUBY_4_0 = 3,
99
+
100
+ /** The current version of prism. */
101
+ PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_0
54
102
  } pm_options_version_t;
55
103
 
56
104
  /**
57
105
  * The options that can be passed to the parser.
58
106
  */
59
- typedef struct {
107
+ typedef struct pm_options {
108
+ /**
109
+ * The callback to call when additional switches are found in a shebang
110
+ * comment.
111
+ */
112
+ pm_options_shebang_callback_t shebang_callback;
113
+
114
+ /**
115
+ * Any additional data that should be passed along to the shebang callback
116
+ * if one was set.
117
+ */
118
+ void *shebang_callback_data;
119
+
60
120
  /** The name of the file that is currently being parsed. */
61
121
  pm_string_t filepath;
62
122
 
@@ -103,6 +163,37 @@ typedef struct {
103
163
  * - PM_OPTIONS_FROZEN_STRING_LITERAL_UNSET
104
164
  */
105
165
  int8_t frozen_string_literal;
166
+
167
+ /**
168
+ * Whether or not the encoding magic comments should be respected. This is a
169
+ * niche use-case where you want to parse a file with a specific encoding
170
+ * but ignore any encoding magic comments at the top of the file.
171
+ */
172
+ bool encoding_locked;
173
+
174
+ /**
175
+ * When the file being parsed is the main script, the shebang will be
176
+ * considered for command-line flags (or for implicit -x). The caller needs
177
+ * to pass this information to the parser so that it can behave correctly.
178
+ */
179
+ bool main_script;
180
+
181
+ /**
182
+ * When the file being parsed is considered a "partial" script, jumps will
183
+ * not be marked as errors if they are not contained within loops/blocks.
184
+ * This is used in the case that you're parsing a script that you know will
185
+ * be embedded inside another script later, but you do not have that context
186
+ * yet. For example, when parsing an ERB template that will be evaluated
187
+ * inside another script.
188
+ */
189
+ bool partial_script;
190
+
191
+ /**
192
+ * Whether or not the parser should freeze the nodes that it creates. This
193
+ * makes it possible to have a deeply frozen AST that is safe to share
194
+ * between concurrency primitives.
195
+ */
196
+ bool freeze;
106
197
  } pm_options_t;
107
198
 
108
199
  /**
@@ -142,11 +233,25 @@ static const uint8_t PM_OPTIONS_COMMAND_LINE_P = 0x10;
142
233
  */
143
234
  static const uint8_t PM_OPTIONS_COMMAND_LINE_X = 0x20;
144
235
 
236
+ /**
237
+ * Set the shebang callback option on the given options struct.
238
+ *
239
+ * @param options The options struct to set the shebang callback on.
240
+ * @param shebang_callback The shebang callback to set.
241
+ * @param shebang_callback_data Any additional data that should be passed along
242
+ * to the callback.
243
+ *
244
+ * \public \memberof pm_options
245
+ */
246
+ PRISM_EXPORTED_FUNCTION void pm_options_shebang_callback_set(pm_options_t *options, pm_options_shebang_callback_t shebang_callback, void *shebang_callback_data);
247
+
145
248
  /**
146
249
  * Set the filepath option on the given options struct.
147
250
  *
148
251
  * @param options The options struct to set the filepath on.
149
252
  * @param filepath The filepath to set.
253
+ *
254
+ * \public \memberof pm_options
150
255
  */
151
256
  PRISM_EXPORTED_FUNCTION void pm_options_filepath_set(pm_options_t *options, const char *filepath);
152
257
 
@@ -155,6 +260,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_filepath_set(pm_options_t *options, cons
155
260
  *
156
261
  * @param options The options struct to set the line on.
157
262
  * @param line The line to set.
263
+ *
264
+ * \public \memberof pm_options
158
265
  */
159
266
  PRISM_EXPORTED_FUNCTION void pm_options_line_set(pm_options_t *options, int32_t line);
160
267
 
@@ -163,14 +270,28 @@ PRISM_EXPORTED_FUNCTION void pm_options_line_set(pm_options_t *options, int32_t
163
270
  *
164
271
  * @param options The options struct to set the encoding on.
165
272
  * @param encoding The encoding to set.
273
+ *
274
+ * \public \memberof pm_options
166
275
  */
167
276
  PRISM_EXPORTED_FUNCTION void pm_options_encoding_set(pm_options_t *options, const char *encoding);
168
277
 
278
+ /**
279
+ * Set the encoding_locked option on the given options struct.
280
+ *
281
+ * @param options The options struct to set the encoding_locked value on.
282
+ * @param encoding_locked The encoding_locked value to set.
283
+ *
284
+ * \public \memberof pm_options
285
+ */
286
+ PRISM_EXPORTED_FUNCTION void pm_options_encoding_locked_set(pm_options_t *options, bool encoding_locked);
287
+
169
288
  /**
170
289
  * Set the frozen string literal option on the given options struct.
171
290
  *
172
291
  * @param options The options struct to set the frozen string literal value on.
173
292
  * @param frozen_string_literal The frozen string literal value to set.
293
+ *
294
+ * \public \memberof pm_options
174
295
  */
175
296
  PRISM_EXPORTED_FUNCTION void pm_options_frozen_string_literal_set(pm_options_t *options, bool frozen_string_literal);
176
297
 
@@ -179,6 +300,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_frozen_string_literal_set(pm_options_t *
179
300
  *
180
301
  * @param options The options struct to set the command line option on.
181
302
  * @param command_line The command_line value to set.
303
+ *
304
+ * \public \memberof pm_options
182
305
  */
183
306
  PRISM_EXPORTED_FUNCTION void pm_options_command_line_set(pm_options_t *options, uint8_t command_line);
184
307
 
@@ -191,15 +314,49 @@ PRISM_EXPORTED_FUNCTION void pm_options_command_line_set(pm_options_t *options,
191
314
  * @param version The version to set.
192
315
  * @param length The length of the version string.
193
316
  * @return Whether or not the version was parsed successfully.
317
+ *
318
+ * \public \memberof pm_options
194
319
  */
195
320
  PRISM_EXPORTED_FUNCTION bool pm_options_version_set(pm_options_t *options, const char *version, size_t length);
196
321
 
322
+ /**
323
+ * Set the main script option on the given options struct.
324
+ *
325
+ * @param options The options struct to set the main script value on.
326
+ * @param main_script The main script value to set.
327
+ *
328
+ * \public \memberof pm_options
329
+ */
330
+ PRISM_EXPORTED_FUNCTION void pm_options_main_script_set(pm_options_t *options, bool main_script);
331
+
332
+ /**
333
+ * Set the partial script option on the given options struct.
334
+ *
335
+ * @param options The options struct to set the partial script value on.
336
+ * @param partial_script The partial script value to set.
337
+ *
338
+ * \public \memberof pm_options
339
+ */
340
+ PRISM_EXPORTED_FUNCTION void pm_options_partial_script_set(pm_options_t *options, bool partial_script);
341
+
342
+ /**
343
+ * Set the freeze option on the given options struct.
344
+ *
345
+ * @param options The options struct to set the freeze value on.
346
+ * @param freeze The freeze value to set.
347
+ *
348
+ * \public \memberof pm_options
349
+ */
350
+ PRISM_EXPORTED_FUNCTION void pm_options_freeze_set(pm_options_t *options, bool freeze);
351
+
197
352
  /**
198
353
  * Allocate and zero out the scopes array on the given options struct.
199
354
  *
200
355
  * @param options The options struct to initialize the scopes array on.
201
356
  * @param scopes_count The number of scopes to allocate.
202
357
  * @return Whether or not the scopes array was initialized successfully.
358
+ *
359
+ * \public \memberof pm_options
203
360
  */
204
361
  PRISM_EXPORTED_FUNCTION bool pm_options_scopes_init(pm_options_t *options, size_t scopes_count);
205
362
 
@@ -209,6 +366,8 @@ PRISM_EXPORTED_FUNCTION bool pm_options_scopes_init(pm_options_t *options, size_
209
366
  * @param options The options struct to get the scope from.
210
367
  * @param index The index of the scope to get.
211
368
  * @return A pointer to the scope at the given index.
369
+ *
370
+ * \public \memberof pm_options
212
371
  */
213
372
  PRISM_EXPORTED_FUNCTION const pm_options_scope_t * pm_options_scope_get(const pm_options_t *options, size_t index);
214
373
 
@@ -219,6 +378,8 @@ PRISM_EXPORTED_FUNCTION const pm_options_scope_t * pm_options_scope_get(const pm
219
378
  * @param scope The scope struct to initialize.
220
379
  * @param locals_count The number of locals to allocate.
221
380
  * @return Whether or not the scope was initialized successfully.
381
+ *
382
+ * \public \memberof pm_options
222
383
  */
223
384
  PRISM_EXPORTED_FUNCTION bool pm_options_scope_init(pm_options_scope_t *scope, size_t locals_count);
224
385
 
@@ -228,13 +389,27 @@ PRISM_EXPORTED_FUNCTION bool pm_options_scope_init(pm_options_scope_t *scope, si
228
389
  * @param scope The scope struct to get the local from.
229
390
  * @param index The index of the local to get.
230
391
  * @return A pointer to the local at the given index.
392
+ *
393
+ * \public \memberof pm_options
231
394
  */
232
395
  PRISM_EXPORTED_FUNCTION const pm_string_t * pm_options_scope_local_get(const pm_options_scope_t *scope, size_t index);
233
396
 
397
+ /**
398
+ * Set the forwarding option on the given scope struct.
399
+ *
400
+ * @param scope The scope struct to set the forwarding on.
401
+ * @param forwarding The forwarding value to set.
402
+ *
403
+ * \public \memberof pm_options
404
+ */
405
+ PRISM_EXPORTED_FUNCTION void pm_options_scope_forwarding_set(pm_options_scope_t *scope, uint8_t forwarding);
406
+
234
407
  /**
235
408
  * Free the internal memory associated with the options.
236
409
  *
237
410
  * @param options The options struct whose internal memory should be freed.
411
+ *
412
+ * \public \memberof pm_options
238
413
  */
239
414
  PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options);
240
415
 
@@ -261,6 +436,10 @@ PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options);
261
436
  * | `1` | -l command line option |
262
437
  * | `1` | -a command line option |
263
438
  * | `1` | the version |
439
+ * | `1` | encoding locked |
440
+ * | `1` | main script |
441
+ * | `1` | partial script |
442
+ * | `1` | freeze |
264
443
  * | `4` | the number of scopes |
265
444
  * | ... | the scopes |
266
445
  *
@@ -276,6 +455,7 @@ PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options);
276
455
  * | # bytes | field |
277
456
  * | ------- | -------------------------- |
278
457
  * | `4` | the number of locals |
458
+ * | `1` | the forwarding flags |
279
459
  * | ... | the locals |
280
460
  *
281
461
  * Each local is laid out as follows:
@@ -293,8 +473,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options);
293
473
  * * The encoding can have a length of 0, in which case we'll use the default
294
474
  * encoding (UTF-8). If it's not 0, it should correspond to a name of an
295
475
  * 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.
476
+ * * The frozen string literal, encoding locked, main script, and partial script
477
+ * fields are booleans, so their values should be either 0 or 1.
298
478
  * * The number of scopes can be 0.
299
479
  *
300
480
  * @param options The options struct to deserialize into.