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
@@ -82,6 +82,23 @@ typedef enum {
82
82
  PM_HEREDOC_INDENT_TILDE,
83
83
  } pm_heredoc_indent_t;
84
84
 
85
+ /**
86
+ * All of the information necessary to store to lexing a heredoc.
87
+ */
88
+ typedef struct {
89
+ /** A pointer to the start of the heredoc identifier. */
90
+ const uint8_t *ident_start;
91
+
92
+ /** The length of the heredoc identifier. */
93
+ size_t ident_length;
94
+
95
+ /** The type of quote that the heredoc uses. */
96
+ pm_heredoc_quote_t quote;
97
+
98
+ /** The type of indentation that the heredoc uses. */
99
+ pm_heredoc_indent_t indent;
100
+ } pm_heredoc_lex_mode_t;
101
+
85
102
  /**
86
103
  * When lexing Ruby source, the lexer has a small amount of state to tell which
87
104
  * kind of token it is currently lexing. For example, when we find the start of
@@ -210,17 +227,10 @@ typedef struct pm_lex_mode {
210
227
  } string;
211
228
 
212
229
  struct {
213
- /** A pointer to the start of the heredoc identifier. */
214
- const uint8_t *ident_start;
215
-
216
- /** The length of the heredoc identifier. */
217
- size_t ident_length;
218
-
219
- /** The type of quote that the heredoc uses. */
220
- pm_heredoc_quote_t quote;
221
-
222
- /** The type of indentation that the heredoc uses. */
223
- pm_heredoc_indent_t indent;
230
+ /**
231
+ * All of the data necessary to lex a heredoc.
232
+ */
233
+ pm_heredoc_lex_mode_t base;
224
234
 
225
235
  /**
226
236
  * This is the pointer to the character where lexing should resume
@@ -233,7 +243,7 @@ typedef struct pm_lex_mode {
233
243
  * line so that we know how much to dedent each line in the case of
234
244
  * a tilde heredoc.
235
245
  */
236
- size_t common_whitespace;
246
+ size_t *common_whitespace;
237
247
 
238
248
  /** True if the previous token ended with a line continuation. */
239
249
  bool line_continuation;
