datadog-ruby_core_source 3.4.3 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/extension.h +1 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/options.h +4 -1
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/version.h +2 -2
- data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/vm_core.h +9 -0
- data/lib/datadog/ruby_core_source/version.rb +1 -1
- metadata +108 -211
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/id.h +0 -352
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/id_table.h +0 -39
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/array.h +0 -152
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/basic_operators.h +0 -65
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/bignum.h +0 -244
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/bits.h +0 -650
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/class.h +0 -283
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/cmdlineopt.h +0 -61
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/cont.h +0 -35
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/encoding.h +0 -38
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/error.h +0 -244
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/eval.h +0 -33
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/gc.h +0 -333
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/hash.h +0 -193
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/imemo.h +0 -257
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/inits.h +0 -47
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/io.h +0 -143
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/load.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/numeric.h +0 -274
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/object.h +0 -63
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/re.h +0 -28
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/sanitizers.h +0 -330
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/signal.h +0 -24
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/st.h +0 -11
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/string.h +0 -199
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/struct.h +0 -119
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/symbol.h +0 -47
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/thread.h +0 -108
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/time.h +0 -37
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/variable.h +0 -70
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/vm.h +0 -137
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal.h +0 -108
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/iseq.h +0 -351
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/method.h +0 -258
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/ast.h +0 -7964
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/diagnostic.h +0 -451
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/options.h +0 -442
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/parser.h +0 -933
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/prism.h +0 -383
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/regexp.h +0 -43
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/util/pm_buffer.h +0 -228
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/util/pm_integer.h +0 -126
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/util/pm_list.h +0 -97
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/util/pm_string.h +0 -190
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism/version.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/prism_compile.h +0 -105
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/ractor_core.h +0 -382
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/ruby_atomic.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/rubyparser.h +0 -1380
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/shape.h +0 -234
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/thread_pthread.h +0 -167
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/vm_core.h +0 -2235
- data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/vm_debug.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/build_assert/build_assert.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/check_type/check_type.h +0 -63
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/container_of/container_of.h +0 -142
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/list/list.h +0 -791
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ccan/str/str.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/compar.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/compile.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/compilers.h +0 -107
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/complex.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/dir.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/enc.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/enum.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/enumerator.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/file.h +0 -38
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/fixnum.h +0 -185
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/loadpath.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/math.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/missing.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/parse.h +0 -131
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/proc.h +0 -30
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/process.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/ractor.h +0 -10
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/random.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/range.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/rational.h +0 -71
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/ruby_parser.h +0 -102
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/serial.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/static_assert.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/transcode.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/util.h +0 -27
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/internal/warnings.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/node.h +0 -122
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/parser_st.h +0 -162
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/parser_value.h +0 -106
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/defines.h +0 -260
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/encoding.h +0 -283
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/extension.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/node.h +0 -129
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/pack.h +0 -163
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/prettyprint.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/static_literals.h +0 -121
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_char.h +0 -204
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_constant_pool.h +0 -218
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_memchr.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_newline_list.h +0 -113
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_strncasecmp.h +0 -32
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/prism/util/pm_strpbrk.h +0 -46
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/ruby_assert.h +0 -14
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/thread_none.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview3/vm_opts.h +0 -67
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/check_type/check_type.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/container_of/container_of.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/list/list.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/str/str.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/id.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/id_table.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/array.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/basic_operators.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/bignum.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/bits.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/box.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/class.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/cmdlineopt.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compar.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compile.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compilers.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/complex.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/concurrent_set.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/cont.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/dir.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enc.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/encoding.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enum.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enumerator.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/error.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/eval.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/file.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/fixnum.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/gc.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/hash.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/imemo.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/inits.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/io.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/load.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/loadpath.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/math.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/missing.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/numeric.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/object.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/parse.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/proc.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/process.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ractor.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/random.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/range.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/rational.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/re.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ruby_parser.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/sanitizers.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/serial.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/set_table.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/signal.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/st.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/static_assert.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/string.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/struct.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/symbol.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/thread.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/time.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/transcode.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/util.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/variable.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal/vm.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/warnings.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/internal.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/iseq.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/method.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/node.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_st.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_value.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/ast.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/defines.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/diagnostic.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/encoding.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/node.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/pack.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/parser.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/prettyprint.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/prism.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/regexp.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/static_literals.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/util/pm_buffer.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_char.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_constant_pool.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/util/pm_integer.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/util/pm_list.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_memchr.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_newline_list.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism/util/pm_string.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strncasecmp.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strpbrk.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/prism_compile.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/ractor_core.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ruby_assert.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/ruby_atomic.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/rubyparser.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/shape.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/thread_none.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/thread_pthread.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-4.0.0-preview3 → ruby-4.0.0-p0}/vm_debug.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/vm_opts.h +0 -0
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file static_literals.h
|
|
3
|
-
*
|
|
4
|
-
* A set of static literal nodes that can be checked for duplicates.
|
|
5
|
-
*/
|
|
6
|
-
#ifndef PRISM_STATIC_LITERALS_H
|
|
7
|
-
#define PRISM_STATIC_LITERALS_H
|
|
8
|
-
|
|
9
|
-
#include "prism/defines.h"
|
|
10
|
-
#include "prism/ast.h"
|
|
11
|
-
#include "prism/util/pm_newline_list.h"
|
|
12
|
-
|
|
13
|
-
#include <assert.h>
|
|
14
|
-
#include <stdbool.h>
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* An internal hash table for a set of nodes.
|
|
18
|
-
*/
|
|
19
|
-
typedef struct {
|
|
20
|
-
/** The array of nodes in the hash table. */
|
|
21
|
-
pm_node_t **nodes;
|
|
22
|
-
|
|
23
|
-
/** The size of the hash table. */
|
|
24
|
-
uint32_t size;
|
|
25
|
-
|
|
26
|
-
/** The space that has been allocated in the hash table. */
|
|
27
|
-
uint32_t capacity;
|
|
28
|
-
} pm_node_hash_t;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Certain sets of nodes (hash keys and when clauses) check for duplicate nodes
|
|
32
|
-
* to alert the user of potential issues. To do this, we keep a set of the nodes
|
|
33
|
-
* that have been seen so far, and compare whenever we find a new node.
|
|
34
|
-
*
|
|
35
|
-
* We bucket the nodes based on their type to minimize the number of comparisons
|
|
36
|
-
* that need to be performed.
|
|
37
|
-
*/
|
|
38
|
-
typedef struct {
|
|
39
|
-
/**
|
|
40
|
-
* This is the set of IntegerNode and SourceLineNode instances.
|
|
41
|
-
*/
|
|
42
|
-
pm_node_hash_t integer_nodes;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* This is the set of FloatNode instances.
|
|
46
|
-
*/
|
|
47
|
-
pm_node_hash_t float_nodes;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* This is the set of RationalNode and ImaginaryNode instances.
|
|
51
|
-
*/
|
|
52
|
-
pm_node_hash_t number_nodes;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* This is the set of StringNode and SourceFileNode instances.
|
|
56
|
-
*/
|
|
57
|
-
pm_node_hash_t string_nodes;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* This is the set of RegularExpressionNode instances.
|
|
61
|
-
*/
|
|
62
|
-
pm_node_hash_t regexp_nodes;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* This is the set of SymbolNode instances.
|
|
66
|
-
*/
|
|
67
|
-
pm_node_hash_t symbol_nodes;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* A pointer to the last TrueNode instance that was inserted, or NULL.
|
|
71
|
-
*/
|
|
72
|
-
pm_node_t *true_node;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* A pointer to the last FalseNode instance that was inserted, or NULL.
|
|
76
|
-
*/
|
|
77
|
-
pm_node_t *false_node;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* A pointer to the last NilNode instance that was inserted, or NULL.
|
|
81
|
-
*/
|
|
82
|
-
pm_node_t *nil_node;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* A pointer to the last SourceEncodingNode instance that was inserted, or
|
|
86
|
-
* NULL.
|
|
87
|
-
*/
|
|
88
|
-
pm_node_t *source_encoding_node;
|
|
89
|
-
} pm_static_literals_t;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Add a node to the set of static literals.
|
|
93
|
-
*
|
|
94
|
-
* @param newline_list The list of newline offsets to use to calculate lines.
|
|
95
|
-
* @param start_line The line number that the parser starts on.
|
|
96
|
-
* @param literals The set of static literals to add the node to.
|
|
97
|
-
* @param node The node to add to the set.
|
|
98
|
-
* @param replace Whether to replace the previous node if one already exists.
|
|
99
|
-
* @return A pointer to the node that is being overwritten, if there is one.
|
|
100
|
-
*/
|
|
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);
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Free the internal memory associated with the given static literals set.
|
|
105
|
-
*
|
|
106
|
-
* @param literals The set of static literals to free.
|
|
107
|
-
*/
|
|
108
|
-
void pm_static_literals_free(pm_static_literals_t *literals);
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Create a string-based representation of the given static literal.
|
|
112
|
-
*
|
|
113
|
-
* @param buffer The buffer to write the string to.
|
|
114
|
-
* @param newline_list The list of newline offsets to use to calculate lines.
|
|
115
|
-
* @param start_line The line number that the parser starts on.
|
|
116
|
-
* @param encoding_name The name of the encoding of the source being parsed.
|
|
117
|
-
* @param node The node to create a string representation of.
|
|
118
|
-
*/
|
|
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);
|
|
120
|
-
|
|
121
|
-
#endif
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file pm_char.h
|
|
3
|
-
*
|
|
4
|
-
* Functions for working with characters and strings.
|
|
5
|
-
*/
|
|
6
|
-
#ifndef PRISM_CHAR_H
|
|
7
|
-
#define PRISM_CHAR_H
|
|
8
|
-
|
|
9
|
-
#include "prism/defines.h"
|
|
10
|
-
#include "prism/util/pm_newline_list.h"
|
|
11
|
-
|
|
12
|
-
#include <stdbool.h>
|
|
13
|
-
#include <stddef.h>
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Returns the number of characters at the start of the string that are
|
|
17
|
-
* whitespace. Disallows searching past the given maximum number of characters.
|
|
18
|
-
*
|
|
19
|
-
* @param string The string to search.
|
|
20
|
-
* @param length The maximum number of characters to search.
|
|
21
|
-
* @return The number of characters at the start of the string that are
|
|
22
|
-
* whitespace.
|
|
23
|
-
*/
|
|
24
|
-
size_t pm_strspn_whitespace(const uint8_t *string, ptrdiff_t length);
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Returns the number of characters at the start of the string that are
|
|
28
|
-
* whitespace while also tracking the location of each newline. Disallows
|
|
29
|
-
* searching past the given maximum number of characters.
|
|
30
|
-
*
|
|
31
|
-
* @param string The string to search.
|
|
32
|
-
* @param length The maximum number of characters to search.
|
|
33
|
-
* @param newline_list The list of newlines to populate.
|
|
34
|
-
* @return The number of characters at the start of the string that are
|
|
35
|
-
* whitespace.
|
|
36
|
-
*/
|
|
37
|
-
size_t pm_strspn_whitespace_newlines(const uint8_t *string, ptrdiff_t length, pm_newline_list_t *newline_list);
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Returns the number of characters at the start of the string that are inline
|
|
41
|
-
* whitespace. Disallows searching past the given maximum number of characters.
|
|
42
|
-
*
|
|
43
|
-
* @param string The string to search.
|
|
44
|
-
* @param length The maximum number of characters to search.
|
|
45
|
-
* @return The number of characters at the start of the string that are inline
|
|
46
|
-
* whitespace.
|
|
47
|
-
*/
|
|
48
|
-
size_t pm_strspn_inline_whitespace(const uint8_t *string, ptrdiff_t length);
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Returns the number of characters at the start of the string that are decimal
|
|
52
|
-
* digits. Disallows searching past the given maximum number of characters.
|
|
53
|
-
*
|
|
54
|
-
* @param string The string to search.
|
|
55
|
-
* @param length The maximum number of characters to search.
|
|
56
|
-
* @return The number of characters at the start of the string that are decimal
|
|
57
|
-
* digits.
|
|
58
|
-
*/
|
|
59
|
-
size_t pm_strspn_decimal_digit(const uint8_t *string, ptrdiff_t length);
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Returns the number of characters at the start of the string that are
|
|
63
|
-
* hexadecimal digits. Disallows searching past the given maximum number of
|
|
64
|
-
* characters.
|
|
65
|
-
*
|
|
66
|
-
* @param string The string to search.
|
|
67
|
-
* @param length The maximum number of characters to search.
|
|
68
|
-
* @return The number of characters at the start of the string that are
|
|
69
|
-
* hexadecimal digits.
|
|
70
|
-
*/
|
|
71
|
-
size_t pm_strspn_hexadecimal_digit(const uint8_t *string, ptrdiff_t length);
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Returns the number of characters at the start of the string that are octal
|
|
75
|
-
* digits or underscores. Disallows searching past the given maximum number of
|
|
76
|
-
* characters.
|
|
77
|
-
*
|
|
78
|
-
* If multiple underscores are found in a row or if an underscore is
|
|
79
|
-
* found at the end of the number, then the invalid pointer is set to the index
|
|
80
|
-
* of the first invalid underscore.
|
|
81
|
-
*
|
|
82
|
-
* @param string The string to search.
|
|
83
|
-
* @param length The maximum number of characters to search.
|
|
84
|
-
* @param invalid The pointer to set to the index of the first invalid
|
|
85
|
-
* underscore.
|
|
86
|
-
* @return The number of characters at the start of the string that are octal
|
|
87
|
-
* digits or underscores.
|
|
88
|
-
*/
|
|
89
|
-
size_t pm_strspn_octal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid);
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Returns the number of characters at the start of the string that are decimal
|
|
93
|
-
* digits or underscores. Disallows searching past the given maximum number of
|
|
94
|
-
* characters.
|
|
95
|
-
*
|
|
96
|
-
* If multiple underscores are found in a row or if an underscore is
|
|
97
|
-
* found at the end of the number, then the invalid pointer is set to the index
|
|
98
|
-
* of the first invalid underscore.
|
|
99
|
-
*
|
|
100
|
-
* @param string The string to search.
|
|
101
|
-
* @param length The maximum number of characters to search.
|
|
102
|
-
* @param invalid The pointer to set to the index of the first invalid
|
|
103
|
-
* underscore.
|
|
104
|
-
* @return The number of characters at the start of the string that are decimal
|
|
105
|
-
* digits or underscores.
|
|
106
|
-
*/
|
|
107
|
-
size_t pm_strspn_decimal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid);
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Returns the number of characters at the start of the string that are
|
|
111
|
-
* hexadecimal digits or underscores. Disallows searching past the given maximum
|
|
112
|
-
* number of characters.
|
|
113
|
-
*
|
|
114
|
-
* If multiple underscores are found in a row or if an underscore is
|
|
115
|
-
* found at the end of the number, then the invalid pointer is set to the index
|
|
116
|
-
* of the first invalid underscore.
|
|
117
|
-
*
|
|
118
|
-
* @param string The string to search.
|
|
119
|
-
* @param length The maximum number of characters to search.
|
|
120
|
-
* @param invalid The pointer to set to the index of the first invalid
|
|
121
|
-
* underscore.
|
|
122
|
-
* @return The number of characters at the start of the string that are
|
|
123
|
-
* hexadecimal digits or underscores.
|
|
124
|
-
*/
|
|
125
|
-
size_t pm_strspn_hexadecimal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid);
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Returns the number of characters at the start of the string that are regexp
|
|
129
|
-
* options. Disallows searching past the given maximum number of characters.
|
|
130
|
-
*
|
|
131
|
-
* @param string The string to search.
|
|
132
|
-
* @param length The maximum number of characters to search.
|
|
133
|
-
* @return The number of characters at the start of the string that are regexp
|
|
134
|
-
* options.
|
|
135
|
-
*/
|
|
136
|
-
size_t pm_strspn_regexp_option(const uint8_t *string, ptrdiff_t length);
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Returns the number of characters at the start of the string that are binary
|
|
140
|
-
* digits or underscores. Disallows searching past the given maximum number of
|
|
141
|
-
* characters.
|
|
142
|
-
*
|
|
143
|
-
* If multiple underscores are found in a row or if an underscore is
|
|
144
|
-
* found at the end of the number, then the invalid pointer is set to the index
|
|
145
|
-
* of the first invalid underscore.
|
|
146
|
-
*
|
|
147
|
-
* @param string The string to search.
|
|
148
|
-
* @param length The maximum number of characters to search.
|
|
149
|
-
* @param invalid The pointer to set to the index of the first invalid
|
|
150
|
-
* underscore.
|
|
151
|
-
* @return The number of characters at the start of the string that are binary
|
|
152
|
-
* digits or underscores.
|
|
153
|
-
*/
|
|
154
|
-
size_t pm_strspn_binary_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid);
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Returns true if the given character is a whitespace character.
|
|
158
|
-
*
|
|
159
|
-
* @param b The character to check.
|
|
160
|
-
* @return True if the given character is a whitespace character.
|
|
161
|
-
*/
|
|
162
|
-
bool pm_char_is_whitespace(const uint8_t b);
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Returns true if the given character is an inline whitespace character.
|
|
166
|
-
*
|
|
167
|
-
* @param b The character to check.
|
|
168
|
-
* @return True if the given character is an inline whitespace character.
|
|
169
|
-
*/
|
|
170
|
-
bool pm_char_is_inline_whitespace(const uint8_t b);
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Returns true if the given character is a binary digit.
|
|
174
|
-
*
|
|
175
|
-
* @param b The character to check.
|
|
176
|
-
* @return True if the given character is a binary digit.
|
|
177
|
-
*/
|
|
178
|
-
bool pm_char_is_binary_digit(const uint8_t b);
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Returns true if the given character is an octal digit.
|
|
182
|
-
*
|
|
183
|
-
* @param b The character to check.
|
|
184
|
-
* @return True if the given character is an octal digit.
|
|
185
|
-
*/
|
|
186
|
-
bool pm_char_is_octal_digit(const uint8_t b);
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Returns true if the given character is a decimal digit.
|
|
190
|
-
*
|
|
191
|
-
* @param b The character to check.
|
|
192
|
-
* @return True if the given character is a decimal digit.
|
|
193
|
-
*/
|
|
194
|
-
bool pm_char_is_decimal_digit(const uint8_t b);
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Returns true if the given character is a hexadecimal digit.
|
|
198
|
-
*
|
|
199
|
-
* @param b The character to check.
|
|
200
|
-
* @return True if the given character is a hexadecimal digit.
|
|
201
|
-
*/
|
|
202
|
-
bool pm_char_is_hexadecimal_digit(const uint8_t b);
|
|
203
|
-
|
|
204
|
-
#endif
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file pm_constant_pool.h
|
|
3
|
-
*
|
|
4
|
-
* A data structure that stores a set of strings.
|
|
5
|
-
*
|
|
6
|
-
* Each string is assigned a unique id, which can be used to compare strings for
|
|
7
|
-
* equality. This comparison ends up being much faster than strcmp, since it
|
|
8
|
-
* only requires a single integer comparison.
|
|
9
|
-
*/
|
|
10
|
-
#ifndef PRISM_CONSTANT_POOL_H
|
|
11
|
-
#define PRISM_CONSTANT_POOL_H
|
|
12
|
-
|
|
13
|
-
#include "prism/defines.h"
|
|
14
|
-
|
|
15
|
-
#include <assert.h>
|
|
16
|
-
#include <stdbool.h>
|
|
17
|
-
#include <stdint.h>
|
|
18
|
-
#include <stdlib.h>
|
|
19
|
-
#include <string.h>
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* When we allocate constants into the pool, we reserve 0 to mean that the slot
|
|
23
|
-
* is not yet filled. This constant is reused in other places to indicate the
|
|
24
|
-
* lack of a constant id.
|
|
25
|
-
*/
|
|
26
|
-
#define PM_CONSTANT_ID_UNSET 0
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* A constant id is a unique identifier for a constant in the constant pool.
|
|
30
|
-
*/
|
|
31
|
-
typedef uint32_t pm_constant_id_t;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* A list of constant IDs. Usually used to represent a set of locals.
|
|
35
|
-
*/
|
|
36
|
-
typedef struct {
|
|
37
|
-
/** The number of constant ids in the list. */
|
|
38
|
-
size_t size;
|
|
39
|
-
|
|
40
|
-
/** The number of constant ids that have been allocated in the list. */
|
|
41
|
-
size_t capacity;
|
|
42
|
-
|
|
43
|
-
/** The constant ids in the list. */
|
|
44
|
-
pm_constant_id_t *ids;
|
|
45
|
-
} pm_constant_id_list_t;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Initialize a list of constant ids.
|
|
49
|
-
*
|
|
50
|
-
* @param list The list to initialize.
|
|
51
|
-
*/
|
|
52
|
-
void pm_constant_id_list_init(pm_constant_id_list_t *list);
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Initialize a list of constant ids with a given capacity.
|
|
56
|
-
*
|
|
57
|
-
* @param list The list to initialize.
|
|
58
|
-
* @param capacity The initial capacity of the list.
|
|
59
|
-
*/
|
|
60
|
-
void pm_constant_id_list_init_capacity(pm_constant_id_list_t *list, size_t capacity);
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Append a constant id to a list of constant ids. Returns false if any
|
|
64
|
-
* potential reallocations fail.
|
|
65
|
-
*
|
|
66
|
-
* @param list The list to append to.
|
|
67
|
-
* @param id The id to append.
|
|
68
|
-
* @return Whether the append succeeded.
|
|
69
|
-
*/
|
|
70
|
-
bool pm_constant_id_list_append(pm_constant_id_list_t *list, pm_constant_id_t id);
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Insert a constant id into a list of constant ids at the specified index.
|
|
74
|
-
*
|
|
75
|
-
* @param list The list to insert into.
|
|
76
|
-
* @param index The index at which to insert.
|
|
77
|
-
* @param id The id to insert.
|
|
78
|
-
*/
|
|
79
|
-
void pm_constant_id_list_insert(pm_constant_id_list_t *list, size_t index, pm_constant_id_t id);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Checks if the current constant id list includes the given constant id.
|
|
83
|
-
*
|
|
84
|
-
* @param list The list to check.
|
|
85
|
-
* @param id The id to check for.
|
|
86
|
-
* @return Whether the list includes the given id.
|
|
87
|
-
*/
|
|
88
|
-
bool pm_constant_id_list_includes(pm_constant_id_list_t *list, pm_constant_id_t id);
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Free the memory associated with a list of constant ids.
|
|
92
|
-
*
|
|
93
|
-
* @param list The list to free.
|
|
94
|
-
*/
|
|
95
|
-
void pm_constant_id_list_free(pm_constant_id_list_t *list);
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* The type of bucket in the constant pool hash map. This determines how the
|
|
99
|
-
* bucket should be freed.
|
|
100
|
-
*/
|
|
101
|
-
typedef unsigned int pm_constant_pool_bucket_type_t;
|
|
102
|
-
|
|
103
|
-
/** By default, each constant is a slice of the source. */
|
|
104
|
-
static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_DEFAULT = 0;
|
|
105
|
-
|
|
106
|
-
/** An owned constant is one for which memory has been allocated. */
|
|
107
|
-
static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_OWNED = 1;
|
|
108
|
-
|
|
109
|
-
/** A constant constant is known at compile time. */
|
|
110
|
-
static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_CONSTANT = 2;
|
|
111
|
-
|
|
112
|
-
/** A bucket in the hash map. */
|
|
113
|
-
typedef struct {
|
|
114
|
-
/** The incremental ID used for indexing back into the pool. */
|
|
115
|
-
unsigned int id: 30;
|
|
116
|
-
|
|
117
|
-
/** The type of the bucket, which determines how to free it. */
|
|
118
|
-
pm_constant_pool_bucket_type_t type: 2;
|
|
119
|
-
|
|
120
|
-
/** The hash of the bucket. */
|
|
121
|
-
uint32_t hash;
|
|
122
|
-
} pm_constant_pool_bucket_t;
|
|
123
|
-
|
|
124
|
-
/** A constant in the pool which effectively stores a string. */
|
|
125
|
-
typedef struct {
|
|
126
|
-
/** A pointer to the start of the string. */
|
|
127
|
-
const uint8_t *start;
|
|
128
|
-
|
|
129
|
-
/** The length of the string. */
|
|
130
|
-
size_t length;
|
|
131
|
-
} pm_constant_t;
|
|
132
|
-
|
|
133
|
-
/** The overall constant pool, which stores constants found while parsing. */
|
|
134
|
-
typedef struct {
|
|
135
|
-
/** The buckets in the hash map. */
|
|
136
|
-
pm_constant_pool_bucket_t *buckets;
|
|
137
|
-
|
|
138
|
-
/** The constants that are stored in the buckets. */
|
|
139
|
-
pm_constant_t *constants;
|
|
140
|
-
|
|
141
|
-
/** The number of buckets in the hash map. */
|
|
142
|
-
uint32_t size;
|
|
143
|
-
|
|
144
|
-
/** The number of buckets that have been allocated in the hash map. */
|
|
145
|
-
uint32_t capacity;
|
|
146
|
-
} pm_constant_pool_t;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Initialize a new constant pool with a given capacity.
|
|
150
|
-
*
|
|
151
|
-
* @param pool The pool to initialize.
|
|
152
|
-
* @param capacity The initial capacity of the pool.
|
|
153
|
-
* @return Whether the initialization succeeded.
|
|
154
|
-
*/
|
|
155
|
-
bool pm_constant_pool_init(pm_constant_pool_t *pool, uint32_t capacity);
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Return a pointer to the constant indicated by the given constant id.
|
|
159
|
-
*
|
|
160
|
-
* @param pool The pool to get the constant from.
|
|
161
|
-
* @param constant_id The id of the constant to get.
|
|
162
|
-
* @return A pointer to the constant.
|
|
163
|
-
*/
|
|
164
|
-
pm_constant_t * pm_constant_pool_id_to_constant(const pm_constant_pool_t *pool, pm_constant_id_t constant_id);
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Find a constant in a constant pool. Returns the id of the constant, or 0 if
|
|
168
|
-
* the constant is not found.
|
|
169
|
-
*
|
|
170
|
-
* @param pool The pool to find the constant in.
|
|
171
|
-
* @param start A pointer to the start of the constant.
|
|
172
|
-
* @param length The length of the constant.
|
|
173
|
-
* @return The id of the constant.
|
|
174
|
-
*/
|
|
175
|
-
pm_constant_id_t pm_constant_pool_find(const pm_constant_pool_t *pool, const uint8_t *start, size_t length);
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Insert a constant into a constant pool that is a slice of a source string.
|
|
179
|
-
* Returns the id of the constant, or 0 if any potential calls to resize fail.
|
|
180
|
-
*
|
|
181
|
-
* @param pool The pool to insert the constant into.
|
|
182
|
-
* @param start A pointer to the start of the constant.
|
|
183
|
-
* @param length The length of the constant.
|
|
184
|
-
* @return The id of the constant.
|
|
185
|
-
*/
|
|
186
|
-
pm_constant_id_t pm_constant_pool_insert_shared(pm_constant_pool_t *pool, const uint8_t *start, size_t length);
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Insert a constant into a constant pool from memory that is now owned by the
|
|
190
|
-
* constant pool. Returns the id of the constant, or 0 if any potential calls to
|
|
191
|
-
* resize fail.
|
|
192
|
-
*
|
|
193
|
-
* @param pool The pool to insert the constant into.
|
|
194
|
-
* @param start A pointer to the start of the constant.
|
|
195
|
-
* @param length The length of the constant.
|
|
196
|
-
* @return The id of the constant.
|
|
197
|
-
*/
|
|
198
|
-
pm_constant_id_t pm_constant_pool_insert_owned(pm_constant_pool_t *pool, uint8_t *start, size_t length);
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Insert a constant into a constant pool from memory that is constant. Returns
|
|
202
|
-
* the id of the constant, or 0 if any potential calls to resize fail.
|
|
203
|
-
*
|
|
204
|
-
* @param pool The pool to insert the constant into.
|
|
205
|
-
* @param start A pointer to the start of the constant.
|
|
206
|
-
* @param length The length of the constant.
|
|
207
|
-
* @return The id of the constant.
|
|
208
|
-
*/
|
|
209
|
-
pm_constant_id_t pm_constant_pool_insert_constant(pm_constant_pool_t *pool, const uint8_t *start, size_t length);
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Free the memory associated with a constant pool.
|
|
213
|
-
*
|
|
214
|
-
* @param pool The pool to free.
|
|
215
|
-
*/
|
|
216
|
-
void pm_constant_pool_free(pm_constant_pool_t *pool);
|
|
217
|
-
|
|
218
|
-
#endif
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file pm_memchr.h
|
|
3
|
-
*
|
|
4
|
-
* A custom memchr implementation.
|
|
5
|
-
*/
|
|
6
|
-
#ifndef PRISM_MEMCHR_H
|
|
7
|
-
#define PRISM_MEMCHR_H
|
|
8
|
-
|
|
9
|
-
#include "prism/defines.h"
|
|
10
|
-
#include "prism/encoding.h"
|
|
11
|
-
|
|
12
|
-
#include <stddef.h>
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* We need to roll our own memchr to handle cases where the encoding changes and
|
|
16
|
-
* we need to search for a character in a buffer that could be the trailing byte
|
|
17
|
-
* of a multibyte character.
|
|
18
|
-
*
|
|
19
|
-
* @param source The source string.
|
|
20
|
-
* @param character The character to search for.
|
|
21
|
-
* @param number The maximum number of bytes to search.
|
|
22
|
-
* @param encoding_changed Whether the encoding changed.
|
|
23
|
-
* @param encoding A pointer to the encoding.
|
|
24
|
-
* @return A pointer to the first occurrence of the character in the source
|
|
25
|
-
* string, or NULL if no such character exists.
|
|
26
|
-
*/
|
|
27
|
-
void * pm_memchr(const void *source, int character, size_t number, bool encoding_changed, const pm_encoding_t *encoding);
|
|
28
|
-
|
|
29
|
-
#endif
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file pm_newline_list.h
|
|
3
|
-
*
|
|
4
|
-
* A list of byte offsets of newlines in a string.
|
|
5
|
-
*
|
|
6
|
-
* When compiling the syntax tree, it's necessary to know the line and column
|
|
7
|
-
* of many nodes. This is necessary to support things like error messages,
|
|
8
|
-
* tracepoints, etc.
|
|
9
|
-
*
|
|
10
|
-
* It's possible that we could store the start line, start column, end line, and
|
|
11
|
-
* end column on every node in addition to the offsets that we already store,
|
|
12
|
-
* but that would be quite a lot of memory overhead.
|
|
13
|
-
*/
|
|
14
|
-
#ifndef PRISM_NEWLINE_LIST_H
|
|
15
|
-
#define PRISM_NEWLINE_LIST_H
|
|
16
|
-
|
|
17
|
-
#include "prism/defines.h"
|
|
18
|
-
|
|
19
|
-
#include <assert.h>
|
|
20
|
-
#include <stdbool.h>
|
|
21
|
-
#include <stddef.h>
|
|
22
|
-
#include <stdlib.h>
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* A list of offsets of newlines in a string. The offsets are assumed to be
|
|
26
|
-
* sorted/inserted in ascending order.
|
|
27
|
-
*/
|
|
28
|
-
typedef struct {
|
|
29
|
-
/** A pointer to the start of the source string. */
|
|
30
|
-
const uint8_t *start;
|
|
31
|
-
|
|
32
|
-
/** The number of offsets in the list. */
|
|
33
|
-
size_t size;
|
|
34
|
-
|
|
35
|
-
/** The capacity of the list that has been allocated. */
|
|
36
|
-
size_t capacity;
|
|
37
|
-
|
|
38
|
-
/** The list of offsets. */
|
|
39
|
-
size_t *offsets;
|
|
40
|
-
} pm_newline_list_t;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* A line and column in a string.
|
|
44
|
-
*/
|
|
45
|
-
typedef struct {
|
|
46
|
-
/** The line number. */
|
|
47
|
-
int32_t line;
|
|
48
|
-
|
|
49
|
-
/** The column number. */
|
|
50
|
-
uint32_t column;
|
|
51
|
-
} pm_line_column_t;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Initialize a new newline list with the given capacity. Returns true if the
|
|
55
|
-
* allocation of the offsets succeeds, otherwise returns false.
|
|
56
|
-
*
|
|
57
|
-
* @param list The list to initialize.
|
|
58
|
-
* @param start A pointer to the start of the source string.
|
|
59
|
-
* @param capacity The initial capacity of the list.
|
|
60
|
-
* @return True if the allocation of the offsets succeeds, otherwise false.
|
|
61
|
-
*/
|
|
62
|
-
bool pm_newline_list_init(pm_newline_list_t *list, const uint8_t *start, size_t capacity);
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Clear out the newlines that have been appended to the list.
|
|
66
|
-
*
|
|
67
|
-
* @param list The list to clear.
|
|
68
|
-
*/
|
|
69
|
-
void
|
|
70
|
-
pm_newline_list_clear(pm_newline_list_t *list);
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Append a new offset to the newline list. Returns true if the reallocation of
|
|
74
|
-
* the offsets succeeds (if one was necessary), otherwise returns false.
|
|
75
|
-
*
|
|
76
|
-
* @param list The list to append to.
|
|
77
|
-
* @param cursor A pointer to the offset to append.
|
|
78
|
-
* @return True if the reallocation of the offsets succeeds (if one was
|
|
79
|
-
* necessary), otherwise false.
|
|
80
|
-
*/
|
|
81
|
-
bool pm_newline_list_append(pm_newline_list_t *list, const uint8_t *cursor);
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Returns the line of the given offset. If the offset is not in the list, the
|
|
85
|
-
* line of the closest offset less than the given offset is returned.
|
|
86
|
-
*
|
|
87
|
-
* @param list The list to search.
|
|
88
|
-
* @param cursor A pointer to the offset to search for.
|
|
89
|
-
* @param start_line The line to start counting from.
|
|
90
|
-
* @return The line of the given offset.
|
|
91
|
-
*/
|
|
92
|
-
int32_t pm_newline_list_line(const pm_newline_list_t *list, const uint8_t *cursor, int32_t start_line);
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Returns the line and column of the given offset. If the offset is not in the
|
|
96
|
-
* list, the line and column of the closest offset less than the given offset
|
|
97
|
-
* are returned.
|
|
98
|
-
*
|
|
99
|
-
* @param list The list to search.
|
|
100
|
-
* @param cursor A pointer to the offset to search for.
|
|
101
|
-
* @param start_line The line to start counting from.
|
|
102
|
-
* @return The line and column of the given offset.
|
|
103
|
-
*/
|
|
104
|
-
pm_line_column_t pm_newline_list_line_column(const pm_newline_list_t *list, const uint8_t *cursor, int32_t start_line);
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Free the internal memory allocated for the newline list.
|
|
108
|
-
*
|
|
109
|
-
* @param list The list to free.
|
|
110
|
-
*/
|
|
111
|
-
void pm_newline_list_free(pm_newline_list_t *list);
|
|
112
|
-
|
|
113
|
-
#endif
|