@coana-tech/cli 14.12.76 → 14.12.77
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.
- package/cli.mjs +1 -1
- package/package.json +1 -1
- package/reachability-analyzers-cli.mjs +1 -1
- package/repos/coana-tech/alucard/alucard.jar +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/cli.mjs +24669 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/LICENSE.md +9 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/README.md +95 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/common.gypi +21 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/except.gypi +25 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/index.js +14 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/napi-inl.h +6941 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/napi.h +3295 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/node_addon_api.gyp +42 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/node_api.gyp +9 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/noexcept.gypi +26 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/nothing.c +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/package-support.json +21 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/package.json +480 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/tools/README.md +73 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/tools/check-napi.js +99 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/tools/clang-format.js +71 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/tools/conversion.js +301 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/LICENSE +21 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/README.md +58 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/SECURITY.md +5 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/bin.js +84 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/build-test.js +19 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/index.js +6 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/node-gyp-build.js +207 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/optional.js +7 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/package.json +43 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/LICENSE +21 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/README.md +128 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/binding.gyp +80 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/index.js +919 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/node_modules/.bin/node-gyp-build +16 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/node_modules/.bin/node-gyp-build-optional +16 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/node_modules/.bin/node-gyp-build-test +16 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/package.json +76 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/linux-arm64/tree-sitter.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/win32-arm64/tree-sitter.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/addon_data.h +47 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/binding.cc +35 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/conversions.cc +140 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/conversions.h +22 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/language.cc +106 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/language.h +17 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/logger.cc +70 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/logger.h +19 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/node.cc +1088 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/node.h +30 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/parser.cc +306 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/parser.h +35 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/query.cc +397 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/query.h +40 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/tree.cc +316 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/tree.h +45 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/tree_cursor.h +52 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/tree-sitter.d.ts +1042 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1318 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +291 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +501 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +223 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +297 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +435 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +12 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +920 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2165 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +266 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/portable/endian.h +206 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4187 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +130 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1066 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +399 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +170 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +712 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/ts_assert.h +11 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +83 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +24 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +109 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1302 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1859 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/LICENSE +22 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/README.md +21 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/binding.gyp +30 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/bindings/node/binding.cc +20 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/bindings/node/binding_test.js +9 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/bindings/node/index.d.ts +28 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/bindings/node/index.js +11 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/grammar.js +1281 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/node_modules/.bin/node-gyp-build +16 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/node_modules/.bin/node-gyp-build-optional +16 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/node_modules/.bin/node-gyp-build-test +16 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/package.json +77 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/prebuilds/darwin-arm64/tree-sitter-ruby.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/prebuilds/darwin-x64/tree-sitter-ruby.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/prebuilds/linux-arm64/tree-sitter-ruby.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/prebuilds/linux-x64/tree-sitter-ruby.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/prebuilds/win32-arm64/tree-sitter-ruby.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/prebuilds/win32-x64/tree-sitter-ruby.node +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/queries/highlights.scm +154 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/queries/locals.scm +27 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/queries/tags.scm +64 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/grammar.json +8364 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/node-types.json +4108 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/parser.c +471247 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/scanner.c +1107 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/tree_sitter/alloc.h +54 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/tree_sitter/array.h +290 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/tree_sitter/parser.h +266 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/tree-sitter-ruby.wasm +0 -0
- package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/tree-sitter.json +46 -0
- package/repos/coana-tech/goana/bin/goana-darwin-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-darwin-arm64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-arm64.gz +0 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
#ifndef TREE_SITTER_SUBTREE_H_
|
|
2
|
+
#define TREE_SITTER_SUBTREE_H_
|
|
3
|
+
|
|
4
|
+
#ifdef __cplusplus
|
|
5
|
+
extern "C" {
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#include <limits.h>
|
|
9
|
+
#include <stdbool.h>
|
|
10
|
+
#include <stdio.h>
|
|
11
|
+
#include "./length.h"
|
|
12
|
+
#include "./array.h"
|
|
13
|
+
#include "./error_costs.h"
|
|
14
|
+
#include "./host.h"
|
|
15
|
+
#include "tree_sitter/api.h"
|
|
16
|
+
#include "./parser.h"
|
|
17
|
+
|
|
18
|
+
#define TS_TREE_STATE_NONE USHRT_MAX
|
|
19
|
+
#define NULL_SUBTREE ((Subtree) {.ptr = NULL})
|
|
20
|
+
|
|
21
|
+
// The serialized state of an external scanner.
|
|
22
|
+
//
|
|
23
|
+
// Every time an external token subtree is created after a call to an
|
|
24
|
+
// external scanner, the scanner's `serialize` function is called to
|
|
25
|
+
// retrieve a serialized copy of its state. The bytes are then copied
|
|
26
|
+
// onto the subtree itself so that the scanner's state can later be
|
|
27
|
+
// restored using its `deserialize` function.
|
|
28
|
+
//
|
|
29
|
+
// Small byte arrays are stored inline, and long ones are allocated
|
|
30
|
+
// separately on the heap.
|
|
31
|
+
typedef struct {
|
|
32
|
+
union {
|
|
33
|
+
char *long_data;
|
|
34
|
+
char short_data[24];
|
|
35
|
+
};
|
|
36
|
+
uint32_t length;
|
|
37
|
+
} ExternalScannerState;
|
|
38
|
+
|
|
39
|
+
// A compact representation of a subtree.
|
|
40
|
+
//
|
|
41
|
+
// This representation is used for small leaf nodes that are not
|
|
42
|
+
// errors, and were not created by an external scanner.
|
|
43
|
+
//
|
|
44
|
+
// The idea behind the layout of this struct is that the `is_inline`
|
|
45
|
+
// bit will fall exactly into the same location as the least significant
|
|
46
|
+
// bit of the pointer in `Subtree` or `MutableSubtree`, respectively.
|
|
47
|
+
// Because of alignment, for any valid pointer this will be 0, giving
|
|
48
|
+
// us the opportunity to make use of this bit to signify whether to use
|
|
49
|
+
// the pointer or the inline struct.
|
|
50
|
+
typedef struct SubtreeInlineData SubtreeInlineData;
|
|
51
|
+
|
|
52
|
+
#define SUBTREE_BITS \
|
|
53
|
+
bool visible : 1; \
|
|
54
|
+
bool named : 1; \
|
|
55
|
+
bool extra : 1; \
|
|
56
|
+
bool has_changes : 1; \
|
|
57
|
+
bool is_missing : 1; \
|
|
58
|
+
bool is_keyword : 1;
|
|
59
|
+
|
|
60
|
+
#define SUBTREE_SIZE \
|
|
61
|
+
uint8_t padding_columns; \
|
|
62
|
+
uint8_t padding_rows : 4; \
|
|
63
|
+
uint8_t lookahead_bytes : 4; \
|
|
64
|
+
uint8_t padding_bytes; \
|
|
65
|
+
uint8_t size_bytes;
|
|
66
|
+
|
|
67
|
+
#if TS_BIG_ENDIAN
|
|
68
|
+
#if TS_PTR_SIZE == 32
|
|
69
|
+
|
|
70
|
+
struct SubtreeInlineData {
|
|
71
|
+
uint16_t parse_state;
|
|
72
|
+
uint8_t symbol;
|
|
73
|
+
SUBTREE_BITS
|
|
74
|
+
bool unused : 1;
|
|
75
|
+
bool is_inline : 1;
|
|
76
|
+
SUBTREE_SIZE
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
#else
|
|
80
|
+
|
|
81
|
+
struct SubtreeInlineData {
|
|
82
|
+
SUBTREE_SIZE
|
|
83
|
+
uint16_t parse_state;
|
|
84
|
+
uint8_t symbol;
|
|
85
|
+
SUBTREE_BITS
|
|
86
|
+
bool unused : 1;
|
|
87
|
+
bool is_inline : 1;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
#endif
|
|
91
|
+
#else
|
|
92
|
+
|
|
93
|
+
struct SubtreeInlineData {
|
|
94
|
+
bool is_inline : 1;
|
|
95
|
+
SUBTREE_BITS
|
|
96
|
+
uint8_t symbol;
|
|
97
|
+
uint16_t parse_state;
|
|
98
|
+
SUBTREE_SIZE
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
#endif
|
|
102
|
+
|
|
103
|
+
#undef SUBTREE_BITS
|
|
104
|
+
#undef SUBTREE_SIZE
|
|
105
|
+
|
|
106
|
+
// A heap-allocated representation of a subtree.
|
|
107
|
+
//
|
|
108
|
+
// This representation is used for parent nodes, external tokens,
|
|
109
|
+
// errors, and other leaf nodes whose data is too large to fit into
|
|
110
|
+
// the inline representation.
|
|
111
|
+
typedef struct {
|
|
112
|
+
volatile uint32_t ref_count;
|
|
113
|
+
Length padding;
|
|
114
|
+
Length size;
|
|
115
|
+
uint32_t lookahead_bytes;
|
|
116
|
+
uint32_t error_cost;
|
|
117
|
+
uint32_t child_count;
|
|
118
|
+
TSSymbol symbol;
|
|
119
|
+
TSStateId parse_state;
|
|
120
|
+
|
|
121
|
+
bool visible : 1;
|
|
122
|
+
bool named : 1;
|
|
123
|
+
bool extra : 1;
|
|
124
|
+
bool fragile_left : 1;
|
|
125
|
+
bool fragile_right : 1;
|
|
126
|
+
bool has_changes : 1;
|
|
127
|
+
bool has_external_tokens : 1;
|
|
128
|
+
bool has_external_scanner_state_change : 1;
|
|
129
|
+
bool depends_on_column: 1;
|
|
130
|
+
bool is_missing : 1;
|
|
131
|
+
bool is_keyword : 1;
|
|
132
|
+
|
|
133
|
+
union {
|
|
134
|
+
// Non-terminal subtrees (`child_count > 0`)
|
|
135
|
+
struct {
|
|
136
|
+
uint32_t visible_child_count;
|
|
137
|
+
uint32_t named_child_count;
|
|
138
|
+
uint32_t visible_descendant_count;
|
|
139
|
+
int32_t dynamic_precedence;
|
|
140
|
+
uint16_t repeat_depth;
|
|
141
|
+
uint16_t production_id;
|
|
142
|
+
struct {
|
|
143
|
+
TSSymbol symbol;
|
|
144
|
+
TSStateId parse_state;
|
|
145
|
+
} first_leaf;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// External terminal subtrees (`child_count == 0 && has_external_tokens`)
|
|
149
|
+
ExternalScannerState external_scanner_state;
|
|
150
|
+
|
|
151
|
+
// Error terminal subtrees (`child_count == 0 && symbol == ts_builtin_sym_error`)
|
|
152
|
+
int32_t lookahead_char;
|
|
153
|
+
};
|
|
154
|
+
} SubtreeHeapData;
|
|
155
|
+
|
|
156
|
+
// The fundamental building block of a syntax tree.
|
|
157
|
+
typedef union {
|
|
158
|
+
SubtreeInlineData data;
|
|
159
|
+
const SubtreeHeapData *ptr;
|
|
160
|
+
} Subtree;
|
|
161
|
+
|
|
162
|
+
// Like Subtree, but mutable.
|
|
163
|
+
typedef union {
|
|
164
|
+
SubtreeInlineData data;
|
|
165
|
+
SubtreeHeapData *ptr;
|
|
166
|
+
} MutableSubtree;
|
|
167
|
+
|
|
168
|
+
typedef Array(Subtree) SubtreeArray;
|
|
169
|
+
typedef Array(MutableSubtree) MutableSubtreeArray;
|
|
170
|
+
|
|
171
|
+
typedef struct {
|
|
172
|
+
MutableSubtreeArray free_trees;
|
|
173
|
+
MutableSubtreeArray tree_stack;
|
|
174
|
+
} SubtreePool;
|
|
175
|
+
|
|
176
|
+
void ts_external_scanner_state_init(ExternalScannerState *self, const char *data, unsigned length);
|
|
177
|
+
const char *ts_external_scanner_state_data(const ExternalScannerState *self);
|
|
178
|
+
bool ts_external_scanner_state_eq(const ExternalScannerState *self, const char *buffer, unsigned length);
|
|
179
|
+
void ts_external_scanner_state_delete(ExternalScannerState *self);
|
|
180
|
+
|
|
181
|
+
void ts_subtree_array_copy(SubtreeArray self, SubtreeArray *dest);
|
|
182
|
+
void ts_subtree_array_clear(SubtreePool *pool, SubtreeArray *self);
|
|
183
|
+
void ts_subtree_array_delete(SubtreePool *pool, SubtreeArray *self);
|
|
184
|
+
void ts_subtree_array_remove_trailing_extras(SubtreeArray *self, SubtreeArray *destination);
|
|
185
|
+
void ts_subtree_array_reverse(SubtreeArray *self);
|
|
186
|
+
|
|
187
|
+
SubtreePool ts_subtree_pool_new(uint32_t capacity);
|
|
188
|
+
void ts_subtree_pool_delete(SubtreePool *self);
|
|
189
|
+
|
|
190
|
+
Subtree ts_subtree_new_leaf(
|
|
191
|
+
SubtreePool *pool, TSSymbol symbol, Length padding, Length size,
|
|
192
|
+
uint32_t lookahead_bytes, TSStateId parse_state,
|
|
193
|
+
bool has_external_tokens, bool depends_on_column,
|
|
194
|
+
bool is_keyword, const TSLanguage *language
|
|
195
|
+
);
|
|
196
|
+
Subtree ts_subtree_new_error(
|
|
197
|
+
SubtreePool *pool, int32_t lookahead_char, Length padding, Length size,
|
|
198
|
+
uint32_t bytes_scanned, TSStateId parse_state, const TSLanguage *language
|
|
199
|
+
);
|
|
200
|
+
MutableSubtree ts_subtree_new_node(
|
|
201
|
+
TSSymbol symbol,
|
|
202
|
+
SubtreeArray *chiildren,
|
|
203
|
+
unsigned production_id,
|
|
204
|
+
const TSLanguage *language
|
|
205
|
+
);
|
|
206
|
+
Subtree ts_subtree_new_error_node(
|
|
207
|
+
SubtreeArray *children,
|
|
208
|
+
bool extra,
|
|
209
|
+
const TSLanguage * language
|
|
210
|
+
);
|
|
211
|
+
Subtree ts_subtree_new_missing_leaf(
|
|
212
|
+
SubtreePool *pool,
|
|
213
|
+
TSSymbol symbol,
|
|
214
|
+
Length padding,
|
|
215
|
+
uint32_t lookahead_bytes,
|
|
216
|
+
const TSLanguage *language
|
|
217
|
+
);
|
|
218
|
+
MutableSubtree ts_subtree_make_mut(SubtreePool *pool, Subtree self);
|
|
219
|
+
void ts_subtree_retain(Subtree self);
|
|
220
|
+
void ts_subtree_release(SubtreePool *pool, Subtree self);
|
|
221
|
+
int ts_subtree_compare(Subtree left, Subtree right, SubtreePool *pool);
|
|
222
|
+
void ts_subtree_set_symbol(MutableSubtree *self, TSSymbol symbol, const TSLanguage *language);
|
|
223
|
+
void ts_subtree_summarize_children(MutableSubtree self, const TSLanguage *language);
|
|
224
|
+
void ts_subtree_balance(Subtree self, SubtreePool *pool, const TSLanguage *language);
|
|
225
|
+
Subtree ts_subtree_edit(Subtree self, const TSInputEdit *edit, SubtreePool *pool);
|
|
226
|
+
char *ts_subtree_string(Subtree self, TSSymbol alias_symbol, bool alias_is_named, const TSLanguage *language, bool include_all);
|
|
227
|
+
void ts_subtree_print_dot_graph(Subtree self, const TSLanguage *language, FILE *f);
|
|
228
|
+
Subtree ts_subtree_last_external_token(Subtree tree);
|
|
229
|
+
const ExternalScannerState *ts_subtree_external_scanner_state(Subtree self);
|
|
230
|
+
bool ts_subtree_external_scanner_state_eq(Subtree self, Subtree other);
|
|
231
|
+
|
|
232
|
+
#define SUBTREE_GET(self, name) ((self).data.is_inline ? (self).data.name : (self).ptr->name)
|
|
233
|
+
|
|
234
|
+
static inline TSSymbol ts_subtree_symbol(Subtree self) { return SUBTREE_GET(self, symbol); }
|
|
235
|
+
static inline bool ts_subtree_visible(Subtree self) { return SUBTREE_GET(self, visible); }
|
|
236
|
+
static inline bool ts_subtree_named(Subtree self) { return SUBTREE_GET(self, named); }
|
|
237
|
+
static inline bool ts_subtree_extra(Subtree self) { return SUBTREE_GET(self, extra); }
|
|
238
|
+
static inline bool ts_subtree_has_changes(Subtree self) { return SUBTREE_GET(self, has_changes); }
|
|
239
|
+
static inline bool ts_subtree_missing(Subtree self) { return SUBTREE_GET(self, is_missing); }
|
|
240
|
+
static inline bool ts_subtree_is_keyword(Subtree self) { return SUBTREE_GET(self, is_keyword); }
|
|
241
|
+
static inline TSStateId ts_subtree_parse_state(Subtree self) { return SUBTREE_GET(self, parse_state); }
|
|
242
|
+
static inline uint32_t ts_subtree_lookahead_bytes(Subtree self) { return SUBTREE_GET(self, lookahead_bytes); }
|
|
243
|
+
|
|
244
|
+
#undef SUBTREE_GET
|
|
245
|
+
|
|
246
|
+
// Get the size needed to store a heap-allocated subtree with the given
|
|
247
|
+
// number of children.
|
|
248
|
+
static inline size_t ts_subtree_alloc_size(uint32_t child_count) {
|
|
249
|
+
return child_count * sizeof(Subtree) + sizeof(SubtreeHeapData);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Get a subtree's children, which are allocated immediately before the
|
|
253
|
+
// tree's own heap data.
|
|
254
|
+
#define ts_subtree_children(self) \
|
|
255
|
+
((self).data.is_inline ? NULL : (Subtree *)((self).ptr) - (self).ptr->child_count)
|
|
256
|
+
|
|
257
|
+
static inline void ts_subtree_set_extra(MutableSubtree *self, bool is_extra) {
|
|
258
|
+
if (self->data.is_inline) {
|
|
259
|
+
self->data.extra = is_extra;
|
|
260
|
+
} else {
|
|
261
|
+
self->ptr->extra = is_extra;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
static inline TSSymbol ts_subtree_leaf_symbol(Subtree self) {
|
|
266
|
+
if (self.data.is_inline) return self.data.symbol;
|
|
267
|
+
if (self.ptr->child_count == 0) return self.ptr->symbol;
|
|
268
|
+
return self.ptr->first_leaf.symbol;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
static inline TSStateId ts_subtree_leaf_parse_state(Subtree self) {
|
|
272
|
+
if (self.data.is_inline) return self.data.parse_state;
|
|
273
|
+
if (self.ptr->child_count == 0) return self.ptr->parse_state;
|
|
274
|
+
return self.ptr->first_leaf.parse_state;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
static inline Length ts_subtree_padding(Subtree self) {
|
|
278
|
+
if (self.data.is_inline) {
|
|
279
|
+
Length result = {self.data.padding_bytes, {self.data.padding_rows, self.data.padding_columns}};
|
|
280
|
+
return result;
|
|
281
|
+
} else {
|
|
282
|
+
return self.ptr->padding;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
static inline Length ts_subtree_size(Subtree self) {
|
|
287
|
+
if (self.data.is_inline) {
|
|
288
|
+
Length result = {self.data.size_bytes, {0, self.data.size_bytes}};
|
|
289
|
+
return result;
|
|
290
|
+
} else {
|
|
291
|
+
return self.ptr->size;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
static inline Length ts_subtree_total_size(Subtree self) {
|
|
296
|
+
return length_add(ts_subtree_padding(self), ts_subtree_size(self));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
static inline uint32_t ts_subtree_total_bytes(Subtree self) {
|
|
300
|
+
return ts_subtree_total_size(self).bytes;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
static inline uint32_t ts_subtree_child_count(Subtree self) {
|
|
304
|
+
return self.data.is_inline ? 0 : self.ptr->child_count;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
static inline uint32_t ts_subtree_repeat_depth(Subtree self) {
|
|
308
|
+
return self.data.is_inline ? 0 : self.ptr->repeat_depth;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
static inline uint32_t ts_subtree_is_repetition(Subtree self) {
|
|
312
|
+
return self.data.is_inline
|
|
313
|
+
? 0
|
|
314
|
+
: !self.ptr->named && !self.ptr->visible && self.ptr->child_count != 0;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
static inline uint32_t ts_subtree_visible_descendant_count(Subtree self) {
|
|
318
|
+
return (self.data.is_inline || self.ptr->child_count == 0)
|
|
319
|
+
? 0
|
|
320
|
+
: self.ptr->visible_descendant_count;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
static inline uint32_t ts_subtree_visible_child_count(Subtree self) {
|
|
324
|
+
if (ts_subtree_child_count(self) > 0) {
|
|
325
|
+
return self.ptr->visible_child_count;
|
|
326
|
+
} else {
|
|
327
|
+
return 0;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
static inline uint32_t ts_subtree_error_cost(Subtree self) {
|
|
332
|
+
if (ts_subtree_missing(self)) {
|
|
333
|
+
return ERROR_COST_PER_MISSING_TREE + ERROR_COST_PER_RECOVERY;
|
|
334
|
+
} else {
|
|
335
|
+
return self.data.is_inline ? 0 : self.ptr->error_cost;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
static inline int32_t ts_subtree_dynamic_precedence(Subtree self) {
|
|
340
|
+
return (self.data.is_inline || self.ptr->child_count == 0) ? 0 : self.ptr->dynamic_precedence;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
static inline uint16_t ts_subtree_production_id(Subtree self) {
|
|
344
|
+
if (ts_subtree_child_count(self) > 0) {
|
|
345
|
+
return self.ptr->production_id;
|
|
346
|
+
} else {
|
|
347
|
+
return 0;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
static inline bool ts_subtree_fragile_left(Subtree self) {
|
|
352
|
+
return self.data.is_inline ? false : self.ptr->fragile_left;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
static inline bool ts_subtree_fragile_right(Subtree self) {
|
|
356
|
+
return self.data.is_inline ? false : self.ptr->fragile_right;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
static inline bool ts_subtree_has_external_tokens(Subtree self) {
|
|
360
|
+
return self.data.is_inline ? false : self.ptr->has_external_tokens;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
static inline bool ts_subtree_has_external_scanner_state_change(Subtree self) {
|
|
364
|
+
return self.data.is_inline ? false : self.ptr->has_external_scanner_state_change;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
static inline bool ts_subtree_depends_on_column(Subtree self) {
|
|
368
|
+
return self.data.is_inline ? false : self.ptr->depends_on_column;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
static inline bool ts_subtree_is_fragile(Subtree self) {
|
|
372
|
+
return self.data.is_inline ? false : (self.ptr->fragile_left || self.ptr->fragile_right);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
static inline bool ts_subtree_is_error(Subtree self) {
|
|
376
|
+
return ts_subtree_symbol(self) == ts_builtin_sym_error;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
static inline bool ts_subtree_is_eof(Subtree self) {
|
|
380
|
+
return ts_subtree_symbol(self) == ts_builtin_sym_end;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
static inline Subtree ts_subtree_from_mut(MutableSubtree self) {
|
|
384
|
+
Subtree result;
|
|
385
|
+
result.data = self.data;
|
|
386
|
+
return result;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
static inline MutableSubtree ts_subtree_to_mut_unsafe(Subtree self) {
|
|
390
|
+
MutableSubtree result;
|
|
391
|
+
result.data = self.data;
|
|
392
|
+
return result;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
#ifdef __cplusplus
|
|
396
|
+
}
|
|
397
|
+
#endif
|
|
398
|
+
|
|
399
|
+
#endif // TREE_SITTER_SUBTREE_H_
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
#include "tree_sitter/api.h"
|
|
2
|
+
#include "./array.h"
|
|
3
|
+
#include "./get_changed_ranges.h"
|
|
4
|
+
#include "./length.h"
|
|
5
|
+
#include "./subtree.h"
|
|
6
|
+
#include "./tree_cursor.h"
|
|
7
|
+
#include "./tree.h"
|
|
8
|
+
|
|
9
|
+
TSTree *ts_tree_new(
|
|
10
|
+
Subtree root, const TSLanguage *language,
|
|
11
|
+
const TSRange *included_ranges, unsigned included_range_count
|
|
12
|
+
) {
|
|
13
|
+
TSTree *result = ts_malloc(sizeof(TSTree));
|
|
14
|
+
result->root = root;
|
|
15
|
+
result->language = ts_language_copy(language);
|
|
16
|
+
result->included_ranges = ts_calloc(included_range_count, sizeof(TSRange));
|
|
17
|
+
memcpy(result->included_ranges, included_ranges, included_range_count * sizeof(TSRange));
|
|
18
|
+
result->included_range_count = included_range_count;
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
TSTree *ts_tree_copy(const TSTree *self) {
|
|
23
|
+
ts_subtree_retain(self->root);
|
|
24
|
+
return ts_tree_new(self->root, self->language, self->included_ranges, self->included_range_count);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
void ts_tree_delete(TSTree *self) {
|
|
28
|
+
if (!self) return;
|
|
29
|
+
|
|
30
|
+
SubtreePool pool = ts_subtree_pool_new(0);
|
|
31
|
+
ts_subtree_release(&pool, self->root);
|
|
32
|
+
ts_subtree_pool_delete(&pool);
|
|
33
|
+
ts_language_delete(self->language);
|
|
34
|
+
ts_free(self->included_ranges);
|
|
35
|
+
ts_free(self);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
TSNode ts_tree_root_node(const TSTree *self) {
|
|
39
|
+
return ts_node_new(self, &self->root, ts_subtree_padding(self->root), 0);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
TSNode ts_tree_root_node_with_offset(
|
|
43
|
+
const TSTree *self,
|
|
44
|
+
uint32_t offset_bytes,
|
|
45
|
+
TSPoint offset_extent
|
|
46
|
+
) {
|
|
47
|
+
Length offset = {offset_bytes, offset_extent};
|
|
48
|
+
return ts_node_new(self, &self->root, length_add(offset, ts_subtree_padding(self->root)), 0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const TSLanguage *ts_tree_language(const TSTree *self) {
|
|
52
|
+
return self->language;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
void ts_tree_edit(TSTree *self, const TSInputEdit *edit) {
|
|
56
|
+
for (unsigned i = 0; i < self->included_range_count; i++) {
|
|
57
|
+
TSRange *range = &self->included_ranges[i];
|
|
58
|
+
if (range->end_byte >= edit->old_end_byte) {
|
|
59
|
+
if (range->end_byte != UINT32_MAX) {
|
|
60
|
+
range->end_byte = edit->new_end_byte + (range->end_byte - edit->old_end_byte);
|
|
61
|
+
range->end_point = point_add(
|
|
62
|
+
edit->new_end_point,
|
|
63
|
+
point_sub(range->end_point, edit->old_end_point)
|
|
64
|
+
);
|
|
65
|
+
if (range->end_byte < edit->new_end_byte) {
|
|
66
|
+
range->end_byte = UINT32_MAX;
|
|
67
|
+
range->end_point = POINT_MAX;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
} else if (range->end_byte > edit->start_byte) {
|
|
71
|
+
range->end_byte = edit->start_byte;
|
|
72
|
+
range->end_point = edit->start_point;
|
|
73
|
+
}
|
|
74
|
+
if (range->start_byte >= edit->old_end_byte) {
|
|
75
|
+
range->start_byte = edit->new_end_byte + (range->start_byte - edit->old_end_byte);
|
|
76
|
+
range->start_point = point_add(
|
|
77
|
+
edit->new_end_point,
|
|
78
|
+
point_sub(range->start_point, edit->old_end_point)
|
|
79
|
+
);
|
|
80
|
+
if (range->start_byte < edit->new_end_byte) {
|
|
81
|
+
range->start_byte = UINT32_MAX;
|
|
82
|
+
range->start_point = POINT_MAX;
|
|
83
|
+
}
|
|
84
|
+
} else if (range->start_byte > edit->start_byte) {
|
|
85
|
+
range->start_byte = edit->start_byte;
|
|
86
|
+
range->start_point = edit->start_point;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
SubtreePool pool = ts_subtree_pool_new(0);
|
|
91
|
+
self->root = ts_subtree_edit(self->root, edit, &pool);
|
|
92
|
+
ts_subtree_pool_delete(&pool);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
TSRange *ts_tree_included_ranges(const TSTree *self, uint32_t *length) {
|
|
96
|
+
*length = self->included_range_count;
|
|
97
|
+
TSRange *ranges = ts_calloc(self->included_range_count, sizeof(TSRange));
|
|
98
|
+
memcpy(ranges, self->included_ranges, self->included_range_count * sizeof(TSRange));
|
|
99
|
+
return ranges;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
TSRange *ts_tree_get_changed_ranges(const TSTree *old_tree, const TSTree *new_tree, uint32_t *length) {
|
|
103
|
+
TreeCursor cursor1 = {NULL, array_new(), 0};
|
|
104
|
+
TreeCursor cursor2 = {NULL, array_new(), 0};
|
|
105
|
+
ts_tree_cursor_init(&cursor1, ts_tree_root_node(old_tree));
|
|
106
|
+
ts_tree_cursor_init(&cursor2, ts_tree_root_node(new_tree));
|
|
107
|
+
|
|
108
|
+
TSRangeArray included_range_differences = array_new();
|
|
109
|
+
ts_range_array_get_changed_ranges(
|
|
110
|
+
old_tree->included_ranges, old_tree->included_range_count,
|
|
111
|
+
new_tree->included_ranges, new_tree->included_range_count,
|
|
112
|
+
&included_range_differences
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
TSRange *result;
|
|
116
|
+
*length = ts_subtree_get_changed_ranges(
|
|
117
|
+
&old_tree->root, &new_tree->root, &cursor1, &cursor2,
|
|
118
|
+
old_tree->language, &included_range_differences, &result
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
array_delete(&included_range_differences);
|
|
122
|
+
array_delete(&cursor1.stack);
|
|
123
|
+
array_delete(&cursor2.stack);
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
#ifdef _WIN32
|
|
128
|
+
|
|
129
|
+
#include <io.h>
|
|
130
|
+
#include <windows.h>
|
|
131
|
+
|
|
132
|
+
int _ts_dup(HANDLE handle) {
|
|
133
|
+
HANDLE dup_handle;
|
|
134
|
+
if (!DuplicateHandle(
|
|
135
|
+
GetCurrentProcess(), handle,
|
|
136
|
+
GetCurrentProcess(), &dup_handle,
|
|
137
|
+
0, FALSE, DUPLICATE_SAME_ACCESS
|
|
138
|
+
)) return -1;
|
|
139
|
+
|
|
140
|
+
return _open_osfhandle((intptr_t)dup_handle, 0);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
void ts_tree_print_dot_graph(const TSTree *self, int fd) {
|
|
144
|
+
FILE *file = _fdopen(_ts_dup((HANDLE)_get_osfhandle(fd)), "a");
|
|
145
|
+
ts_subtree_print_dot_graph(self->root, self->language, file);
|
|
146
|
+
fclose(file);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
#elif !defined(__wasi__) // WASI doesn't support dup
|
|
150
|
+
|
|
151
|
+
#include <unistd.h>
|
|
152
|
+
|
|
153
|
+
int _ts_dup(int file_descriptor) {
|
|
154
|
+
return dup(file_descriptor);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
void ts_tree_print_dot_graph(const TSTree *self, int file_descriptor) {
|
|
158
|
+
FILE *file = fdopen(_ts_dup(file_descriptor), "a");
|
|
159
|
+
ts_subtree_print_dot_graph(self->root, self->language, file);
|
|
160
|
+
fclose(file);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
#else
|
|
164
|
+
|
|
165
|
+
void ts_tree_print_dot_graph(const TSTree *self, int file_descriptor) {
|
|
166
|
+
(void)self;
|
|
167
|
+
(void)file_descriptor;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
#endif
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#ifndef TREE_SITTER_TREE_H_
|
|
2
|
+
#define TREE_SITTER_TREE_H_
|
|
3
|
+
|
|
4
|
+
#include "./subtree.h"
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
typedef struct {
|
|
11
|
+
const Subtree *child;
|
|
12
|
+
const Subtree *parent;
|
|
13
|
+
Length position;
|
|
14
|
+
TSSymbol alias_symbol;
|
|
15
|
+
} ParentCacheEntry;
|
|
16
|
+
|
|
17
|
+
struct TSTree {
|
|
18
|
+
Subtree root;
|
|
19
|
+
const TSLanguage *language;
|
|
20
|
+
TSRange *included_ranges;
|
|
21
|
+
unsigned included_range_count;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
TSTree *ts_tree_new(Subtree root, const TSLanguage *language, const TSRange *included_ranges, unsigned included_range_count);
|
|
25
|
+
TSNode ts_node_new(const TSTree *tree, const Subtree *subtree, Length position, TSSymbol alias);
|
|
26
|
+
|
|
27
|
+
#ifdef __cplusplus
|
|
28
|
+
}
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#endif // TREE_SITTER_TREE_H_
|