@@ -289,6 +299,9 @@ typedef enum {
289
299
  /** a rescue else statement within a do..end block */
290
300
  PM_CONTEXT_BLOCK_ELSE,
291
301
 
302
+ /** expressions in block parameters `foo do |...| end ` */
303
+ PM_CONTEXT_BLOCK_PARAMETERS,
304
+
292
305
  /** a rescue statement within a do..end block */
293
306
  PM_CONTEXT_BLOCK_RESCUE,
294
307
 
@@ -364,6 +377,9 @@ typedef enum {
364
377
  /** a rescue statement within a lambda expression */
365
378
  PM_CONTEXT_LAMBDA_RESCUE,
366
379
 
380
+ /** the predicate clause of a loop statement */
381
+ PM_CONTEXT_LOOP_PREDICATE,
382
+
367
383
  /** the top level context */
368
384
  PM_CONTEXT_MAIN,
369
385
 
@@ -379,6 +395,9 @@ typedef enum {
379
395
  /** a rescue statement within a module statement */
380
396
  PM_CONTEXT_MODULE_RESCUE,
381
397
 
398
+ /** a multiple target expression */
399
+ PM_CONTEXT_MULTI_TARGET,
400
+
382
401
  /** a parenthesized expression */
383
402
  PM_CONTEXT_PARENS,
384
403
 
@@ -505,9 +524,9 @@ typedef struct {
505
524
  /** The type of shareable constant value that can be set. */
506
525
  typedef uint8_t pm_shareable_constant_value_t;
507
526
  static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_NONE = 0x0;
508
- static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_LITERAL = 0x1;
509
- static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_EXPERIMENTAL_EVERYTHING = 0x2;
510
- static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_EXPERIMENTAL_COPY = 0x4;
527
+ static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_LITERAL = PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL;
528
+ static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_EXPERIMENTAL_EVERYTHING = PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING;
529
+ static const pm_shareable_constant_value_t PM_SCOPE_SHAREABLE_CONSTANT_EXPERIMENTAL_COPY = PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY;
511
530
 
512
531
  /**
513
532
  * This tracks an individual local variable in a certain lexical context, as
@@ -546,6 +565,17 @@ typedef struct pm_locals {
546
565
  pm_local_t *locals;
547
566
  } pm_locals_t;
548
567
 
568
+ /** The flags about scope parameters that can be set. */
569
+ typedef uint8_t pm_scope_parameters_t;
570
+ static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_NONE = 0x0;
571
+ static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_FORWARDING_POSITIONALS = 0x1;
572
+ static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_FORWARDING_KEYWORDS = 0x2;
573
+ static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_FORWARDING_BLOCK = 0x4;
574
+ static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_FORWARDING_ALL = 0x8;
575
+ static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_IMPLICIT_DISALLOWED = 0x10;
576
+ static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_NUMBERED_INNER = 0x20;
577
+ static const pm_scope_parameters_t PM_SCOPE_PARAMETERS_NUMBERED_FOUND = 0x40;
578
+
549
579
  /**
550
580
  * This struct represents a node in a linked list of scopes. Some scopes can see
551
581
  * into their parent scopes, while others cannot.
@@ -557,10 +587,19 @@ typedef struct pm_scope {
557
587
  /** The IDs of the locals in the given scope. */
558
588
  pm_locals_t locals;
559
589
 
590
+ /**
591
+ * This is a list of the implicit parameters contained within the block.
592
+ * These will be processed after the block is parsed to determine the kind
593
+ * of parameters node that should be used and to check if any errors need to
594
+ * be added.
595
+ */
596
+ pm_node_list_t implicit_parameters;
597
+
560
598
  /**
561
599
  * This is a bitfield that indicates the parameters that are being used in
562
- * this scope. It is a combination of the PM_SCOPE_PARAMS_* constants. There
563
- * are three different kinds of parameters that can be used in a scope:
600
+ * this scope. It is a combination of the PM_SCOPE_PARAMETERS_* constants.
601
+ * There are three different kinds of parameters that can be used in a
602
+ * scope:
564
603
  *
565
604
  * - Ordinary parameters (e.g., def foo(bar); end)
566
605
  * - Numbered parameters (e.g., def foo; _1; end)
@@ -575,15 +614,7 @@ typedef struct pm_scope {
575
614
  * - def foo(&); end
576
615
  * - def foo(...); end
577
616
  */
578
- uint8_t parameters;
579
-
580
- /**
581
- * An integer indicating the number of numbered parameters on this scope.
582
- * This is necessary to determine if child blocks are allowed to use
583
- * numbered parameters, and to pass information to consumers of the AST
584
- * about how many numbered parameters exist.
585
- */
586
- int8_t numbered_parameters;
617
+ pm_scope_parameters_t parameters;
587
618
 
588
619
  /**
589
620
  * The current state of constant shareability for this scope. This is
@@ -598,20 +629,6 @@ typedef struct pm_scope {
598
629
  bool closed;
599
630
  } pm_scope_t;
600
631
 
601
- static const uint8_t PM_SCOPE_PARAMETERS_NONE = 0x0;
602
- static const uint8_t PM_SCOPE_PARAMETERS_ORDINARY = 0x1;
603
- static const uint8_t PM_SCOPE_PARAMETERS_NUMBERED = 0x2;
604
- static const uint8_t PM_SCOPE_PARAMETERS_IT = 0x4;
605
- static const uint8_t PM_SCOPE_PARAMETERS_TYPE_MASK = 0x7;
606
-
607
- static const uint8_t PM_SCOPE_PARAMETERS_FORWARDING_POSITIONALS = 0x8;
608
- static const uint8_t PM_SCOPE_PARAMETERS_FORWARDING_KEYWORDS = 0x10;
609
- static const uint8_t PM_SCOPE_PARAMETERS_FORWARDING_BLOCK = 0x20;
610
- static const uint8_t PM_SCOPE_PARAMETERS_FORWARDING_ALL = 0x40;
611
-
612
- static const int8_t PM_SCOPE_NUMBERED_PARAMETERS_DISALLOWED = -1;
613
- static const int8_t PM_SCOPE_NUMBERED_PARAMETERS_NONE = 0;
614
-
615
632
  /**
616
633
  * A struct that represents a stack of boolean values.
617
634
  */
@@ -624,6 +641,13 @@ typedef uint32_t pm_state_stack_t;
624
641
  * it's considering.
625
642
  */
626
643
  struct pm_parser {
644
+ /**
645
+ * The next node identifier that will be assigned. This is a unique
646
+ * identifier used to track nodes such that the syntax tree can be dropped
647
+ * but the node can be found through another parse.
648
+ */
649
+ uint32_t node_id;
650
+
627
651
  /** The current state of the lexer. */
628
652
  pm_lex_state_t lex_state;
629
653
 
@@ -853,12 +877,27 @@ struct pm_parser {
853
877
  */
854
878
  bool parsing_eval;
855
879
 
880
+ /**
881
+ * Whether or not we are parsing a "partial" script, which is a script that
882
+ * will be evaluated in the context of another script, so we should not
883
+ * check jumps (next/break/etc.) for validity.
884
+ */
885
+ bool partial_script;
886
+
856
887
  /** Whether or not we're at the beginning of a command. */
857
888
  bool command_start;
858
889
 
859
890
  /** Whether or not we're currently recovering from a syntax error. */
860
891
  bool recovering;
861
892
 
893
+ /**
894
+ * This is very specialized behavior for when you want to parse in a context
895
+ * that does not respect encoding comments. Its main use case is translating
896
+ * into the whitequark/parser AST which re-encodes source files in UTF-8
897
+ * before they are parsed and ignores encoding comments.
898
+ */
899
+ bool encoding_locked;
900
+
862
901
  /**
863
902
  * Whether or not the encoding has been changed by a magic comment. We use
864
903
  * this to provide a fast path for the lexer instead of going through the
@@ -886,6 +925,12 @@ struct pm_parser {
886
925
  * characters.
887
926
  */
888
927
  bool current_regular_expression_ascii_only;
928
+
929
+ /**
930
+ * By default, Ruby always warns about mismatched indentation. This can be
931
+ * toggled with a magic comment.
932
+ */
933
+ bool warn_mismatched_indentation;
889
934
  };
890
935
 
891
936
  #endif
@@ -49,10 +49,15 @@ PRISM_EXPORTED_FUNCTION const char * pm_version(void);
49
49
  /**
50
50
  * Initialize a parser with the given start and end pointers.
51
51
  *
52
+ * The resulting parser must eventually be freed with `pm_parser_free()`.
53
+ *
52
54
  * @param parser The parser to initialize.
53
55
  * @param source The source to parse.
54
56
  * @param size The size of the source.
55
- * @param options The optional options to use when parsing.
57
+ * @param options The optional options to use when parsing. These options must
58
+ * live for the whole lifetime of this parser.
59
+ *
60
+ * \public \memberof pm_parser
56
61
  */
57
62
  PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm_options_t *options);
58
63
 
@@ -62,13 +67,20 @@ PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t *
62
67
  *
63
68
  * @param parser The parser to register the callback with.
64
69
  * @param callback The callback to register.
70
+ *
71
+ * \public \memberof pm_parser
65
72
  */
66
73
  PRISM_EXPORTED_FUNCTION void pm_parser_register_encoding_changed_callback(pm_parser_t *parser, pm_encoding_changed_callback_t callback);
67
74
 
68
75
  /**
69
76
  * Free any memory associated with the given parser.
70
77
  *
78
+ * This does not free the `pm_options_t` object that was used to initialize the
79
+ * parser.
80
+ *
71
81
  * @param parser The parser to free.
82
+ *
83
+ * \public \memberof pm_parser
72
84
  */
73
85
  PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser);
74
86
 
@@ -77,27 +89,39 @@ PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser);
77
89
  *
78
90
  * @param parser The parser to use.
79
91
  * @return The AST representing the source.
92
+ *
93
+ * \public \memberof pm_parser
80
94
  */
81
95
  PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse(pm_parser_t *parser);
82
96
 
83
97
  /**
84
- * This function is used in pm_parse_stream to retrieve a line of input from a
98
+ * This function is used in pm_parse_stream() to retrieve a line of input from a
85
99
  * stream. It closely mirrors that of fgets so that fgets can be used as the
86
100
  * default implementation.
87
101
  */
88
102
  typedef char * (pm_parse_stream_fgets_t)(char *string, int size, void *stream);
89
103
 
104
+ /**
105
+ * This function is used in pm_parse_stream to check whether a stream is EOF.
106
+ * It closely mirrors that of feof so that feof can be used as the
107
+ * default implementation.
108
+ */
109
+ typedef int (pm_parse_stream_feof_t)(void *stream);
110
+
90
111
  /**
91
112
  * Parse a stream of Ruby source and return the tree.
92
113
  *
93
114
  * @param parser The parser to use.
94
115
  * @param buffer The buffer to use.
95
116
  * @param stream The stream to parse.
96
- * @param fgets The function to use to read from the stream.
117
+ * @param stream_fgets The function to use to read from the stream.
118
+ * @param stream_feof The function to use to determine if the stream has hit eof.
97
119
  * @param options The optional options to use when parsing.
98
120
  * @return The AST representing the source.
121
+ *
122
+ * \public \memberof pm_parser
99
123
  */
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 *fgets, const pm_options_t *options);
124
+ 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, pm_parse_stream_feof_t *stream_feof, const pm_options_t *options);
101
125
 
