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,408 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file prism.h
|
|
3
|
+
*
|
|
4
|
+
* The main header file for the prism parser.
|
|
5
|
+
*/
|
|
6
|
+
#ifndef PRISM_H
|
|
7
|
+
#define PRISM_H
|
|
8
|
+
|
|
9
|
+
#include "prism/defines.h"
|
|
10
|
+
#include "prism/util/pm_buffer.h"
|
|
11
|
+
#include "prism/util/pm_char.h"
|
|
12
|
+
#include "prism/util/pm_integer.h"
|
|
13
|
+
#include "prism/util/pm_memchr.h"
|
|
14
|
+
#include "prism/util/pm_strncasecmp.h"
|
|
15
|
+
#include "prism/util/pm_strpbrk.h"
|
|
16
|
+
#include "prism/ast.h"
|
|
17
|
+
#include "prism/diagnostic.h"
|
|
18
|
+
#include "prism/node.h"
|
|
19
|
+
#include "prism/options.h"
|
|
20
|
+
#include "prism/pack.h"
|
|
21
|
+
#include "prism/parser.h"
|
|
22
|
+
#include "prism/prettyprint.h"
|
|
23
|
+
#include "prism/regexp.h"
|
|
24
|
+
#include "prism/static_literals.h"
|
|
25
|
+
#include "prism/version.h"
|
|
26
|
+
|
|
27
|
+
#include <assert.h>
|
|
28
|
+
#include <errno.h>
|
|
29
|
+
#include <locale.h>
|
|
30
|
+
#include <math.h>
|
|
31
|
+
#include <stdarg.h>
|
|
32
|
+
#include <stdbool.h>
|
|
33
|
+
#include <stdint.h>
|
|
34
|
+
#include <stdio.h>
|
|
35
|
+
#include <stdlib.h>
|
|
36
|
+
#include <string.h>
|
|
37
|
+
|
|
38
|
+
#ifndef _WIN32
|
|
39
|
+
#include <strings.h>
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The prism version and the serialization format.
|
|
44
|
+
*
|
|
45
|
+
* @returns The prism version as a constant string.
|
|
46
|
+
*/
|
|
47
|
+
PRISM_EXPORTED_FUNCTION const char * pm_version(void);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Initialize a parser with the given start and end pointers.
|
|
51
|
+
*
|
|
52
|
+
* The resulting parser must eventually be freed with `pm_parser_free()`.
|
|
53
|
+
*
|
|
54
|
+
* @param parser The parser to initialize.
|
|
55
|
+
* @param source The source to parse.
|
|
56
|
+
* @param size The size of the source.
|
|
57
|
+
* @param options The optional options to use when parsing. These options must
|
|
58
|
+
* live for the whole lifetime of this parser.
|
|
59
|
+
*
|
|
60
|
+
* \public \memberof pm_parser
|
|
61
|
+
*/
|
|
62
|
+
PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm_options_t *options);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Register a callback that will be called whenever prism changes the encoding
|
|
66
|
+
* it is using to parse based on the magic comment.
|
|
67
|
+
*
|
|
68
|
+
* @param parser The parser to register the callback with.
|
|
69
|
+
* @param callback The callback to register.
|
|
70
|
+
*
|
|
71
|
+
* \public \memberof pm_parser
|
|
72
|
+
*/
|
|
73
|
+
PRISM_EXPORTED_FUNCTION void pm_parser_register_encoding_changed_callback(pm_parser_t *parser, pm_encoding_changed_callback_t callback);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Free any memory associated with the given parser.
|
|
77
|
+
*
|
|
78
|
+
* This does not free the `pm_options_t` object that was used to initialize the
|
|
79
|
+
* parser.
|
|
80
|
+
*
|
|
81
|
+
* @param parser The parser to free.
|
|
82
|
+
*
|
|
83
|
+
* \public \memberof pm_parser
|
|
84
|
+
*/
|
|
85
|
+
PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Initiate the parser with the given parser.
|
|
89
|
+
*
|
|
90
|
+
* @param parser The parser to use.
|
|
91
|
+
* @return The AST representing the source.
|
|
92
|
+
*
|
|
93
|
+
* \public \memberof pm_parser
|
|
94
|
+
*/
|
|
95
|
+
PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse(pm_parser_t *parser);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* This function is used in pm_parse_stream() to retrieve a line of input from a
|
|
99
|
+
* stream. It closely mirrors that of fgets so that fgets can be used as the
|
|
100
|
+
* default implementation.
|
|
101
|
+
*/
|
|
102
|
+
typedef char * (pm_parse_stream_fgets_t)(char *string, int size, void *stream);
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* This function is used in pm_parse_stream to check whether a stream is EOF.
|
|
106
|
+
* It closely mirrors that of feof so that feof can be used as the
|
|
107
|
+
* default implementation.
|
|
108
|
+
*/
|
|
109
|
+
typedef int (pm_parse_stream_feof_t)(void *stream);
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Parse a stream of Ruby source and return the tree.
|
|
113
|
+
*
|
|
114
|
+
* @param parser The parser to use.
|
|
115
|
+
* @param buffer The buffer to use.
|
|
116
|
+
* @param stream The stream to parse.
|
|
117
|
+
* @param stream_fgets The function to use to read from the stream.
|
|
118
|
+
* @param stream_feof The function to use to determine if the stream has hit eof.
|
|
119
|
+
* @param options The optional options to use when parsing.
|
|
120
|
+
* @return The AST representing the source.
|
|
121
|
+
*
|
|
122
|
+
* \public \memberof pm_parser
|
|
123
|
+
*/
|
|
124
|
+
PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof, const pm_options_t *options);
|
|
125
|
+
|
|
126
|
+
// We optionally support serializing to a binary string. For systems that don't
|
|
127
|
+
// want or need this functionality, it can be turned off with the
|
|
128
|
+
// PRISM_EXCLUDE_SERIALIZATION define.
|
|
129
|
+
#ifndef PRISM_EXCLUDE_SERIALIZATION
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Parse and serialize the AST represented by the source that is read out of the
|
|
133
|
+
* given stream into to the given buffer.
|
|
134
|
+
*
|
|
135
|
+
* @param buffer The buffer to serialize to.
|
|
136
|
+
* @param stream The stream to parse.
|
|
137
|
+
* @param stream_fgets The function to use to read from the stream.
|
|
138
|
+
* @param stream_feof The function to use to tell if the stream has hit eof.
|
|
139
|
+
* @param data The optional data to pass to the parser.
|
|
140
|
+
*/
|
|
141
|
+
PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof, const char *data);
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Serialize the given list of comments to the given buffer.
|
|
145
|
+
*
|
|
146
|
+
* @param parser The parser to serialize.
|
|
147
|
+
* @param list The list of comments to serialize.
|
|
148
|
+
* @param buffer The buffer to serialize to.
|
|
149
|
+
*/
|
|
150
|
+
void pm_serialize_comment_list(pm_parser_t *parser, pm_list_t *list, pm_buffer_t *buffer);
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Serialize the name of the encoding to the buffer.
|
|
154
|
+
*
|
|
155
|
+
* @param encoding The encoding to serialize.
|
|
156
|
+
* @param buffer The buffer to serialize to.
|
|
157
|
+
*/
|
|
158
|
+
void pm_serialize_encoding(const pm_encoding_t *encoding, pm_buffer_t *buffer);
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Serialize the encoding, metadata, nodes, and constant pool.
|
|
162
|
+
*
|
|
163
|
+
* @param parser The parser to serialize.
|
|
164
|
+
* @param node The node to serialize.
|
|
165
|
+
* @param buffer The buffer to serialize to.
|
|
166
|
+
*/
|
|
167
|
+
void pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer);
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Serialize the AST represented by the given node to the given buffer.
|
|
171
|
+
*
|
|
172
|
+
* @param parser The parser to serialize.
|
|
173
|
+
* @param node The node to serialize.
|
|
174
|
+
* @param buffer The buffer to serialize to.
|
|
175
|
+
*/
|
|
176
|
+
PRISM_EXPORTED_FUNCTION void pm_serialize(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer);
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Parse the given source to the AST and dump the AST to the given buffer.
|
|
180
|
+
*
|
|
181
|
+
* @param buffer The buffer to serialize to.
|
|
182
|
+
* @param source The source to parse.
|
|
183
|
+
* @param size The size of the source.
|
|
184
|
+
* @param data The optional data to pass to the parser.
|
|
185
|
+
*/
|
|
186
|
+
PRISM_EXPORTED_FUNCTION void pm_serialize_parse(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data);
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Parse and serialize the comments in the given source to the given buffer.
|
|
190
|
+
*
|
|
191
|
+
* @param buffer The buffer to serialize to.
|
|
192
|
+
* @param source The source to parse.
|
|
193
|
+
* @param size The size of the source.
|
|
194
|
+
* @param data The optional data to pass to the parser.
|
|
195
|
+
*/
|
|
196
|
+
PRISM_EXPORTED_FUNCTION void pm_serialize_parse_comments(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data);
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Lex the given source and serialize to the given buffer.
|
|
200
|
+
*
|
|
201
|
+
* @param source The source to lex.
|
|
202
|
+
* @param size The size of the source.
|
|
203
|
+
* @param buffer The buffer to serialize to.
|
|
204
|
+
* @param data The optional data to pass to the lexer.
|
|
205
|
+
*/
|
|
206
|
+
PRISM_EXPORTED_FUNCTION void pm_serialize_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data);
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Parse and serialize both the AST and the tokens represented by the given
|
|
210
|
+
* source to the given buffer.
|
|
211
|
+
*
|
|
212
|
+
* @param buffer The buffer to serialize to.
|
|
213
|
+
* @param source The source to parse.
|
|
214
|
+
* @param size The size of the source.
|
|
215
|
+
* @param data The optional data to pass to the parser.
|
|
216
|
+
*/
|
|
217
|
+
PRISM_EXPORTED_FUNCTION void pm_serialize_parse_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data);
|
|
218
|
+
|
|
219
|
+
#endif
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Parse the source and return true if it parses without errors or warnings.
|
|
223
|
+
*
|
|
224
|
+
* @param source The source to parse.
|
|
225
|
+
* @param size The size of the source.
|
|
226
|
+
* @param data The optional data to pass to the parser.
|
|
227
|
+
* @return True if the source parses without errors or warnings.
|
|
228
|
+
*/
|
|
229
|
+
PRISM_EXPORTED_FUNCTION bool pm_parse_success_p(const uint8_t *source, size_t size, const char *data);
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Returns a string representation of the given token type.
|
|
233
|
+
*
|
|
234
|
+
* @param token_type The token type to convert to a string.
|
|
235
|
+
* @return A string representation of the given token type.
|
|
236
|
+
*/
|
|
237
|
+
PRISM_EXPORTED_FUNCTION const char * pm_token_type_name(pm_token_type_t token_type);
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Returns the human name of the given token type.
|
|
241
|
+
*
|
|
242
|
+
* @param token_type The token type to convert to a human name.
|
|
243
|
+
* @return The human name of the given token type.
|
|
244
|
+
*/
|
|
245
|
+
const char * pm_token_type_human(pm_token_type_t token_type);
|
|
246
|
+
|
|
247
|
+
// We optionally support dumping to JSON. For systems that don't want or need
|
|
248
|
+
// this functionality, it can be turned off with the PRISM_EXCLUDE_JSON define.
|
|
249
|
+
#ifndef PRISM_EXCLUDE_JSON
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Dump JSON to the given buffer.
|
|
253
|
+
*
|
|
254
|
+
* @param buffer The buffer to serialize to.
|
|
255
|
+
* @param parser The parser that parsed the node.
|
|
256
|
+
* @param node The node to serialize.
|
|
257
|
+
*/
|
|
258
|
+
PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *node);
|
|
259
|
+
|
|
260
|
+
#endif
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Represents the results of a slice query.
|
|
264
|
+
*/
|
|
265
|
+
typedef enum {
|
|
266
|
+
/** Returned if the encoding given to a slice query was invalid. */
|
|
267
|
+
PM_STRING_QUERY_ERROR = -1,
|
|
268
|
+
|
|
269
|
+
/** Returned if the result of the slice query is false. */
|
|
270
|
+
PM_STRING_QUERY_FALSE,
|
|
271
|
+
|
|
272
|
+
/** Returned if the result of the slice query is true. */
|
|
273
|
+
PM_STRING_QUERY_TRUE
|
|
274
|
+
} pm_string_query_t;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Check that the slice is a valid local variable name.
|
|
278
|
+
*
|
|
279
|
+
* @param source The source to check.
|
|
280
|
+
* @param length The length of the source.
|
|
281
|
+
* @param encoding_name The name of the encoding of the source.
|
|
282
|
+
* @return PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
|
|
283
|
+
* the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
|
|
284
|
+
*/
|
|
285
|
+
PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_local(const uint8_t *source, size_t length, const char *encoding_name);
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Check that the slice is a valid constant name.
|
|
289
|
+
*
|
|
290
|
+
* @param source The source to check.
|
|
291
|
+
* @param length The length of the source.
|
|
292
|
+
* @param encoding_name The name of the encoding of the source.
|
|
293
|
+
* @return PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
|
|
294
|
+
* the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
|
|
295
|
+
*/
|
|
296
|
+
PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_constant(const uint8_t *source, size_t length, const char *encoding_name);
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Check that the slice is a valid method name.
|
|
300
|
+
*
|
|
301
|
+
* @param source The source to check.
|
|
302
|
+
* @param length The length of the source.
|
|
303
|
+
* @param encoding_name The name of the encoding of the source.
|
|
304
|
+
* @return PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
|
|
305
|
+
* the query is false, and PM_STRING_QUERY_ERROR if the encoding was invalid.
|
|
306
|
+
*/
|
|
307
|
+
PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint8_t *source, size_t length, const char *encoding_name);
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* @mainpage
|
|
311
|
+
*
|
|
312
|
+
* Prism is a parser for the Ruby programming language. It is designed to be
|
|
313
|
+
* portable, error tolerant, and maintainable. It is written in C99 and has no
|
|
314
|
+
* dependencies. It is currently being integrated into
|
|
315
|
+
* [CRuby](https://github.com/ruby/ruby),
|
|
316
|
+
* [JRuby](https://github.com/jruby/jruby),
|
|
317
|
+
* [TruffleRuby](https://github.com/truffleruby/truffleruby),
|
|
318
|
+
* [Sorbet](https://github.com/sorbet/sorbet), and
|
|
319
|
+
* [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree).
|
|
320
|
+
*
|
|
321
|
+
* @section getting-started Getting started
|
|
322
|
+
*
|
|
323
|
+
* If you're vendoring this project and compiling it statically then as long as
|
|
324
|
+
* you have a C99 compiler you will be fine. If you're linking against it as
|
|
325
|
+
* shared library, then you should compile with `-fvisibility=hidden` and
|
|
326
|
+
* `-DPRISM_EXPORT_SYMBOLS` to tell prism to make only its public interface
|
|
327
|
+
* visible.
|
|
328
|
+
*
|
|
329
|
+
* @section parsing Parsing
|
|
330
|
+
*
|
|
331
|
+
* In order to parse Ruby code, the structures and functions that you're going
|
|
332
|
+
* to want to use and be aware of are:
|
|
333
|
+
*
|
|
334
|
+
* * `pm_parser_t` - the main parser structure
|
|
335
|
+
* * `pm_parser_init()` - initialize a parser
|
|
336
|
+
* * `pm_parse()` - parse and return the root node
|
|
337
|
+
* * `pm_node_destroy()` - deallocate the root node returned by `pm_parse()`
|
|
338
|
+
* * `pm_parser_free()` - free the internal memory of the parser
|
|
339
|
+
*
|
|
340
|
+
* Putting all of this together would look something like:
|
|
341
|
+
*
|
|
342
|
+
* ```c
|
|
343
|
+
* void parse(const uint8_t *source, size_t length) {
|
|
344
|
+
* pm_parser_t parser;
|
|
345
|
+
* pm_parser_init(&parser, source, length, NULL);
|
|
346
|
+
*
|
|
347
|
+
* pm_node_t *root = pm_parse(&parser);
|
|
348
|
+
* printf("PARSED!\n");
|
|
349
|
+
*
|
|
350
|
+
* pm_node_destroy(&parser, root);
|
|
351
|
+
* pm_parser_free(&parser);
|
|
352
|
+
* }
|
|
353
|
+
* ```
|
|
354
|
+
*
|
|
355
|
+
* All of the nodes "inherit" from `pm_node_t` by embedding those structures
|
|
356
|
+
* as their first member. This means you can downcast and upcast any node in the
|
|
357
|
+
* tree to a `pm_node_t`.
|
|
358
|
+
*
|
|
359
|
+
* @section serializing Serializing
|
|
360
|
+
*
|
|
361
|
+
* Prism provides the ability to serialize the AST and its related metadata into
|
|
362
|
+
* a binary format. This format is designed to be portable to different
|
|
363
|
+
* languages and runtimes so that you only need to make one FFI call in order to
|
|
364
|
+
* parse Ruby code. The structures and functions that you're going to want to
|
|
365
|
+
* use and be aware of are:
|
|
366
|
+
*
|
|
367
|
+
* * `pm_buffer_t` - a small buffer object that will hold the serialized AST
|
|
368
|
+
* * `pm_buffer_free()` - free the memory associated with the buffer
|
|
369
|
+
* * `pm_serialize()` - serialize the AST into a buffer
|
|
370
|
+
* * `pm_serialize_parse()` - parse and serialize the AST into a buffer
|
|
371
|
+
*
|
|
372
|
+
* Putting all of this together would look something like:
|
|
373
|
+
*
|
|
374
|
+
* ```c
|
|
375
|
+
* void serialize(const uint8_t *source, size_t length) {
|
|
376
|
+
* pm_buffer_t buffer = { 0 };
|
|
377
|
+
*
|
|
378
|
+
* pm_serialize_parse(&buffer, source, length, NULL);
|
|
379
|
+
* printf("SERIALIZED!\n");
|
|
380
|
+
*
|
|
381
|
+
* pm_buffer_free(&buffer);
|
|
382
|
+
* }
|
|
383
|
+
* ```
|
|
384
|
+
*
|
|
385
|
+
* @section inspecting Inspecting
|
|
386
|
+
*
|
|
387
|
+
* Prism provides the ability to inspect the AST by pretty-printing nodes. You
|
|
388
|
+
* can do this with the `pm_prettyprint()` function, which you would use like:
|
|
389
|
+
*
|
|
390
|
+
* ```c
|
|
391
|
+
* void prettyprint(const uint8_t *source, size_t length) {
|
|
392
|
+
* pm_parser_t parser;
|
|
393
|
+
* pm_parser_init(&parser, source, length, NULL);
|
|
394
|
+
*
|
|
395
|
+
* pm_node_t *root = pm_parse(&parser);
|
|
396
|
+
* pm_buffer_t buffer = { 0 };
|
|
397
|
+
*
|
|
398
|
+
* pm_prettyprint(&buffer, &parser, root);
|
|
399
|
+
* printf("%*.s\n", (int) buffer.length, buffer.value);
|
|
400
|
+
*
|
|
401
|
+
* pm_buffer_free(&buffer);
|
|
402
|
+
* pm_node_destroy(&parser, root);
|
|
403
|
+
* pm_parser_free(&parser);
|
|
404
|
+
* }
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
|
|
408
|
+
#endif
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
#include <string.h>
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* This callback is called when a named capture group is found.
|
|
20
|
+
* This callback is called by pm_regexp_parse() when a named capture group is found.
|
|
21
21
|
*/
|
|
22
22
|
typedef void (*pm_regexp_name_callback_t)(const pm_string_t *name, void *data);
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* This callback is called when a parse error is found.
|
|
25
|
+
* This callback is called by pm_regexp_parse() when a parse error is found.
|
|
26
26
|
*/
|
|
27
27
|
typedef void (*pm_regexp_error_callback_t)(const uint8_t *start, const uint8_t *end, const char *message, void *data);
|
|
28
28
|
|
data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_buffer.h
RENAMED
|
@@ -51,6 +51,8 @@ bool pm_buffer_init_capacity(pm_buffer_t *buffer, size_t capacity);
|
|
|
51
51
|
*
|
|
52
52
|
* @param buffer The buffer to initialize.
|
|
53
53
|
* @returns True if the buffer was initialized successfully, false otherwise.
|
|
54
|
+
*
|
|
55
|
+
* \public \memberof pm_buffer_t
|
|
54
56
|
*/
|
|
55
57
|
PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer);
|
|
56
58
|
|
|
@@ -59,6 +61,8 @@ PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer);
|
|
|
59
61
|
*
|
|
60
62
|
* @param buffer The buffer to get the value of.
|
|
61
63
|
* @returns The value of the buffer.
|
|
64
|
+
*
|
|
65
|
+
* \public \memberof pm_buffer_t
|
|
62
66
|
*/
|
|
63
67
|
PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer);
|
|
64
68
|
|
|
@@ -67,6 +71,8 @@ PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer);
|
|
|
67
71
|
*
|
|
68
72
|
* @param buffer The buffer to get the length of.
|
|
69
73
|
* @returns The length of the buffer.
|
|
74
|
+
*
|
|
75
|
+
* \public \memberof pm_buffer_t
|
|
70
76
|
*/
|
|
71
77
|
PRISM_EXPORTED_FUNCTION size_t pm_buffer_length(const pm_buffer_t *buffer);
|
|
72
78
|
|
|
@@ -222,6 +228,8 @@ void pm_buffer_insert(pm_buffer_t *buffer, size_t index, const char *value, size
|
|
|
222
228
|
* Free the memory associated with the buffer.
|
|
223
229
|
*
|
|
224
230
|
* @param buffer The buffer to free.
|
|
231
|
+
*
|
|
232
|
+
* \public \memberof pm_buffer_t
|
|
225
233
|
*/
|
|
226
234
|
PRISM_EXPORTED_FUNCTION void pm_buffer_free(pm_buffer_t *buffer);
|
|
227
235
|
|
data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_integer.h
RENAMED
|
@@ -112,6 +112,8 @@ void pm_integers_reduce(pm_integer_t *numerator, pm_integer_t *denominator);
|
|
|
112
112
|
*
|
|
113
113
|
* @param buffer The buffer to append the string to.
|
|
114
114
|
* @param integer The integer to convert to a string.
|
|
115
|
+
*
|
|
116
|
+
* \public \memberof pm_integer_t
|
|
115
117
|
*/
|
|
116
118
|
PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_integer_t *integer);
|
|
117
119
|
|
|
@@ -120,6 +122,8 @@ PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_int
|
|
|
120
122
|
* the integer exceeds the size of a single node in the linked list.
|
|
121
123
|
*
|
|
122
124
|
* @param integer The integer to free.
|
|
125
|
+
*
|
|
126
|
+
* \public \memberof pm_integer_t
|
|
123
127
|
*/
|
|
124
128
|
PRISM_EXPORTED_FUNCTION void pm_integer_free(pm_integer_t *integer);
|
|
125
129
|
|
data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_list.h
RENAMED
|
@@ -68,6 +68,8 @@ typedef struct {
|
|
|
68
68
|
*
|
|
69
69
|
* @param list The list to check.
|
|
70
70
|
* @return True if the given list is empty, otherwise false.
|
|
71
|
+
*
|
|
72
|
+
* \public \memberof pm_list_t
|
|
71
73
|
*/
|
|
72
74
|
PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list);
|
|
73
75
|
|
|
@@ -76,6 +78,8 @@ PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list);
|
|
|
76
78
|
*
|
|
77
79
|
* @param list The list to check.
|
|
78
80
|
* @return The size of the list.
|
|
81
|
+
*
|
|
82
|
+
* \public \memberof pm_list_t
|
|
79
83
|
*/
|
|
80
84
|
PRISM_EXPORTED_FUNCTION size_t pm_list_size(pm_list_t *list);
|
|
81
85
|
|
|
@@ -91,6 +95,8 @@ void pm_list_append(pm_list_t *list, pm_list_node_t *node);
|
|
|
91
95
|
* Deallocate the internal state of the given list.
|
|
92
96
|
*
|
|
93
97
|
* @param list The list to free.
|
|
98
|
+
*
|
|
99
|
+
* \public \memberof pm_list_t
|
|
94
100
|
*/
|
|
95
101
|
PRISM_EXPORTED_FUNCTION void pm_list_free(pm_list_t *list);
|
|
96
102
|
|
data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_string.h
RENAMED
|
@@ -45,11 +45,11 @@ typedef struct {
|
|
|
45
45
|
/** This is a slice of another string, and should not be freed. */
|
|
46
46
|
PM_STRING_SHARED,
|
|
47
47
|
|
|
48
|
-
/** This string owns its memory, and should be freed using `pm_string_free`. */
|
|
48
|
+
/** This string owns its memory, and should be freed using `pm_string_free()`. */
|
|
49
49
|
PM_STRING_OWNED,
|
|
50
50
|
|
|
51
51
|
#ifdef PRISM_HAS_MMAP
|
|
52
|
-
/** This string is a memory-mapped file, and should be freed using `pm_string_free`. */
|
|
52
|
+
/** This string is a memory-mapped file, and should be freed using `pm_string_free()`. */
|
|
53
53
|
PM_STRING_MAPPED
|
|
54
54
|
#endif
|
|
55
55
|
} type;
|
|
@@ -130,6 +130,8 @@ typedef enum {
|
|
|
130
130
|
* @param string The string to initialize.
|
|
131
131
|
* @param filepath The filepath to read.
|
|
132
132
|
* @return The success of the read, indicated by the value of the enum.
|
|
133
|
+
*
|
|
134
|
+
* \public \memberof pm_string_t
|
|
133
135
|
*/
|
|
134
136
|
PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_mapped_init(pm_string_t *string, const char *filepath);
|
|
135
137
|
|
|
@@ -141,6 +143,8 @@ PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_mapped_init(pm_string_
|
|
|
141
143
|
* @param string The string to initialize.
|
|
142
144
|
* @param filepath The filepath to read.
|
|
143
145
|
* @return The success of the read, indicated by the value of the enum.
|
|
146
|
+
*
|
|
147
|
+
* \public \memberof pm_string_t
|
|
144
148
|
*/
|
|
145
149
|
PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_file_init(pm_string_t *string, const char *filepath);
|
|
146
150
|
|
|
@@ -169,6 +173,8 @@ int pm_string_compare(const pm_string_t *left, const pm_string_t *right);
|
|
|
169
173
|
*
|
|
170
174
|
* @param string The string to get the length of.
|
|
171
175
|
* @return The length of the string.
|
|
176
|
+
*
|
|
177
|
+
* \public \memberof pm_string_t
|
|
172
178
|
*/
|
|
173
179
|
PRISM_EXPORTED_FUNCTION size_t pm_string_length(const pm_string_t *string);
|
|
174
180
|
|
|
@@ -177,6 +183,8 @@ PRISM_EXPORTED_FUNCTION size_t pm_string_length(const pm_string_t *string);
|
|
|
177
183
|
*
|
|
178
184
|
* @param string The string to get the start pointer of.
|
|
179
185
|
* @return The start pointer of the string.
|
|
186
|
+
*
|
|
187
|
+
* \public \memberof pm_string_t
|
|
180
188
|
*/
|
|
181
189
|
PRISM_EXPORTED_FUNCTION const uint8_t * pm_string_source(const pm_string_t *string);
|
|
182
190
|
|
|
@@ -184,6 +192,8 @@ PRISM_EXPORTED_FUNCTION const uint8_t * pm_string_source(const pm_string_t *stri
|
|
|
184
192
|
* Free the associated memory of the given string.
|
|
185
193
|
*
|
|
186
194
|
* @param string The string to free.
|
|
195
|
+
*
|
|
196
|
+
* \public \memberof pm_string_t
|
|
187
197
|
*/
|
|
188
198
|
PRISM_EXPORTED_FUNCTION void pm_string_free(pm_string_t *string);
|
|
189
199
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/**
|
|
15
15
|
* The minor version of the Prism library as an int.
|
|
16
16
|
*/
|
|
17
|
-
#define PRISM_VERSION_MINOR
|
|
17
|
+
#define PRISM_VERSION_MINOR 7
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* The patch version of the Prism library as an int.
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
/**
|
|
25
25
|
* The version of the Prism library as a constant string.
|
|
26
26
|
*/
|
|
27
|
-
#define PRISM_VERSION "1.
|
|
27
|
+
#define PRISM_VERSION "1.7.0"
|
|
28
28
|
|
|
29
29
|
#endif
|
|
@@ -94,6 +94,7 @@ VALUE pm_parse_file(pm_parse_result_t *result, VALUE filepath, VALUE *script_lin
|
|
|
94
94
|
VALUE pm_load_parse_file(pm_parse_result_t *result, VALUE filepath, VALUE *script_lines);
|
|
95
95
|
VALUE pm_parse_string(pm_parse_result_t *result, VALUE source, VALUE filepath, VALUE *script_lines);
|
|
96
96
|
VALUE pm_parse_stdin(pm_parse_result_t *result);
|
|
97
|
+
void pm_options_version_for_current_ruby_set(pm_options_t *options);
|
|
97
98
|
void pm_parse_result_free(pm_parse_result_t *result);
|
|
98
99
|
|
|
99
100
|
rb_iseq_t *pm_iseq_new(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum rb_iseq_type, int *error_state);
|