datadog-ruby_core_source 3.3.7 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.datadog.md +5 -0
- data/datadog-ruby_core_source.gemspec +1 -1
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/id.h +2 -0
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/error.h +26 -0
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/gc.h +1 -0
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/parse.h +2 -1
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/proc.h +1 -0
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/sanitizers.h +24 -36
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/prism/ast.h +10 -0
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/extension.h +1 -1
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/prism/version.h +2 -2
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/ractor_core.h +1 -0
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/rubyparser.h +3 -1
- data/lib/datadog/ruby_core_source/version.rb +1 -1
- metadata +106 -209
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/id.h +0 -347
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/basic_operators.h +0 -64
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/bits.h +0 -568
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/encoding.h +0 -36
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/fixnum.h +0 -184
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/gc.h +0 -322
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/imemo.h +0 -261
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/io.h +0 -143
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/ractor.h +0 -6
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/sanitizers.h +0 -326
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/string.h +0 -186
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/thread.h +0 -85
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/vm.h +0 -137
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/method.h +0 -255
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/ast.h +0 -7524
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/defines.h +0 -242
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/diagnostic.h +0 -450
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/prism.h +0 -336
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/version.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism_compile.h +0 -99
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/ractor_core.h +0 -382
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/rubyparser.h +0 -1350
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/thread_pthread.h +0 -168
- data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm_core.h +0 -2222
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/ccan/build_assert/build_assert.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/ccan/check_type/check_type.h +0 -63
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/ccan/container_of/container_of.h +0 -142
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/ccan/list/list.h +0 -791
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/ccan/str/str.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/id_table.h +0 -39
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/array.h +0 -152
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/bignum.h +0 -244
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/class.h +0 -283
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/cmdlineopt.h +0 -65
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/compar.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/compile.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/compilers.h +0 -107
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/complex.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/cont.h +0 -35
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/dir.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/enc.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/enum.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/enumerator.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/error.h +0 -218
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/eval.h +0 -33
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/file.h +0 -38
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/hash.h +0 -192
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/inits.h +0 -47
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/load.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/loadpath.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/math.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/missing.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/numeric.h +0 -274
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/object.h +0 -63
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/parse.h +0 -129
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/proc.h +0 -30
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/process.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/random.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/range.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/rational.h +0 -71
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/re.h +0 -28
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/ruby_parser.h +0 -102
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/serial.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/signal.h +0 -24
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/st.h +0 -11
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/static_assert.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/struct.h +0 -127
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/symbol.h +0 -45
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/time.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/transcode.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/util.h +0 -27
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/variable.h +0 -72
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal/warnings.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/internal.h +0 -108
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/iseq.h +0 -340
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/node.h +0 -111
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/parser_st.h +0 -162
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/parser_value.h +0 -106
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/encoding.h +0 -283
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/extension.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/node.h +0 -129
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/options.h +0 -396
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/pack.h +0 -163
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/parser.h +0 -933
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/prettyprint.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/regexp.h +0 -43
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/static_literals.h +0 -121
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_buffer.h +0 -218
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_char.h +0 -204
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_constant_pool.h +0 -218
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_integer.h +0 -126
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_list.h +0 -97
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_memchr.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_newline_list.h +0 -113
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_string.h +0 -190
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_strncasecmp.h +0 -32
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/prism/util/pm_strpbrk.h +0 -46
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/ruby_assert.h +0 -14
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/ruby_atomic.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/shape.h +0 -234
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/thread_none.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/vm_debug.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-3.4.0-rc1/vm_opts.h +0 -67
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/ccan/build_assert/build_assert.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/ccan/check_type/check_type.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/ccan/container_of/container_of.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/ccan/list/list.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/ccan/str/str.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/id_table.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/array.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/basic_operators.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/bignum.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/bits.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/class.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/cmdlineopt.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/compar.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/compile.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/compilers.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/complex.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/cont.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/dir.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/enc.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/encoding.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/enum.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/enumerator.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/eval.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/file.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/fixnum.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/hash.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/imemo.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/inits.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/io.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/load.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/loadpath.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/math.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/missing.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/numeric.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/object.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/process.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/ractor.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/random.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/range.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/rational.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/re.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/ruby_parser.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/serial.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/signal.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/st.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/static_assert.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/string.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/struct.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/symbol.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/thread.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/time.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/transcode.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/util.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/variable.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/internal/vm.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal/warnings.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/internal.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/iseq.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/method.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/node.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/parser_st.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/parser_value.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/prism/defines.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/prism/diagnostic.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/encoding.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/node.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/options.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/pack.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/parser.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/prettyprint.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/prism/prism.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/regexp.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/static_literals.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_buffer.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_char.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_constant_pool.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_integer.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_list.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_memchr.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_newline_list.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_string.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_strncasecmp.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/prism/util/pm_strpbrk.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/prism_compile.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/ruby_assert.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/ruby_atomic.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/shape.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/thread_none.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/thread_pthread.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-rc1 → ruby-3.4.0-p0}/vm_core.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/vm_debug.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p0}/vm_opts.h +0 -0
@@ -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,126 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @file pm_integer.h
|
3
|
-
*
|
4
|
-
* This module provides functions for working with arbitrary-sized integers.
|
5
|
-
*/
|
6
|
-
#ifndef PRISM_NUMBER_H
|
7
|
-
#define PRISM_NUMBER_H
|
8
|
-
|
9
|
-
#include "prism/defines.h"
|
10
|
-
#include "prism/util/pm_buffer.h"
|
11
|
-
|
12
|
-
#include <assert.h>
|
13
|
-
#include <stdbool.h>
|
14
|
-
#include <stdint.h>
|
15
|
-
#include <stdlib.h>
|
16
|
-
|
17
|
-
/**
|
18
|
-
* A structure represents an arbitrary-sized integer.
|
19
|
-
*/
|
20
|
-
typedef struct {
|
21
|
-
/**
|
22
|
-
* The number of allocated values. length is set to 0 if the integer fits
|
23
|
-
* into uint32_t.
|
24
|
-
*/
|
25
|
-
size_t length;
|
26
|
-
|
27
|
-
/**
|
28
|
-
* List of 32-bit integers. Set to NULL if the integer fits into uint32_t.
|
29
|
-
*/
|
30
|
-
uint32_t *values;
|
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
|
-
/**
|
39
|
-
* Whether or not the integer is negative. It is stored this way so that a
|
40
|
-
* zeroed pm_integer_t is always positive zero.
|
41
|
-
*/
|
42
|
-
bool negative;
|
43
|
-
} pm_integer_t;
|
44
|
-
|
45
|
-
/**
|
46
|
-
* An enum controlling the base of an integer. It is expected that the base is
|
47
|
-
* already known before parsing the integer, even though it could be derived
|
48
|
-
* from the string itself.
|
49
|
-
*/
|
50
|
-
typedef enum {
|
51
|
-
/** The default decimal base, with no prefix. Leading 0s will be ignored. */
|
52
|
-
PM_INTEGER_BASE_DEFAULT,
|
53
|
-
|
54
|
-
/** The binary base, indicated by a 0b or 0B prefix. */
|
55
|
-
PM_INTEGER_BASE_BINARY,
|
56
|
-
|
57
|
-
/** The octal base, indicated by a 0, 0o, or 0O prefix. */
|
58
|
-
PM_INTEGER_BASE_OCTAL,
|
59
|
-
|
60
|
-
/** The decimal base, indicated by a 0d, 0D, or empty prefix. */
|
61
|
-
PM_INTEGER_BASE_DECIMAL,
|
62
|
-
|
63
|
-
/** The hexadecimal base, indicated by a 0x or 0X prefix. */
|
64
|
-
PM_INTEGER_BASE_HEXADECIMAL,
|
65
|
-
|
66
|
-
/**
|
67
|
-
* An unknown base, in which case pm_integer_parse will derive it based on
|
68
|
-
* the content of the string. This is less efficient and does more
|
69
|
-
* comparisons, so if callers know the base ahead of time, they should use
|
70
|
-
* that instead.
|
71
|
-
*/
|
72
|
-
PM_INTEGER_BASE_UNKNOWN
|
73
|
-
} pm_integer_base_t;
|
74
|
-
|
75
|
-
/**
|
76
|
-
* Parse an integer from a string. This assumes that the format of the integer
|
77
|
-
* has already been validated, as internal validation checks are not performed
|
78
|
-
* here.
|
79
|
-
*
|
80
|
-
* @param integer The integer to parse into.
|
81
|
-
* @param base The base of the integer.
|
82
|
-
* @param start The start of the string.
|
83
|
-
* @param end The end of the string.
|
84
|
-
*/
|
85
|
-
void pm_integer_parse(pm_integer_t *integer, pm_integer_base_t base, const uint8_t *start, const uint8_t *end);
|
86
|
-
|
87
|
-
/**
|
88
|
-
* Compare two integers. This function returns -1 if the left integer is less
|
89
|
-
* than the right integer, 0 if they are equal, and 1 if the left integer is
|
90
|
-
* greater than the right integer.
|
91
|
-
*
|
92
|
-
* @param left The left integer to compare.
|
93
|
-
* @param right The right integer to compare.
|
94
|
-
* @return The result of the comparison.
|
95
|
-
*/
|
96
|
-
int pm_integer_compare(const pm_integer_t *left, const pm_integer_t *right);
|
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
|
-
|
110
|
-
/**
|
111
|
-
* Convert an integer to a decimal string.
|
112
|
-
*
|
113
|
-
* @param buffer The buffer to append the string to.
|
114
|
-
* @param integer The integer to convert to a string.
|
115
|
-
*/
|
116
|
-
PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_integer_t *integer);
|
117
|
-
|
118
|
-
/**
|
119
|
-
* Free the internal memory of an integer. This memory will only be allocated if
|
120
|
-
* the integer exceeds the size of a single node in the linked list.
|
121
|
-
*
|
122
|
-
* @param integer The integer to free.
|
123
|
-
*/
|
124
|
-
PRISM_EXPORTED_FUNCTION void pm_integer_free(pm_integer_t *integer);
|
125
|
-
|
126
|
-
#endif
|
@@ -1,97 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @file pm_list.h
|
3
|
-
*
|
4
|
-
* An abstract linked list.
|
5
|
-
*/
|
6
|
-
#ifndef PRISM_LIST_H
|
7
|
-
#define PRISM_LIST_H
|
8
|
-
|
9
|
-
#include "prism/defines.h"
|
10
|
-
|
11
|
-
#include <stdbool.h>
|
12
|
-
#include <stddef.h>
|
13
|
-
#include <stdint.h>
|
14
|
-
#include <stdlib.h>
|
15
|
-
|
16
|
-
/**
|
17
|
-
* This struct represents an abstract linked list that provides common
|
18
|
-
* functionality. It is meant to be used any time a linked list is necessary to
|
19
|
-
* store data.
|
20
|
-
*
|
21
|
-
* The linked list itself operates off a set of pointers. Because the pointers
|
22
|
-
* are not necessarily sequential, they can be of any size. We use this fact to
|
23
|
-
* allow the consumer of this linked list to extend the node struct to include
|
24
|
-
* any data they want. This is done by using the pm_list_node_t as the first
|
25
|
-
* member of the struct.
|
26
|
-
*
|
27
|
-
* For example, if we want to store a list of integers, we can do the following:
|
28
|
-
*
|
29
|
-
* ```c
|
30
|
-
* typedef struct {
|
31
|
-
* pm_list_node_t node;
|
32
|
-
* int value;
|
33
|
-
* } pm_int_node_t;
|
34
|
-
*
|
35
|
-
* pm_list_t list = { 0 };
|
36
|
-
* pm_int_node_t *node = xmalloc(sizeof(pm_int_node_t));
|
37
|
-
* node->value = 5;
|
38
|
-
*
|
39
|
-
* pm_list_append(&list, &node->node);
|
40
|
-
* ```
|
41
|
-
*
|
42
|
-
* The pm_list_t struct is used to represent the overall linked list. It
|
43
|
-
* contains a pointer to the head and tail of the list. This allows for easy
|
44
|
-
* iteration and appending of new nodes.
|
45
|
-
*/
|
46
|
-
typedef struct pm_list_node {
|
47
|
-
/** A pointer to the next node in the list. */
|
48
|
-
struct pm_list_node *next;
|
49
|
-
} pm_list_node_t;
|
50
|
-
|
51
|
-
/**
|
52
|
-
* This represents the overall linked list. It keeps a pointer to the head and
|
53
|
-
* tail so that iteration is easy and pushing new nodes is easy.
|
54
|
-
*/
|
55
|
-
typedef struct {
|
56
|
-
/** The size of the list. */
|
57
|
-
size_t size;
|
58
|
-
|
59
|
-
/** A pointer to the head of the list. */
|
60
|
-
pm_list_node_t *head;
|
61
|
-
|
62
|
-
/** A pointer to the tail of the list. */
|
63
|
-
pm_list_node_t *tail;
|
64
|
-
} pm_list_t;
|
65
|
-
|
66
|
-
/**
|
67
|
-
* Returns true if the given list is empty.
|
68
|
-
*
|
69
|
-
* @param list The list to check.
|
70
|
-
* @return True if the given list is empty, otherwise false.
|
71
|
-
*/
|
72
|
-
PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list);
|
73
|
-
|
74
|
-
/**
|
75
|
-
* Returns the size of the list.
|
76
|
-
*
|
77
|
-
* @param list The list to check.
|
78
|
-
* @return The size of the list.
|
79
|
-
*/
|
80
|
-
PRISM_EXPORTED_FUNCTION size_t pm_list_size(pm_list_t *list);
|
81
|
-
|
82
|
-
/**
|
83
|
-
* Append a node to the given list.
|
84
|
-
*
|
85
|
-
* @param list The list to append to.
|
86
|
-
* @param node The node to append.
|
87
|
-
*/
|
88
|
-
void pm_list_append(pm_list_t *list, pm_list_node_t *node);
|
89
|
-
|
90
|
-
/**
|
91
|
-
* Deallocate the internal state of the given list.
|
92
|
-
*
|
93
|
-
* @param list The list to free.
|
94
|
-
*/
|
95
|
-
PRISM_EXPORTED_FUNCTION void pm_list_free(pm_list_t *list);
|
96
|
-
|
97
|
-
#endif
|
@@ -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
|