102
126
  // We optionally support serializing to a binary string. For systems that don't
103
127
  // want or need this functionality, it can be turned off with the
@@ -110,10 +134,11 @@ PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buff
110
134
  *
111
135
  * @param buffer The buffer to serialize to.
112
136
  * @param stream The stream to parse.
113
- * @param fgets The function to use to read from the stream.
137
+ * @param stream_fgets The function to use to read from the stream.
138
+ * @param stream_feof The function to use to tell if the stream has hit eof.
114
139
  * @param data The optional data to pass to the parser.
115
140
  */
116
- PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *fgets, const char *data);
141
+ PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof, const char *data);
117
142
 
118
143
  /**
119
144
  * Serialize the given list of comments to the given buffer.
@@ -234,6 +259,53 @@ PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t
234
259
 
235
260
  #endif
236
261
 
262
+ /**
263
+ * Represents the results of a slice query.
264
+ */
265
+ typedef enum {
266
+ /** Returned if the encoding given to a slice query was invalid. */
267
+ PM_STRING_QUERY_ERROR = -1,
268
+
269
+ /** Returned if the result of the slice query is false. */
270
+ PM_STRING_QUERY_FALSE,
271
+
272
+ /** Returned if the result of the slice query is true. */
273
+ PM_STRING_QUERY_TRUE
274
+ } pm_string_query_t;
275
+
276
+ /**
277
+ * Check that the slice is a valid local variable name.
278
+ *
279
+ * @param source The source to check.
280
+ * @param length The length of the source.
281
+ * @param encoding_name The name of the encoding of the source.
282
+ * @return PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
283
+ * the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
284
+ */
285
+ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_local(const uint8_t *source, size_t length, const char *encoding_name);
286
+
287
+ /**
288
+ * Check that the slice is a valid constant name.
289
+ *
290
+ * @param source The source to check.
291
+ * @param length The length of the source.
292
+ * @param encoding_name The name of the encoding of the source.
293
+ * @return PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
294
+ * the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
295
+ */
296
+ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_constant(const uint8_t *source, size_t length, const char *encoding_name);
297
+
298
+ /**
299
+ * Check that the slice is a valid method name.
300
+ *
301
+ * @param source The source to check.
302
+ * @param length The length of the source.
303
+ * @param encoding_name The name of the encoding of the source.
304
+ * @return PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
305
+ * the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
306
+ */
307
+ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint8_t *source, size_t length, const char *encoding_name);
308
+
237
309
  /**
238
310
  * @mainpage
239
311
  *
@@ -260,10 +332,10 @@ PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t
260
332
  * to want to use and be aware of are:
261
333
  *
262
334
  * * `pm_parser_t` - the main parser structure
263
- * * `pm_parser_init` - initialize a parser
264
- * * `pm_parse` - parse and return the root node
265
- * * `pm_node_destroy` - deallocate the root node returned by `pm_parse`
266
- * * `pm_parser_free` - free the internal memory of the parser
335
+ * * `pm_parser_init()` - initialize a parser
336
+ * * `pm_parse()` - parse and return the root node
337
+ * * `pm_node_destroy()` - deallocate the root node returned by `pm_parse()`
338
+ * * `pm_parser_free()` - free the internal memory of the parser
267
339
  *
268
340
  * Putting all of this together would look something like:
269
341
  *
@@ -280,8 +352,8 @@ PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t
280
352
  * }
281
353
  * ```
282
354
  *
283
- * All of the nodes "inherit" from `pm_node_t` by embedding those structures as
284
- * their first member. This means you can downcast and upcast any node in the
355
+ * All of the nodes "inherit" from `pm_node_t` by embedding those structures
356
+ * as their first member. This means you can downcast and upcast any node in the
285
357
  * tree to a `pm_node_t`.
286
358
  *
287
359
  * @section serializing Serializing
@@ -293,9 +365,9 @@ PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t
293
365
  * use and be aware of are:
294
366
  *
295
367
  * * `pm_buffer_t` - a small buffer object that will hold the serialized AST
296
- * * `pm_buffer_free` - free the memory associated with the buffer
297
- * * `pm_serialize` - serialize the AST into a buffer
298
- * * `pm_serialize_parse` - parse and serialize the AST into a buffer
368
+ * * `pm_buffer_free()` - free the memory associated with the buffer
369
+ * * `pm_serialize()` - serialize the AST into a buffer
370
+ * * `pm_serialize_parse()` - parse and serialize the AST into a buffer
299
371
  *
300
372
  * Putting all of this together would look something like:
301
373
  *
@@ -313,7 +385,7 @@ PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t
313
385
  * @section inspecting Inspecting
314
386
  *
315
387
  * Prism provides the ability to inspect the AST by pretty-printing nodes. You
316
- * can do this with the `pm_prettyprint` function, which you would use like:
388
+ * can do this with the `pm_prettyprint()` function, which you would use like:
317
389
  *
318
390
  * ```c
319
391
  * void prettyprint(const uint8_t *source, size_t length) {
@@ -0,0 +1,43 @@
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 by pm_regexp_parse() 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 by pm_regexp_parse() 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
@@ -95,9 +95,10 @@ typedef struct {
95
95
  * @param start_line The line number that the parser starts on.
96
96
  * @param literals The set of static literals to add the node to.
97
97
  * @param node The node to add to the set.
98
+ * @param replace Whether to replace the previous node if one already exists.
98
99
  * @return A pointer to the node that is being overwritten, if there is one.
99
100
  */
