datadog-ruby_core_source 3.4.1 → 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-4.0.0-p0/id.h +357 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/id_table.h +15 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/array.h +2 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/basic_operators.h +66 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/bignum.h +256 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/bits.h +647 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/box.h +83 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/class.h +806 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/cmdlineopt.h +3 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/concurrent_set.h +21 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/cont.h +34 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/encoding.h +2 -1
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/error.h +7 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/eval.h +43 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/gc.h +360 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/hash.h +1 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/imemo.h +87 -22
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/inits.h +4 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/io.h +25 -5
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/load.h +2 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/numeric.h +323 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/object.h +1 -1
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/re.h +5 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/sanitizers.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/set_table.h +70 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/signal.h +1 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/st.h +1 -1
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/string.h +4 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/struct.h +41 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/symbol.h +4 -5
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/thread.h +112 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/time.h +34 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/variable.h +13 -9
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/vm.h +138 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal.h +0 -3
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/iseq.h +359 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/method.h +276 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/prism/ast.h +8254 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/diagnostic.h +7 -0
- 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-p0/prism/options.h +488 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/parser.h +3 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/prism/prism.h +408 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/regexp.h +2 -2
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_buffer.h +8 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_integer.h +4 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_list.h +6 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_string.h +12 -2
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/version.h +2 -2
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism_compile.h +1 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ractor_core.h +63 -114
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/ruby_atomic.h +73 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/rubyparser.h +1393 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/shape.h +464 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/thread_pthread.h +177 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/vm_core.h +2406 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/vm_debug.h +124 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/build_assert/build_assert.h +40 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/check_type/check_type.h +63 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/container_of/container_of.h +142 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/list/list.h +791 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/str/str.h +17 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/id.h +7 -5
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/id_table.h +54 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/array.h +154 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/bignum.h +1 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/box.h +81 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/class.h +805 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/cmdlineopt.h +64 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compar.h +29 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compile.h +34 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compilers.h +107 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/complex.h +29 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/concurrent_set.h +21 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/dir.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enc.h +19 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/encoding.h +39 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enum.h +18 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enumerator.h +21 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/error.h +251 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/eval.h +8 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/file.h +38 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/fixnum.h +185 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/gc.h +25 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/hash.h +194 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/imemo.h +322 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/inits.h +51 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/io.h +163 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/load.h +20 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/loadpath.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/math.h +23 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/missing.h +19 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/numeric.h +1 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/object.h +63 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/parse.h +131 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/proc.h +30 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/process.h +124 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/ractor.h +10 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/random.h +17 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/range.h +40 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/rational.h +71 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/re.h +33 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/ruby_parser.h +102 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/sanitizers.h +346 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/serial.h +23 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/set_table.h +70 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/signal.h +25 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/st.h +11 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/static_assert.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/string.h +203 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/struct.h +160 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/symbol.h +46 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/thread.h +14 -10
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/transcode.h +23 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/util.h +27 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/variable.h +74 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/vm.h +3 -4
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/warnings.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal.h +105 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/iseq.h +7 -1
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/method.h +14 -1
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/node.h +122 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/parser_st.h +162 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/parser_value.h +106 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/ast.h +322 -53
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/defines.h +260 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/diagnostic.h +458 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/encoding.h +283 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/extension.h +19 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/node.h +129 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/options.h +46 -3
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/pack.h +163 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/parser.h +936 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/prettyprint.h +34 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/prism.h +39 -14
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/regexp.h +43 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/static_literals.h +121 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_buffer.h +236 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_char.h +204 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_constant_pool.h +218 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_integer.h +130 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_list.h +103 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_memchr.h +29 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_newline_list.h +113 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_string.h +200 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strncasecmp.h +32 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strpbrk.h +46 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/version.h +29 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism_compile.h +106 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ractor_core.h +306 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ruby_assert.h +14 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ruby_atomic.h +66 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/rubyparser.h +15 -1
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/shape.h +444 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/thread_none.h +21 -0
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/thread_pthread.h +10 -2
- data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/vm_core.h +160 -45
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/vm_opts.h +67 -0
- data/lib/datadog/ruby_core_source/version.rb +1 -1
- data/lib/datadog/ruby_core_source.rb +1 -1
- metadata +214 -106
- data/CHANGELOG.datadog.md +0 -19
- 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/ruby_atomic.h +0 -23
- 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 → 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-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-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-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-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-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-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-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ruby_parser.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-3.5.0-preview1 → ruby-4.0.0-p0}/internal/static_assert.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-3.5.0-preview1 → ruby-4.0.0-p0}/internal/warnings.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-3.5.0-preview1 → ruby-4.0.0-p0}/prism/defines.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-3.5.0-preview1 → ruby-4.0.0-p0}/prism/prettyprint.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-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-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-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-3.5.0-preview1 → ruby-4.0.0-p0}/ruby_assert.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-3.5.0-preview1 → ruby-4.0.0-p0}/vm_opts.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/basic_operators.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/bits.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/cont.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/time.h +0 -0
- /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/vm_debug.h +0 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file encoding.h
|
|
3
|
+
*
|
|
4
|
+
* The encoding interface and implementations used by the parser.
|
|
5
|
+
*/
|
|
6
|
+
#ifndef PRISM_ENCODING_H
|
|
7
|
+
#define PRISM_ENCODING_H
|
|
8
|
+
|
|
9
|
+
#include "prism/defines.h"
|
|
10
|
+
#include "prism/util/pm_strncasecmp.h"
|
|
11
|
+
|
|
12
|
+
#include <assert.h>
|
|
13
|
+
#include <stdbool.h>
|
|
14
|
+
#include <stddef.h>
|
|
15
|
+
#include <stdint.h>
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This struct defines the functions necessary to implement the encoding
|
|
19
|
+
* interface so we can determine how many bytes the subsequent character takes.
|
|
20
|
+
* Each callback should return the number of bytes, or 0 if the next bytes are
|
|
21
|
+
* invalid for the encoding and type.
|
|
22
|
+
*/
|
|
23
|
+
typedef struct {
|
|
24
|
+
/**
|
|
25
|
+
* Return the number of bytes that the next character takes if it is valid
|
|
26
|
+
* in the encoding. Does not read more than n bytes. It is assumed that n is
|
|
27
|
+
* at least 1.
|
|
28
|
+
*/
|
|
29
|
+
size_t (*char_width)(const uint8_t *b, ptrdiff_t n);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Return the number of bytes that the next character takes if it is valid
|
|
33
|
+
* in the encoding and is alphabetical. Does not read more than n bytes. It
|
|
34
|
+
* is assumed that n is at least 1.
|
|
35
|
+
*/
|
|
36
|
+
size_t (*alpha_char)(const uint8_t *b, ptrdiff_t n);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Return the number of bytes that the next character takes if it is valid
|
|
40
|
+
* in the encoding and is alphanumeric. Does not read more than n bytes. It
|
|
41
|
+
* is assumed that n is at least 1.
|
|
42
|
+
*/
|
|
43
|
+
size_t (*alnum_char)(const uint8_t *b, ptrdiff_t n);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Return true if the next character is valid in the encoding and is an
|
|
47
|
+
* uppercase character. Does not read more than n bytes. It is assumed that
|
|
48
|
+
* n is at least 1.
|
|
49
|
+
*/
|
|
50
|
+
bool (*isupper_char)(const uint8_t *b, ptrdiff_t n);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The name of the encoding. This should correspond to a value that can be
|
|
54
|
+
* passed to Encoding.find in Ruby.
|
|
55
|
+
*/
|
|
56
|
+
const char *name;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Return true if the encoding is a multibyte encoding.
|
|
60
|
+
*/
|
|
61
|
+
bool multibyte;
|
|
62
|
+
} pm_encoding_t;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* All of the lookup tables use the first bit of each embedded byte to indicate
|
|
66
|
+
* whether the codepoint is alphabetical.
|
|
67
|
+
*/
|
|
68
|
+
#define PRISM_ENCODING_ALPHABETIC_BIT 1 << 0
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* All of the lookup tables use the second bit of each embedded byte to indicate
|
|
72
|
+
* whether the codepoint is alphanumeric.
|
|
73
|
+
*/
|
|
74
|
+
#define PRISM_ENCODING_ALPHANUMERIC_BIT 1 << 1
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* All of the lookup tables use the third bit of each embedded byte to indicate
|
|
78
|
+
* whether the codepoint is uppercase.
|
|
79
|
+
*/
|
|
80
|
+
#define PRISM_ENCODING_UPPERCASE_BIT 1 << 2
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Return the size of the next character in the UTF-8 encoding.
|
|
84
|
+
*
|
|
85
|
+
* @param b The bytes to read.
|
|
86
|
+
* @param n The number of bytes that can be read.
|
|
87
|
+
* @returns The number of bytes that the next character takes if it is valid in
|
|
88
|
+
* the encoding, or 0 if it is not.
|
|
89
|
+
*/
|
|
90
|
+
size_t pm_encoding_utf_8_char_width(const uint8_t *b, ptrdiff_t n);
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Return the size of the next character in the UTF-8 encoding if it is an
|
|
94
|
+
* alphabetical character.
|
|
95
|
+
*
|
|
96
|
+
* @param b The bytes to read.
|
|
97
|
+
* @param n The number of bytes that can be read.
|
|
98
|
+
* @returns The number of bytes that the next character takes if it is valid in
|
|
99
|
+
* the encoding, or 0 if it is not.
|
|
100
|
+
*/
|
|
101
|
+
size_t pm_encoding_utf_8_alpha_char(const uint8_t *b, ptrdiff_t n);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Return the size of the next character in the UTF-8 encoding if it is an
|
|
105
|
+
* alphanumeric character.
|
|
106
|
+
*
|
|
107
|
+
* @param b The bytes to read.
|
|
108
|
+
* @param n The number of bytes that can be read.
|
|
109
|
+
* @returns The number of bytes that the next character takes if it is valid in
|
|
110
|
+
* the encoding, or 0 if it is not.
|
|
111
|
+
*/
|
|
112
|
+
size_t pm_encoding_utf_8_alnum_char(const uint8_t *b, ptrdiff_t n);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Return true if the next character in the UTF-8 encoding if it is an uppercase
|
|
116
|
+
* character.
|
|
117
|
+
*
|
|
118
|
+
* @param b The bytes to read.
|
|
119
|
+
* @param n The number of bytes that can be read.
|
|
120
|
+
* @returns True if the next character is valid in the encoding and is an
|
|
121
|
+
* uppercase character, or false if it is not.
|
|
122
|
+
*/
|
|
123
|
+
bool pm_encoding_utf_8_isupper_char(const uint8_t *b, ptrdiff_t n);
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* This lookup table is referenced in both the UTF-8 encoding file and the
|
|
127
|
+
* parser directly in order to speed up the default encoding processing. It is
|
|
128
|
+
* used to indicate whether a character is alphabetical, alphanumeric, or
|
|
129
|
+
* uppercase in unicode mappings.
|
|
130
|
+
*/
|
|
131
|
+
extern const uint8_t pm_encoding_unicode_table[256];
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* These are all of the encodings that prism supports.
|
|
135
|
+
*/
|
|
136
|
+
typedef enum {
|
|
137
|
+
PM_ENCODING_UTF_8 = 0,
|
|
138
|
+
PM_ENCODING_US_ASCII,
|
|
139
|
+
PM_ENCODING_ASCII_8BIT,
|
|
140
|
+
PM_ENCODING_EUC_JP,
|
|
141
|
+
PM_ENCODING_WINDOWS_31J,
|
|
142
|
+
|
|
143
|
+
// We optionally support excluding the full set of encodings to only support the
|
|
144
|
+
// minimum necessary to process Ruby code without encoding comments.
|
|
145
|
+
#ifndef PRISM_ENCODING_EXCLUDE_FULL
|
|
146
|
+
PM_ENCODING_BIG5,
|
|
147
|
+
PM_ENCODING_BIG5_HKSCS,
|
|
148
|
+
PM_ENCODING_BIG5_UAO,
|
|
149
|
+
PM_ENCODING_CESU_8,
|
|
150
|
+
PM_ENCODING_CP51932,
|
|
151
|
+
PM_ENCODING_CP850,
|
|
152
|
+
PM_ENCODING_CP852,
|
|
153
|
+
PM_ENCODING_CP855,
|
|
154
|
+
PM_ENCODING_CP949,
|
|
155
|
+
PM_ENCODING_CP950,
|
|
156
|
+
PM_ENCODING_CP951,
|
|
157
|
+
PM_ENCODING_EMACS_MULE,
|
|
158
|
+
PM_ENCODING_EUC_JP_MS,
|
|
159
|
+
PM_ENCODING_EUC_JIS_2004,
|
|
160
|
+
PM_ENCODING_EUC_KR,
|
|
161
|
+
PM_ENCODING_EUC_TW,
|
|
162
|
+
PM_ENCODING_GB12345,
|
|
163
|
+
PM_ENCODING_GB18030,
|
|
164
|
+
PM_ENCODING_GB1988,
|
|
165
|
+
PM_ENCODING_GB2312,
|
|
166
|
+
PM_ENCODING_GBK,
|
|
167
|
+
PM_ENCODING_IBM437,
|
|
168
|
+
PM_ENCODING_IBM720,
|
|
169
|
+
PM_ENCODING_IBM737,
|
|
170
|
+
PM_ENCODING_IBM775,
|
|
171
|
+
PM_ENCODING_IBM852,
|
|
172
|
+
PM_ENCODING_IBM855,
|
|
173
|
+
PM_ENCODING_IBM857,
|
|
174
|
+
PM_ENCODING_IBM860,
|
|
175
|
+
PM_ENCODING_IBM861,
|
|
176
|
+
PM_ENCODING_IBM862,
|
|
177
|
+
PM_ENCODING_IBM863,
|
|
178
|
+
PM_ENCODING_IBM864,
|
|
179
|
+
PM_ENCODING_IBM865,
|
|
180
|
+
PM_ENCODING_IBM866,
|
|
181
|
+
PM_ENCODING_IBM869,
|
|
182
|
+
PM_ENCODING_ISO_8859_1,
|
|
183
|
+
PM_ENCODING_ISO_8859_2,
|
|
184
|
+
PM_ENCODING_ISO_8859_3,
|
|
185
|
+
PM_ENCODING_ISO_8859_4,
|
|
186
|
+
PM_ENCODING_ISO_8859_5,
|
|
187
|
+
PM_ENCODING_ISO_8859_6,
|
|
188
|
+
PM_ENCODING_ISO_8859_7,
|
|
189
|
+
PM_ENCODING_ISO_8859_8,
|
|
190
|
+
PM_ENCODING_ISO_8859_9,
|
|
191
|
+
PM_ENCODING_ISO_8859_10,
|
|
192
|
+
PM_ENCODING_ISO_8859_11,
|
|
193
|
+
PM_ENCODING_ISO_8859_13,
|
|
194
|
+
PM_ENCODING_ISO_8859_14,
|
|
195
|
+
PM_ENCODING_ISO_8859_15,
|
|
196
|
+
PM_ENCODING_ISO_8859_16,
|
|
197
|
+
PM_ENCODING_KOI8_R,
|
|
198
|
+
PM_ENCODING_KOI8_U,
|
|
199
|
+
PM_ENCODING_MAC_CENT_EURO,
|
|
200
|
+
PM_ENCODING_MAC_CROATIAN,
|
|
201
|
+
PM_ENCODING_MAC_CYRILLIC,
|
|
202
|
+
PM_ENCODING_MAC_GREEK,
|
|
203
|
+
PM_ENCODING_MAC_ICELAND,
|
|
204
|
+
PM_ENCODING_MAC_JAPANESE,
|
|
205
|
+
PM_ENCODING_MAC_ROMAN,
|
|
206
|
+
PM_ENCODING_MAC_ROMANIA,
|
|
207
|
+
PM_ENCODING_MAC_THAI,
|
|
208
|
+
PM_ENCODING_MAC_TURKISH,
|
|
209
|
+
PM_ENCODING_MAC_UKRAINE,
|
|
210
|
+
PM_ENCODING_SHIFT_JIS,
|
|
211
|
+
PM_ENCODING_SJIS_DOCOMO,
|
|
212
|
+
PM_ENCODING_SJIS_KDDI,
|
|
213
|
+
PM_ENCODING_SJIS_SOFTBANK,
|
|
214
|
+
PM_ENCODING_STATELESS_ISO_2022_JP,
|
|
215
|
+
PM_ENCODING_STATELESS_ISO_2022_JP_KDDI,
|
|
216
|
+
PM_ENCODING_TIS_620,
|
|
217
|
+
PM_ENCODING_UTF8_MAC,
|
|
218
|
+
PM_ENCODING_UTF8_DOCOMO,
|
|
219
|
+
PM_ENCODING_UTF8_KDDI,
|
|
220
|
+
PM_ENCODING_UTF8_SOFTBANK,
|
|
221
|
+
PM_ENCODING_WINDOWS_1250,
|
|
222
|
+
PM_ENCODING_WINDOWS_1251,
|
|
223
|
+
PM_ENCODING_WINDOWS_1252,
|
|
224
|
+
PM_ENCODING_WINDOWS_1253,
|
|
225
|
+
PM_ENCODING_WINDOWS_1254,
|
|
226
|
+
PM_ENCODING_WINDOWS_1255,
|
|
227
|
+
PM_ENCODING_WINDOWS_1256,
|
|
228
|
+
PM_ENCODING_WINDOWS_1257,
|
|
229
|
+
PM_ENCODING_WINDOWS_1258,
|
|
230
|
+
PM_ENCODING_WINDOWS_874,
|
|
231
|
+
#endif
|
|
232
|
+
|
|
233
|
+
PM_ENCODING_MAXIMUM
|
|
234
|
+
} pm_encoding_type_t;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* This is the table of all of the encodings that prism supports.
|
|
238
|
+
*/
|
|
239
|
+
extern const pm_encoding_t pm_encodings[PM_ENCODING_MAXIMUM];
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* This is the default UTF-8 encoding. We need a reference to it to quickly
|
|
243
|
+
* create parsers.
|
|
244
|
+
*/
|
|
245
|
+
#define PM_ENCODING_UTF_8_ENTRY (&pm_encodings[PM_ENCODING_UTF_8])
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* This is the US-ASCII encoding. We need a reference to it to be able to
|
|
249
|
+
* compare against it when a string is being created because it could possibly
|
|
250
|
+
* need to fall back to ASCII-8BIT.
|
|
251
|
+
*/
|
|
252
|
+
#define PM_ENCODING_US_ASCII_ENTRY (&pm_encodings[PM_ENCODING_US_ASCII])
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* This is the ASCII-8BIT encoding. We need a reference to it so that pm_strpbrk
|
|
256
|
+
* can compare against it because invalid multibyte characters are not a thing
|
|
257
|
+
* in this encoding. It is also needed for handling Regexp encoding flags.
|
|
258
|
+
*/
|
|
259
|
+
#define PM_ENCODING_ASCII_8BIT_ENTRY (&pm_encodings[PM_ENCODING_ASCII_8BIT])
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* This is the EUC-JP encoding. We need a reference to it to quickly process
|
|
263
|
+
* regular expression modifiers.
|
|
264
|
+
*/
|
|
265
|
+
#define PM_ENCODING_EUC_JP_ENTRY (&pm_encodings[PM_ENCODING_EUC_JP])
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* This is the Windows-31J encoding. We need a reference to it to quickly
|
|
269
|
+
* process regular expression modifiers.
|
|
270
|
+
*/
|
|
271
|
+
#define PM_ENCODING_WINDOWS_31J_ENTRY (&pm_encodings[PM_ENCODING_WINDOWS_31J])
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Parse the given name of an encoding and return a pointer to the corresponding
|
|
275
|
+
* encoding struct if one can be found, otherwise return NULL.
|
|
276
|
+
*
|
|
277
|
+
* @param start A pointer to the first byte of the name.
|
|
278
|
+
* @param end A pointer to the last byte of the name.
|
|
279
|
+
* @returns A pointer to the encoding struct if one is found, otherwise NULL.
|
|
280
|
+
*/
|
|
281
|
+
const pm_encoding_t * pm_encoding_find(const uint8_t *start, const uint8_t *end);
|
|
282
|
+
|
|
283
|
+
#endif
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#ifndef PRISM_EXT_NODE_H
|
|
2
|
+
#define PRISM_EXT_NODE_H
|
|
3
|
+
|
|
4
|
+
#define EXPECTED_PRISM_VERSION "1.6.0"
|
|
5
|
+
|
|
6
|
+
#include <ruby.h>
|
|
7
|
+
#include <ruby/encoding.h>
|
|
8
|
+
#include "prism.h"
|
|
9
|
+
|
|
10
|
+
VALUE pm_source_new(const pm_parser_t *parser, rb_encoding *encoding, bool freeze);
|
|
11
|
+
VALUE pm_token_new(const pm_parser_t *parser, const pm_token_t *token, rb_encoding *encoding, VALUE source, bool freeze);
|
|
12
|
+
VALUE pm_ast_new(const pm_parser_t *parser, const pm_node_t *node, rb_encoding *encoding, VALUE source, bool freeze);
|
|
13
|
+
VALUE pm_integer_new(const pm_integer_t *integer);
|
|
14
|
+
|
|
15
|
+
void Init_prism_api_node(void);
|
|
16
|
+
void Init_prism_pack(void);
|
|
17
|
+
RUBY_FUNC_EXPORTED void Init_prism(void);
|
|
18
|
+
|
|
19
|
+
#endif
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file node.h
|
|
3
|
+
*
|
|
4
|
+
* Functions related to nodes in the AST.
|
|
5
|
+
*/
|
|
6
|
+
#ifndef PRISM_NODE_H
|
|
7
|
+
#define PRISM_NODE_H
|
|
8
|
+
|
|
9
|
+
#include "prism/defines.h"
|
|
10
|
+
#include "prism/parser.h"
|
|
11
|
+
#include "prism/util/pm_buffer.h"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Loop through each node in the node list, writing each node to the given
|
|
15
|
+
* pm_node_t pointer.
|
|
16
|
+
*/
|
|
17
|
+
#define PM_NODE_LIST_FOREACH(list, index, node) \
|
|
18
|
+
for (size_t index = 0; index < (list)->size && ((node) = (list)->nodes[index]); index++)
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Append a new node onto the end of the node list.
|
|
22
|
+
*
|
|
23
|
+
* @param list The list to append to.
|
|
24
|
+
* @param node The node to append.
|
|
25
|
+
*/
|
|
26
|
+
void pm_node_list_append(pm_node_list_t *list, pm_node_t *node);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Prepend a new node onto the beginning of the node list.
|
|
30
|
+
*
|
|
31
|
+
* @param list The list to prepend to.
|
|
32
|
+
* @param node The node to prepend.
|
|
33
|
+
*/
|
|
34
|
+
void pm_node_list_prepend(pm_node_list_t *list, pm_node_t *node);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Concatenate the given node list onto the end of the other node list.
|
|
38
|
+
*
|
|
39
|
+
* @param list The list to concatenate onto.
|
|
40
|
+
* @param other The list to concatenate.
|
|
41
|
+
*/
|
|
42
|
+
void pm_node_list_concat(pm_node_list_t *list, pm_node_list_t *other);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Free the internal memory associated with the given node list.
|
|
46
|
+
*
|
|
47
|
+
* @param list The list to free.
|
|
48
|
+
*/
|
|
49
|
+
void pm_node_list_free(pm_node_list_t *list);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Deallocate a node and all of its children.
|
|
53
|
+
*
|
|
54
|
+
* @param parser The parser that owns the node.
|
|
55
|
+
* @param node The node to deallocate.
|
|
56
|
+
*/
|
|
57
|
+
PRISM_EXPORTED_FUNCTION void pm_node_destroy(pm_parser_t *parser, struct pm_node *node);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Returns a string representation of the given node type.
|
|
61
|
+
*
|
|
62
|
+
* @param node_type The node type to convert to a string.
|
|
63
|
+
* @return A string representation of the given node type.
|
|
64
|
+
*/
|
|
65
|
+
PRISM_EXPORTED_FUNCTION const char * pm_node_type_to_str(pm_node_type_t node_type);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Visit each of the nodes in this subtree using the given visitor callback. The
|
|
69
|
+
* callback function will be called for each node in the subtree. If it returns
|
|
70
|
+
* false, then that node's children will not be visited. If it returns true,
|
|
71
|
+
* then the children will be visited. The data parameter is treated as an opaque
|
|
72
|
+
* pointer and is passed to the visitor callback for consumers to use as they
|
|
73
|
+
* see fit.
|
|
74
|
+
*
|
|
75
|
+
* As an example:
|
|
76
|
+
*
|
|
77
|
+
* ```c
|
|
78
|
+
* #include "prism.h"
|
|
79
|
+
*
|
|
80
|
+
* bool visit(const pm_node_t *node, void *data) {
|
|
81
|
+
* size_t *indent = (size_t *) data;
|
|
82
|
+
* for (size_t i = 0; i < *indent * 2; i++) putc(' ', stdout);
|
|
83
|
+
* printf("%s\n", pm_node_type_to_str(node->type));
|
|
84
|
+
*
|
|
85
|
+
* size_t next_indent = *indent + 1;
|
|
86
|
+
* size_t *next_data = &next_indent;
|
|
87
|
+
* pm_visit_child_nodes(node, visit, next_data);
|
|
88
|
+
*
|
|
89
|
+
* return false;
|
|
90
|
+
* }
|
|
91
|
+
*
|
|
92
|
+
* int main(void) {
|
|
93
|
+
* const char *source = "1 + 2; 3 + 4";
|
|
94
|
+
* size_t size = strlen(source);
|
|
95
|
+
*
|
|
96
|
+
* pm_parser_t parser;
|
|
97
|
+
* pm_options_t options = { 0 };
|
|
98
|
+
* pm_parser_init(&parser, (const uint8_t *) source, size, &options);
|
|
99
|
+
*
|
|
100
|
+
* size_t indent = 0;
|
|
101
|
+
* pm_node_t *node = pm_parse(&parser);
|
|
102
|
+
*
|
|
103
|
+
* size_t *data = &indent;
|
|
104
|
+
* pm_visit_node(node, visit, data);
|
|
105
|
+
*
|
|
106
|
+
* pm_node_destroy(&parser, node);
|
|
107
|
+
* pm_parser_free(&parser);
|
|
108
|
+
* return EXIT_SUCCESS;
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @param node The root node to start visiting from.
|
|
113
|
+
* @param visitor The callback to call for each node in the subtree.
|
|
114
|
+
* @param data An opaque pointer that is passed to the visitor callback.
|
|
115
|
+
*/
|
|
116
|
+
PRISM_EXPORTED_FUNCTION void pm_visit_node(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data);
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Visit the children of the given node with the given callback. This is the
|
|
120
|
+
* default behavior for walking the tree that is called from pm_visit_node if
|
|
121
|
+
* the callback returns true.
|
|
122
|
+
*
|
|
123
|
+
* @param node The node to visit the children of.
|
|
124
|
+
* @param visitor The callback to call for each child node.
|
|
125
|
+
* @param data An opaque pointer that is passed to the visitor callback.
|
|
126
|
+
*/
|
|
127
|
+
PRISM_EXPORTED_FUNCTION void pm_visit_child_nodes(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data);
|
|
128
|
+
|
|
129
|
+
#endif
|
data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/options.h
RENAMED
|
@@ -82,14 +82,23 @@ typedef void (*pm_options_shebang_callback_t)(struct pm_options *options, const
|
|
|
82
82
|
* parse in the same way as a specific version of CRuby would have.
|
|
83
83
|
*/
|
|
84
84
|
typedef enum {
|
|
85
|
-
/**
|
|
86
|
-
|
|
85
|
+
/** If an explicit version is not provided, the current version of prism will be used. */
|
|
86
|
+
PM_OPTIONS_VERSION_UNSET = 0,
|
|
87
87
|
|
|
88
88
|
/** The vendored version of prism in CRuby 3.3.x. */
|
|
89
89
|
PM_OPTIONS_VERSION_CRUBY_3_3 = 1,
|
|
90
90
|
|
|
91
91
|
/** The vendored version of prism in CRuby 3.4.x. */
|
|
92
|
-
PM_OPTIONS_VERSION_CRUBY_3_4 = 2
|
|
92
|
+
PM_OPTIONS_VERSION_CRUBY_3_4 = 2,
|
|
93
|
+
|
|
94
|
+
/** The vendored version of prism in CRuby 4.0.x. */
|
|
95
|
+
PM_OPTIONS_VERSION_CRUBY_3_5 = 3,
|
|
96
|
+
|
|
97
|
+
/** The vendored version of prism in CRuby 4.0.x. */
|
|
98
|
+
PM_OPTIONS_VERSION_CRUBY_4_0 = 3,
|
|
99
|
+
|
|
100
|
+
/** The current version of prism. */
|
|
101
|
+
PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_0
|
|
93
102
|
} pm_options_version_t;
|
|
94
103
|
|
|
95
104
|
/**
|
|
@@ -231,6 +240,8 @@ static const uint8_t PM_OPTIONS_COMMAND_LINE_X = 0x20;
|
|
|
231
240
|
* @param shebang_callback The shebang callback to set.
|
|
232
241
|
* @param shebang_callback_data Any additional data that should be passed along
|
|
233
242
|
* to the callback.
|
|
243
|
+
*
|
|
244
|
+
* \public \memberof pm_options
|
|
234
245
|
*/
|
|
235
246
|
PRISM_EXPORTED_FUNCTION void pm_options_shebang_callback_set(pm_options_t *options, pm_options_shebang_callback_t shebang_callback, void *shebang_callback_data);
|
|
236
247
|
|
|
@@ -239,6 +250,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_shebang_callback_set(pm_options_t *optio
|
|
|
239
250
|
*
|
|
240
251
|
* @param options The options struct to set the filepath on.
|
|
241
252
|
* @param filepath The filepath to set.
|
|
253
|
+
*
|
|
254
|
+
* \public \memberof pm_options
|
|
242
255
|
*/
|
|
243
256
|
PRISM_EXPORTED_FUNCTION void pm_options_filepath_set(pm_options_t *options, const char *filepath);
|
|
244
257
|
|
|
@@ -247,6 +260,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_filepath_set(pm_options_t *options, cons
|
|
|
247
260
|
*
|
|
248
261
|
* @param options The options struct to set the line on.
|
|
249
262
|
* @param line The line to set.
|
|
263
|
+
*
|
|
264
|
+
* \public \memberof pm_options
|
|
250
265
|
*/
|
|
251
266
|
PRISM_EXPORTED_FUNCTION void pm_options_line_set(pm_options_t *options, int32_t line);
|
|
252
267
|
|
|
@@ -255,6 +270,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_line_set(pm_options_t *options, int32_t
|
|
|
255
270
|
*
|
|
256
271
|
* @param options The options struct to set the encoding on.
|
|
257
272
|
* @param encoding The encoding to set.
|
|
273
|
+
*
|
|
274
|
+
* \public \memberof pm_options
|
|
258
275
|
*/
|
|
259
276
|
PRISM_EXPORTED_FUNCTION void pm_options_encoding_set(pm_options_t *options, const char *encoding);
|
|
260
277
|
|
|
@@ -263,6 +280,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_encoding_set(pm_options_t *options, cons
|
|
|
263
280
|
*
|
|
264
281
|
* @param options The options struct to set the encoding_locked value on.
|
|
265
282
|
* @param encoding_locked The encoding_locked value to set.
|
|
283
|
+
*
|
|
284
|
+
* \public \memberof pm_options
|
|
266
285
|
*/
|
|
267
286
|
PRISM_EXPORTED_FUNCTION void pm_options_encoding_locked_set(pm_options_t *options, bool encoding_locked);
|
|
268
287
|
|
|
@@ -271,6 +290,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_encoding_locked_set(pm_options_t *option
|
|
|
271
290
|
*
|
|
272
291
|
* @param options The options struct to set the frozen string literal value on.
|
|
273
292
|
* @param frozen_string_literal The frozen string literal value to set.
|
|
293
|
+
*
|
|
294
|
+
* \public \memberof pm_options
|
|
274
295
|
*/
|
|
275
296
|
PRISM_EXPORTED_FUNCTION void pm_options_frozen_string_literal_set(pm_options_t *options, bool frozen_string_literal);
|
|
276
297
|
|
|
@@ -279,6 +300,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_frozen_string_literal_set(pm_options_t *
|
|
|
279
300
|
*
|
|
280
301
|
* @param options The options struct to set the command line option on.
|
|
281
302
|
* @param command_line The command_line value to set.
|
|
303
|
+
*
|
|
304
|
+
* \public \memberof pm_options
|
|
282
305
|
*/
|
|
283
306
|
PRISM_EXPORTED_FUNCTION void pm_options_command_line_set(pm_options_t *options, uint8_t command_line);
|
|
284
307
|
|
|
@@ -291,6 +314,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_command_line_set(pm_options_t *options,
|
|
|
291
314
|
* @param version The version to set.
|
|
292
315
|
* @param length The length of the version string.
|
|
293
316
|
* @return Whether or not the version was parsed successfully.
|
|
317
|
+
*
|
|
318
|
+
* \public \memberof pm_options
|
|
294
319
|
*/
|
|
295
320
|
PRISM_EXPORTED_FUNCTION bool pm_options_version_set(pm_options_t *options, const char *version, size_t length);
|
|
296
321
|
|
|
@@ -299,6 +324,8 @@ PRISM_EXPORTED_FUNCTION bool pm_options_version_set(pm_options_t *options, const
|
|
|
299
324
|
*
|
|
300
325
|
* @param options The options struct to set the main script value on.
|
|
301
326
|
* @param main_script The main script value to set.
|
|
327
|
+
*
|
|
328
|
+
* \public \memberof pm_options
|
|
302
329
|
*/
|
|
303
330
|
PRISM_EXPORTED_FUNCTION void pm_options_main_script_set(pm_options_t *options, bool main_script);
|
|
304
331
|
|
|
@@ -307,6 +334,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_main_script_set(pm_options_t *options, b
|
|
|
307
334
|
*
|
|
308
335
|
* @param options The options struct to set the partial script value on.
|
|
309
336
|
* @param partial_script The partial script value to set.
|
|
337
|
+
*
|
|
338
|
+
* \public \memberof pm_options
|
|
310
339
|
*/
|
|
311
340
|
PRISM_EXPORTED_FUNCTION void pm_options_partial_script_set(pm_options_t *options, bool partial_script);
|
|
312
341
|
|
|
@@ -315,6 +344,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_partial_script_set(pm_options_t *options
|
|
|
315
344
|
*
|
|
316
345
|
* @param options The options struct to set the freeze value on.
|
|
317
346
|
* @param freeze The freeze value to set.
|
|
347
|
+
*
|
|
348
|
+
* \public \memberof pm_options
|
|
318
349
|
*/
|
|
319
350
|
PRISM_EXPORTED_FUNCTION void pm_options_freeze_set(pm_options_t *options, bool freeze);
|
|
320
351
|
|
|
@@ -324,6 +355,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_freeze_set(pm_options_t *options, bool f
|
|
|
324
355
|
* @param options The options struct to initialize the scopes array on.
|
|
325
356
|
* @param scopes_count The number of scopes to allocate.
|
|
326
357
|
* @return Whether or not the scopes array was initialized successfully.
|
|
358
|
+
*
|
|
359
|
+
* \public \memberof pm_options
|
|
327
360
|
*/
|
|
328
361
|
PRISM_EXPORTED_FUNCTION bool pm_options_scopes_init(pm_options_t *options, size_t scopes_count);
|
|
329
362
|
|
|
@@ -333,6 +366,8 @@ PRISM_EXPORTED_FUNCTION bool pm_options_scopes_init(pm_options_t *options, size_
|
|
|
333
366
|
* @param options The options struct to get the scope from.
|
|
334
367
|
* @param index The index of the scope to get.
|
|
335
368
|
* @return A pointer to the scope at the given index.
|
|
369
|
+
*
|
|
370
|
+
* \public \memberof pm_options
|
|
336
371
|
*/
|
|
337
372
|
PRISM_EXPORTED_FUNCTION const pm_options_scope_t * pm_options_scope_get(const pm_options_t *options, size_t index);
|
|
338
373
|
|
|
@@ -343,6 +378,8 @@ PRISM_EXPORTED_FUNCTION const pm_options_scope_t * pm_options_scope_get(const pm
|
|
|
343
378
|
* @param scope The scope struct to initialize.
|
|
344
379
|
* @param locals_count The number of locals to allocate.
|
|
345
380
|
* @return Whether or not the scope was initialized successfully.
|
|
381
|
+
*
|
|
382
|
+
* \public \memberof pm_options
|
|
346
383
|
*/
|
|
347
384
|
PRISM_EXPORTED_FUNCTION bool pm_options_scope_init(pm_options_scope_t *scope, size_t locals_count);
|
|
348
385
|
|
|
@@ -352,6 +389,8 @@ PRISM_EXPORTED_FUNCTION bool pm_options_scope_init(pm_options_scope_t *scope, si
|
|
|
352
389
|
* @param scope The scope struct to get the local from.
|
|
353
390
|
* @param index The index of the local to get.
|
|
354
391
|
* @return A pointer to the local at the given index.
|
|
392
|
+
*
|
|
393
|
+
* \public \memberof pm_options
|
|
355
394
|
*/
|
|
356
395
|
PRISM_EXPORTED_FUNCTION const pm_string_t * pm_options_scope_local_get(const pm_options_scope_t *scope, size_t index);
|
|
357
396
|
|
|
@@ -360,6 +399,8 @@ PRISM_EXPORTED_FUNCTION const pm_string_t * pm_options_scope_local_get(const pm_
|
|
|
360
399
|
*
|
|
361
400
|
* @param scope The scope struct to set the forwarding on.
|
|
362
401
|
* @param forwarding The forwarding value to set.
|
|
402
|
+
*
|
|
403
|
+
* \public \memberof pm_options
|
|
363
404
|
*/
|
|
364
405
|
PRISM_EXPORTED_FUNCTION void pm_options_scope_forwarding_set(pm_options_scope_t *scope, uint8_t forwarding);
|
|
365
406
|
|
|
@@ -367,6 +408,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_scope_forwarding_set(pm_options_scope_t
|
|
|
367
408
|
* Free the internal memory associated with the options.
|
|
368
409
|
*
|
|
369
410
|
* @param options The options struct whose internal memory should be freed.
|
|
411
|
+
*
|
|
412
|
+
* \public \memberof pm_options
|
|
370
413
|
*/
|
|
371
414
|
PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options);
|
|
372
415
|
|