100
- pm_node_t * pm_static_literals_add(const pm_newline_list_t *newline_list, int32_t start_line, pm_static_literals_t *literals, pm_node_t *node);
101
+ pm_node_t * pm_static_literals_add(const pm_newline_list_t *newline_list, int32_t start_line, pm_static_literals_t *literals, pm_node_t *node, bool replace);
101
102
 
102
103
  /**
103
104
  * Free the internal memory associated with the given static literals set.
@@ -115,6 +116,6 @@ void pm_static_literals_free(pm_static_literals_t *literals);
115
116
  * @param encoding_name The name of the encoding of the source being parsed.
116
117
  * @param node The node to create a string representation of.
117
118
  */
118
- PRISM_EXPORTED_FUNCTION void pm_static_literal_inspect(pm_buffer_t *buffer, const pm_newline_list_t *newline_list, int32_t start_line, const char *encoding_name, const pm_node_t *node);
119
+ void pm_static_literal_inspect(pm_buffer_t *buffer, const pm_newline_list_t *newline_list, int32_t start_line, const char *encoding_name, const pm_node_t *node);
119
120
 
120
121
  #endif
@@ -51,6 +51,8 @@ bool pm_buffer_init_capacity(pm_buffer_t *buffer, size_t capacity);
51
51
  *
52
52
  * @param buffer The buffer to initialize.
53
53
  * @returns True if the buffer was initialized successfully, false otherwise.
54
+ *
55
+ * \public \memberof pm_buffer_t
54
56
  */
55
57
  PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer);
56
58
 
@@ -59,6 +61,8 @@ PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer);
59
61
  *
60
62
  * @param buffer The buffer to get the value of.
61
63
  * @returns The value of the buffer.
64
+ *
65
+ * \public \memberof pm_buffer_t
62
66
  */
63
67
  PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer);
64
68
 
@@ -67,6 +71,8 @@ PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer);
67
71
  *
68
72
  * @param buffer The buffer to get the length of.
69
73
  * @returns The length of the buffer.
74
+ *
75
+ * \public \memberof pm_buffer_t
70
76
  */
71
77
  PRISM_EXPORTED_FUNCTION size_t pm_buffer_length(const pm_buffer_t *buffer);
72
78
 
@@ -137,6 +143,16 @@ void pm_buffer_append_varsint(pm_buffer_t *buffer, int32_t value);
137
143
  */
138
144
  void pm_buffer_append_double(pm_buffer_t *buffer, double value);
139
145
 
146
+ /**
147
+ * Append a unicode codepoint to the buffer.
148
+ *
149
+ * @param buffer The buffer to append to.
150
+ * @param value The character to append.
151
+ * @returns True if the codepoint was valid and appended successfully, false
152
+ * otherwise.
153
+ */
154
+ bool pm_buffer_append_unicode_codepoint(pm_buffer_t *buffer, uint32_t value);
155
+
140
156
  /**
141
157
  * The different types of escaping that can be performed by the buffer when
142
158
  * appending a slice of Ruby source code.
@@ -212,6 +228,8 @@ void pm_buffer_insert(pm_buffer_t *buffer, size_t index, const char *value, size
212
228
  * Free the memory associated with the buffer.
213
229
  *
214
230
  * @param buffer The buffer to free.
231
+ *
232
+ * \public \memberof pm_buffer_t
215
233
  */
216
234
  PRISM_EXPORTED_FUNCTION void pm_buffer_free(pm_buffer_t *buffer);
217
235
 
@@ -34,8 +34,7 @@ size_t pm_strspn_whitespace(const uint8_t *string, ptrdiff_t length);
34
34
  * @return The number of characters at the start of the string that are
35
35
  * whitespace.
36
36
  */
37
- size_t
38
- pm_strspn_whitespace_newlines(const uint8_t *string, ptrdiff_t length, pm_newline_list_t *newline_list);
37
+ size_t pm_strspn_whitespace_newlines(const uint8_t *string, ptrdiff_t length, pm_newline_list_t *newline_list);
39
38
 
40
39
  /**
41
40
  * Returns the number of characters at the start of the string that are inline
@@ -87,14 +87,6 @@ void pm_constant_id_list_insert(pm_constant_id_list_t *list, size_t index, pm_co
87
87
  */
88
88
  bool pm_constant_id_list_includes(pm_constant_id_list_t *list, pm_constant_id_t id);
89
89
 
90
- /**
91
- * Get the memory size of a list of constant ids.
92
- *
93
- * @param list The list to get the memory size of.
94
- * @return The memory size of the list.
95
- */
96
- size_t pm_constant_id_list_memsize(pm_constant_id_list_t *list);
97
-
98
90
  /**
99
91
  * Free the memory associated with a list of constant ids.
100
92
  *
@@ -18,12 +18,6 @@
18
18
  * A structure represents an arbitrary-sized integer.
19
19
  */
20
20
  typedef struct {
21
- /**
22
- * Embedded value for small integer. This value is set to 0 if the value
23
- * does not fit into uint32_t.
24
- */
25
- uint32_t value;
26
-
27
21
  /**
28
22
  * The number of allocated values. length is set to 0 if the integer fits
29
23
  * into uint32_t.
@@ -35,6 +29,12 @@ typedef struct {
35
29
  */
36
30
  uint32_t *values;
37
31
 
32
+ /**
33
+ * Embedded value for small integer. This value is set to 0 if the value
34
+ * does not fit into uint32_t.
35
+ */
36
+ uint32_t value;
37
+
38
38
  /**
39
39
  * Whether or not the integer is negative. It is stored this way so that a
40
40
  * zeroed pm_integer_t is always positive zero.
@@ -48,6 +48,9 @@ typedef struct {
48
48
  * from the string itself.
49
49
  */
50
50
  typedef enum {
51
+ /** The default decimal base, with no prefix. Leading 0s will be ignored. */
52
+ PM_INTEGER_BASE_DEFAULT,
53
+
51
54
  /** The binary base, indicated by a 0b or 0B prefix. */
52
55
  PM_INTEGER_BASE_BINARY,
53
56
 
@@ -79,15 +82,7 @@ typedef enum {
79
82
  * @param start The start of the string.
80
83
  * @param end The end of the string.
81
84
  */
82
- PRISM_EXPORTED_FUNCTION void pm_integer_parse(pm_integer_t *integer, pm_integer_base_t base, const uint8_t *start, const uint8_t *end);
83
-
84
- /**
85
- * Return the memory size of the integer.
86
- *
87
- * @param integer The integer to get the memory size of.
88
- * @return The size of the memory associated with the integer.
89
- */
90
- size_t pm_integer_memsize(const pm_integer_t *integer);
85
+ void pm_integer_parse(pm_integer_t *integer, pm_integer_base_t base, const uint8_t *start, const uint8_t *end);
91
86
 
92
87
  /**
93
88
  * Compare two integers. This function returns -1 if the left integer is less
@@ -100,11 +95,25 @@ size_t pm_integer_memsize(const pm_integer_t *integer);
100
95
  */
101
96
  int pm_integer_compare(const pm_integer_t *left, const pm_integer_t *right);
102
97
 
98
+ /**
99
+ * Reduce a ratio of integers to its simplest form.
100
+ *
101
+ * If either the numerator or denominator do not fit into a 32-bit integer, then
102
+ * this function is a no-op. In the future, we may consider reducing even the
103
+ * larger numbers, but for now we're going to keep it simple.
104
+ *
105
+ * @param numerator The numerator of the ratio.
106
+ * @param denominator The denominator of the ratio.
107
+ */
108
+ void pm_integers_reduce(pm_integer_t *numerator, pm_integer_t *denominator);
109
+
103
110
  /**
104
111
  * Convert an integer to a decimal string.
105
112
  *
106
113
  * @param buffer The buffer to append the string to.
107
114
  * @param integer The integer to convert to a string.
115
+ *
116
+ * \public \memberof pm_integer_t
108
117
  */
109
118
  PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_integer_t *integer);
110
119
 
@@ -113,6 +122,8 @@ PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_int
113
122
  * the integer exceeds the size of a single node in the linked list.
114
123
  *
115
124
  * @param integer The integer to free.
125
+ *
126
+ * \public \memberof pm_integer_t
116
127
  */
117
128
  PRISM_EXPORTED_FUNCTION void pm_integer_free(pm_integer_t *integer);
118
129
 
@@ -68,6 +68,8 @@ typedef struct {
68
68
  *
69
69
  * @param list The list to check.
70
70
  * @return True if the given list is empty, otherwise false.
71
+ *
72
+ * \public \memberof pm_list_t
71
73
  */
72
74
  PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list);
73
75
 
@@ -76,6 +78,8 @@ PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list);
76
78
  *
77
79
  * @param list The list to check.
78
80
  * @return The size of the list.
81
+ *
82
+ * \public \memberof pm_list_t
79
83
  */
80
84
  PRISM_EXPORTED_FUNCTION size_t pm_list_size(pm_list_t *list);
81
85
 
@@ -91,6 +95,8 @@ void pm_list_append(pm_list_t *list, pm_list_node_t *node);
91
95
  * Deallocate the internal state of the given list.
92
96
  *
93
97
  * @param list The list to free.
98
+ *
99
+ * \public \memberof pm_list_t
94
100
  */
95
101
  PRISM_EXPORTED_FUNCTION void pm_list_free(pm_list_t *list);
96
102