@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,920 @@
|
|
|
1
|
+
#include <stdbool.h>
|
|
2
|
+
#include "./subtree.h"
|
|
3
|
+
#include "./tree.h"
|
|
4
|
+
#include "./language.h"
|
|
5
|
+
|
|
6
|
+
typedef struct {
|
|
7
|
+
Subtree parent;
|
|
8
|
+
const TSTree *tree;
|
|
9
|
+
Length position;
|
|
10
|
+
uint32_t child_index;
|
|
11
|
+
uint32_t structural_child_index;
|
|
12
|
+
const TSSymbol *alias_sequence;
|
|
13
|
+
} NodeChildIterator;
|
|
14
|
+
|
|
15
|
+
static inline bool ts_node__is_relevant(TSNode self, bool include_anonymous);
|
|
16
|
+
|
|
17
|
+
// TSNode - constructors
|
|
18
|
+
|
|
19
|
+
TSNode ts_node_new(
|
|
20
|
+
const TSTree *tree,
|
|
21
|
+
const Subtree *subtree,
|
|
22
|
+
Length position,
|
|
23
|
+
TSSymbol alias
|
|
24
|
+
) {
|
|
25
|
+
return (TSNode) {
|
|
26
|
+
{position.bytes, position.extent.row, position.extent.column, alias},
|
|
27
|
+
subtree,
|
|
28
|
+
tree,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static inline TSNode ts_node__null(void) {
|
|
33
|
+
return ts_node_new(NULL, NULL, length_zero(), 0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// TSNode - accessors
|
|
37
|
+
|
|
38
|
+
uint32_t ts_node_start_byte(TSNode self) {
|
|
39
|
+
return self.context[0];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
TSPoint ts_node_start_point(TSNode self) {
|
|
43
|
+
return (TSPoint) {self.context[1], self.context[2]};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static inline uint32_t ts_node__alias(const TSNode *self) {
|
|
47
|
+
return self->context[3];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static inline Subtree ts_node__subtree(TSNode self) {
|
|
51
|
+
return *(const Subtree *)self.id;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// NodeChildIterator
|
|
55
|
+
|
|
56
|
+
static inline NodeChildIterator ts_node_iterate_children(const TSNode *node) {
|
|
57
|
+
Subtree subtree = ts_node__subtree(*node);
|
|
58
|
+
if (ts_subtree_child_count(subtree) == 0) {
|
|
59
|
+
return (NodeChildIterator) {NULL_SUBTREE, node->tree, length_zero(), 0, 0, NULL};
|
|
60
|
+
}
|
|
61
|
+
const TSSymbol *alias_sequence = ts_language_alias_sequence(
|
|
62
|
+
node->tree->language,
|
|
63
|
+
subtree.ptr->production_id
|
|
64
|
+
);
|
|
65
|
+
return (NodeChildIterator) {
|
|
66
|
+
.tree = node->tree,
|
|
67
|
+
.parent = subtree,
|
|
68
|
+
.position = {ts_node_start_byte(*node), ts_node_start_point(*node)},
|
|
69
|
+
.child_index = 0,
|
|
70
|
+
.structural_child_index = 0,
|
|
71
|
+
.alias_sequence = alias_sequence,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static inline bool ts_node_child_iterator_done(NodeChildIterator *self) {
|
|
76
|
+
return self->child_index == self->parent.ptr->child_count;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static inline bool ts_node_child_iterator_next(
|
|
80
|
+
NodeChildIterator *self,
|
|
81
|
+
TSNode *result
|
|
82
|
+
) {
|
|
83
|
+
if (!self->parent.ptr || ts_node_child_iterator_done(self)) return false;
|
|
84
|
+
const Subtree *child = &ts_subtree_children(self->parent)[self->child_index];
|
|
85
|
+
TSSymbol alias_symbol = 0;
|
|
86
|
+
if (!ts_subtree_extra(*child)) {
|
|
87
|
+
if (self->alias_sequence) {
|
|
88
|
+
alias_symbol = self->alias_sequence[self->structural_child_index];
|
|
89
|
+
}
|
|
90
|
+
self->structural_child_index++;
|
|
91
|
+
}
|
|
92
|
+
if (self->child_index > 0) {
|
|
93
|
+
self->position = length_add(self->position, ts_subtree_padding(*child));
|
|
94
|
+
}
|
|
95
|
+
*result = ts_node_new(
|
|
96
|
+
self->tree,
|
|
97
|
+
child,
|
|
98
|
+
self->position,
|
|
99
|
+
alias_symbol
|
|
100
|
+
);
|
|
101
|
+
self->position = length_add(self->position, ts_subtree_size(*child));
|
|
102
|
+
self->child_index++;
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// This will return true if the next sibling is a zero-width token that is adjacent to the current node and is relevant
|
|
107
|
+
static inline bool ts_node_child_iterator_next_sibling_is_empty_adjacent(NodeChildIterator *self, TSNode previous) {
|
|
108
|
+
if (!self->parent.ptr || ts_node_child_iterator_done(self)) return false;
|
|
109
|
+
if (self->child_index == 0) return false;
|
|
110
|
+
const Subtree *child = &ts_subtree_children(self->parent)[self->child_index];
|
|
111
|
+
TSSymbol alias = 0;
|
|
112
|
+
if (!ts_subtree_extra(*child)) {
|
|
113
|
+
if (self->alias_sequence) {
|
|
114
|
+
alias = self->alias_sequence[self->structural_child_index];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
TSNode next = ts_node_new(self->tree, child, self->position, alias);
|
|
118
|
+
return ts_node_end_byte(previous) == ts_node_end_byte(next) && ts_node__is_relevant(next, true);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// TSNode - private
|
|
122
|
+
|
|
123
|
+
static inline bool ts_node__is_relevant(TSNode self, bool include_anonymous) {
|
|
124
|
+
Subtree tree = ts_node__subtree(self);
|
|
125
|
+
if (include_anonymous) {
|
|
126
|
+
return ts_subtree_visible(tree) || ts_node__alias(&self);
|
|
127
|
+
} else {
|
|
128
|
+
TSSymbol alias = ts_node__alias(&self);
|
|
129
|
+
if (alias) {
|
|
130
|
+
return ts_language_symbol_metadata(self.tree->language, alias).named;
|
|
131
|
+
} else {
|
|
132
|
+
return ts_subtree_visible(tree) && ts_subtree_named(tree);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
static inline uint32_t ts_node__relevant_child_count(
|
|
138
|
+
TSNode self,
|
|
139
|
+
bool include_anonymous
|
|
140
|
+
) {
|
|
141
|
+
Subtree tree = ts_node__subtree(self);
|
|
142
|
+
if (ts_subtree_child_count(tree) > 0) {
|
|
143
|
+
if (include_anonymous) {
|
|
144
|
+
return tree.ptr->visible_child_count;
|
|
145
|
+
} else {
|
|
146
|
+
return tree.ptr->named_child_count;
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
return 0;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static inline TSNode ts_node__child(
|
|
154
|
+
TSNode self,
|
|
155
|
+
uint32_t child_index,
|
|
156
|
+
bool include_anonymous
|
|
157
|
+
) {
|
|
158
|
+
TSNode result = self;
|
|
159
|
+
bool did_descend = true;
|
|
160
|
+
|
|
161
|
+
while (did_descend) {
|
|
162
|
+
did_descend = false;
|
|
163
|
+
|
|
164
|
+
TSNode child;
|
|
165
|
+
uint32_t index = 0;
|
|
166
|
+
NodeChildIterator iterator = ts_node_iterate_children(&result);
|
|
167
|
+
while (ts_node_child_iterator_next(&iterator, &child)) {
|
|
168
|
+
if (ts_node__is_relevant(child, include_anonymous)) {
|
|
169
|
+
if (index == child_index) {
|
|
170
|
+
return child;
|
|
171
|
+
}
|
|
172
|
+
index++;
|
|
173
|
+
} else {
|
|
174
|
+
uint32_t grandchild_index = child_index - index;
|
|
175
|
+
uint32_t grandchild_count = ts_node__relevant_child_count(child, include_anonymous);
|
|
176
|
+
if (grandchild_index < grandchild_count) {
|
|
177
|
+
did_descend = true;
|
|
178
|
+
result = child;
|
|
179
|
+
child_index = grandchild_index;
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
index += grandchild_count;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return ts_node__null();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
static bool ts_subtree_has_trailing_empty_descendant(
|
|
191
|
+
Subtree self,
|
|
192
|
+
Subtree other
|
|
193
|
+
) {
|
|
194
|
+
for (unsigned i = ts_subtree_child_count(self) - 1; i + 1 > 0; i--) {
|
|
195
|
+
Subtree child = ts_subtree_children(self)[i];
|
|
196
|
+
if (ts_subtree_total_bytes(child) > 0) break;
|
|
197
|
+
if (child.ptr == other.ptr || ts_subtree_has_trailing_empty_descendant(child, other)) {
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
static inline TSNode ts_node__prev_sibling(TSNode self, bool include_anonymous) {
|
|
205
|
+
Subtree self_subtree = ts_node__subtree(self);
|
|
206
|
+
bool self_is_empty = ts_subtree_total_bytes(self_subtree) == 0;
|
|
207
|
+
uint32_t target_end_byte = ts_node_end_byte(self);
|
|
208
|
+
|
|
209
|
+
TSNode node = ts_node_parent(self);
|
|
210
|
+
TSNode earlier_node = ts_node__null();
|
|
211
|
+
bool earlier_node_is_relevant = false;
|
|
212
|
+
|
|
213
|
+
while (!ts_node_is_null(node)) {
|
|
214
|
+
TSNode earlier_child = ts_node__null();
|
|
215
|
+
bool earlier_child_is_relevant = false;
|
|
216
|
+
bool found_child_containing_target = false;
|
|
217
|
+
|
|
218
|
+
TSNode child;
|
|
219
|
+
NodeChildIterator iterator = ts_node_iterate_children(&node);
|
|
220
|
+
while (ts_node_child_iterator_next(&iterator, &child)) {
|
|
221
|
+
if (child.id == self.id) break;
|
|
222
|
+
if (iterator.position.bytes > target_end_byte) {
|
|
223
|
+
found_child_containing_target = true;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (iterator.position.bytes == target_end_byte &&
|
|
228
|
+
(!self_is_empty ||
|
|
229
|
+
ts_subtree_has_trailing_empty_descendant(ts_node__subtree(child), self_subtree))) {
|
|
230
|
+
found_child_containing_target = true;
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (ts_node__is_relevant(child, include_anonymous)) {
|
|
235
|
+
earlier_child = child;
|
|
236
|
+
earlier_child_is_relevant = true;
|
|
237
|
+
} else if (ts_node__relevant_child_count(child, include_anonymous) > 0) {
|
|
238
|
+
earlier_child = child;
|
|
239
|
+
earlier_child_is_relevant = false;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (found_child_containing_target) {
|
|
244
|
+
if (!ts_node_is_null(earlier_child)) {
|
|
245
|
+
earlier_node = earlier_child;
|
|
246
|
+
earlier_node_is_relevant = earlier_child_is_relevant;
|
|
247
|
+
}
|
|
248
|
+
node = child;
|
|
249
|
+
} else if (earlier_child_is_relevant) {
|
|
250
|
+
return earlier_child;
|
|
251
|
+
} else if (!ts_node_is_null(earlier_child)) {
|
|
252
|
+
node = earlier_child;
|
|
253
|
+
} else if (earlier_node_is_relevant) {
|
|
254
|
+
return earlier_node;
|
|
255
|
+
} else {
|
|
256
|
+
node = earlier_node;
|
|
257
|
+
earlier_node = ts_node__null();
|
|
258
|
+
earlier_node_is_relevant = false;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return ts_node__null();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
static inline TSNode ts_node__next_sibling(TSNode self, bool include_anonymous) {
|
|
266
|
+
uint32_t target_end_byte = ts_node_end_byte(self);
|
|
267
|
+
|
|
268
|
+
TSNode node = ts_node_parent(self);
|
|
269
|
+
TSNode later_node = ts_node__null();
|
|
270
|
+
bool later_node_is_relevant = false;
|
|
271
|
+
|
|
272
|
+
while (!ts_node_is_null(node)) {
|
|
273
|
+
TSNode later_child = ts_node__null();
|
|
274
|
+
bool later_child_is_relevant = false;
|
|
275
|
+
TSNode child_containing_target = ts_node__null();
|
|
276
|
+
|
|
277
|
+
TSNode child;
|
|
278
|
+
NodeChildIterator iterator = ts_node_iterate_children(&node);
|
|
279
|
+
while (ts_node_child_iterator_next(&iterator, &child)) {
|
|
280
|
+
if (iterator.position.bytes < target_end_byte) continue;
|
|
281
|
+
if (ts_node_start_byte(child) <= ts_node_start_byte(self)) {
|
|
282
|
+
if (ts_node__subtree(child).ptr != ts_node__subtree(self).ptr) {
|
|
283
|
+
child_containing_target = child;
|
|
284
|
+
}
|
|
285
|
+
} else if (ts_node__is_relevant(child, include_anonymous)) {
|
|
286
|
+
later_child = child;
|
|
287
|
+
later_child_is_relevant = true;
|
|
288
|
+
break;
|
|
289
|
+
} else if (ts_node__relevant_child_count(child, include_anonymous) > 0) {
|
|
290
|
+
later_child = child;
|
|
291
|
+
later_child_is_relevant = false;
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (!ts_node_is_null(child_containing_target)) {
|
|
297
|
+
if (!ts_node_is_null(later_child)) {
|
|
298
|
+
later_node = later_child;
|
|
299
|
+
later_node_is_relevant = later_child_is_relevant;
|
|
300
|
+
}
|
|
301
|
+
node = child_containing_target;
|
|
302
|
+
} else if (later_child_is_relevant) {
|
|
303
|
+
return later_child;
|
|
304
|
+
} else if (!ts_node_is_null(later_child)) {
|
|
305
|
+
node = later_child;
|
|
306
|
+
} else if (later_node_is_relevant) {
|
|
307
|
+
return later_node;
|
|
308
|
+
} else {
|
|
309
|
+
node = later_node;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return ts_node__null();
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
static inline TSNode ts_node__first_child_for_byte(
|
|
317
|
+
TSNode self,
|
|
318
|
+
uint32_t goal,
|
|
319
|
+
bool include_anonymous
|
|
320
|
+
) {
|
|
321
|
+
TSNode node = self;
|
|
322
|
+
bool did_descend = true;
|
|
323
|
+
|
|
324
|
+
NodeChildIterator last_iterator;
|
|
325
|
+
bool has_last_iterator = false;
|
|
326
|
+
|
|
327
|
+
while (did_descend) {
|
|
328
|
+
did_descend = false;
|
|
329
|
+
|
|
330
|
+
TSNode child;
|
|
331
|
+
NodeChildIterator iterator = ts_node_iterate_children(&node);
|
|
332
|
+
loop:
|
|
333
|
+
while (ts_node_child_iterator_next(&iterator, &child)) {
|
|
334
|
+
if (ts_node_end_byte(child) > goal) {
|
|
335
|
+
if (ts_node__is_relevant(child, include_anonymous)) {
|
|
336
|
+
return child;
|
|
337
|
+
} else if (ts_node_child_count(child) > 0) {
|
|
338
|
+
if (iterator.child_index < ts_subtree_child_count(ts_node__subtree(child))) {
|
|
339
|
+
last_iterator = iterator;
|
|
340
|
+
has_last_iterator = true;
|
|
341
|
+
}
|
|
342
|
+
did_descend = true;
|
|
343
|
+
node = child;
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (!did_descend && has_last_iterator) {
|
|
350
|
+
iterator = last_iterator;
|
|
351
|
+
has_last_iterator = false;
|
|
352
|
+
goto loop;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return ts_node__null();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
static inline TSNode ts_node__descendant_for_byte_range(
|
|
360
|
+
TSNode self,
|
|
361
|
+
uint32_t range_start,
|
|
362
|
+
uint32_t range_end,
|
|
363
|
+
bool include_anonymous
|
|
364
|
+
) {
|
|
365
|
+
TSNode node = self;
|
|
366
|
+
TSNode last_visible_node = self;
|
|
367
|
+
|
|
368
|
+
bool did_descend = true;
|
|
369
|
+
while (did_descend) {
|
|
370
|
+
did_descend = false;
|
|
371
|
+
|
|
372
|
+
TSNode child;
|
|
373
|
+
NodeChildIterator iterator = ts_node_iterate_children(&node);
|
|
374
|
+
while (ts_node_child_iterator_next(&iterator, &child)) {
|
|
375
|
+
uint32_t node_end = iterator.position.bytes;
|
|
376
|
+
|
|
377
|
+
// The end of this node must extend far enough forward to touch
|
|
378
|
+
// the end of the range
|
|
379
|
+
if (node_end < range_end) continue;
|
|
380
|
+
|
|
381
|
+
// ...and exceed the start of the range, unless the node itself is
|
|
382
|
+
// empty, in which case it must at least be equal to the start of the range.
|
|
383
|
+
bool is_empty = ts_node_start_byte(child) == node_end;
|
|
384
|
+
if (is_empty ? node_end < range_start : node_end <= range_start) continue;
|
|
385
|
+
|
|
386
|
+
// The start of this node must extend far enough backward to
|
|
387
|
+
// touch the start of the range.
|
|
388
|
+
if (range_start < ts_node_start_byte(child)) break;
|
|
389
|
+
|
|
390
|
+
node = child;
|
|
391
|
+
if (ts_node__is_relevant(node, include_anonymous)) {
|
|
392
|
+
last_visible_node = node;
|
|
393
|
+
}
|
|
394
|
+
did_descend = true;
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return last_visible_node;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
static inline TSNode ts_node__descendant_for_point_range(
|
|
403
|
+
TSNode self,
|
|
404
|
+
TSPoint range_start,
|
|
405
|
+
TSPoint range_end,
|
|
406
|
+
bool include_anonymous
|
|
407
|
+
) {
|
|
408
|
+
TSNode node = self;
|
|
409
|
+
TSNode last_visible_node = self;
|
|
410
|
+
|
|
411
|
+
bool did_descend = true;
|
|
412
|
+
while (did_descend) {
|
|
413
|
+
did_descend = false;
|
|
414
|
+
|
|
415
|
+
TSNode child;
|
|
416
|
+
NodeChildIterator iterator = ts_node_iterate_children(&node);
|
|
417
|
+
while (ts_node_child_iterator_next(&iterator, &child)) {
|
|
418
|
+
TSPoint node_end = iterator.position.extent;
|
|
419
|
+
|
|
420
|
+
// The end of this node must extend far enough forward to touch
|
|
421
|
+
// the end of the range
|
|
422
|
+
if (point_lt(node_end, range_end)) continue;
|
|
423
|
+
|
|
424
|
+
// ...and exceed the start of the range, unless the node itself is
|
|
425
|
+
// empty, in which case it must at least be equal to the start of the range.
|
|
426
|
+
bool is_empty = point_eq(ts_node_start_point(child), node_end);
|
|
427
|
+
if (is_empty ? point_lt(node_end, range_start) : point_lte(node_end, range_start)) {
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// The start of this node must extend far enough backward to
|
|
432
|
+
// touch the start of the range.
|
|
433
|
+
if (point_lt(range_start, ts_node_start_point(child))) break;
|
|
434
|
+
|
|
435
|
+
node = child;
|
|
436
|
+
if (ts_node__is_relevant(node, include_anonymous)) {
|
|
437
|
+
last_visible_node = node;
|
|
438
|
+
}
|
|
439
|
+
did_descend = true;
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
return last_visible_node;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// TSNode - public
|
|
448
|
+
|
|
449
|
+
uint32_t ts_node_end_byte(TSNode self) {
|
|
450
|
+
return ts_node_start_byte(self) + ts_subtree_size(ts_node__subtree(self)).bytes;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
TSPoint ts_node_end_point(TSNode self) {
|
|
454
|
+
return point_add(ts_node_start_point(self), ts_subtree_size(ts_node__subtree(self)).extent);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
TSSymbol ts_node_symbol(TSNode self) {
|
|
458
|
+
TSSymbol symbol = ts_node__alias(&self);
|
|
459
|
+
if (!symbol) symbol = ts_subtree_symbol(ts_node__subtree(self));
|
|
460
|
+
return ts_language_public_symbol(self.tree->language, symbol);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const char *ts_node_type(TSNode self) {
|
|
464
|
+
TSSymbol symbol = ts_node__alias(&self);
|
|
465
|
+
if (!symbol) symbol = ts_subtree_symbol(ts_node__subtree(self));
|
|
466
|
+
return ts_language_symbol_name(self.tree->language, symbol);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
const TSLanguage *ts_node_language(TSNode self) {
|
|
470
|
+
return self.tree->language;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
TSSymbol ts_node_grammar_symbol(TSNode self) {
|
|
474
|
+
return ts_subtree_symbol(ts_node__subtree(self));
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
const char *ts_node_grammar_type(TSNode self) {
|
|
478
|
+
TSSymbol symbol = ts_subtree_symbol(ts_node__subtree(self));
|
|
479
|
+
return ts_language_symbol_name(self.tree->language, symbol);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
char *ts_node_string(TSNode self) {
|
|
483
|
+
TSSymbol alias_symbol = ts_node__alias(&self);
|
|
484
|
+
return ts_subtree_string(
|
|
485
|
+
ts_node__subtree(self),
|
|
486
|
+
alias_symbol,
|
|
487
|
+
ts_language_symbol_metadata(self.tree->language, alias_symbol).visible,
|
|
488
|
+
self.tree->language,
|
|
489
|
+
false
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
bool ts_node_eq(TSNode self, TSNode other) {
|
|
494
|
+
return self.tree == other.tree && self.id == other.id;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
bool ts_node_is_null(TSNode self) {
|
|
498
|
+
return self.id == 0;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
bool ts_node_is_extra(TSNode self) {
|
|
502
|
+
return ts_subtree_extra(ts_node__subtree(self));
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
bool ts_node_is_named(TSNode self) {
|
|
506
|
+
TSSymbol alias = ts_node__alias(&self);
|
|
507
|
+
return alias
|
|
508
|
+
? ts_language_symbol_metadata(self.tree->language, alias).named
|
|
509
|
+
: ts_subtree_named(ts_node__subtree(self));
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
bool ts_node_is_missing(TSNode self) {
|
|
513
|
+
return ts_subtree_missing(ts_node__subtree(self));
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
bool ts_node_has_changes(TSNode self) {
|
|
517
|
+
return ts_subtree_has_changes(ts_node__subtree(self));
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
bool ts_node_has_error(TSNode self) {
|
|
521
|
+
return ts_subtree_error_cost(ts_node__subtree(self)) > 0;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
bool ts_node_is_error(TSNode self) {
|
|
525
|
+
TSSymbol symbol = ts_node_symbol(self);
|
|
526
|
+
return symbol == ts_builtin_sym_error;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
uint32_t ts_node_descendant_count(TSNode self) {
|
|
530
|
+
return ts_subtree_visible_descendant_count(ts_node__subtree(self)) + 1;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
TSStateId ts_node_parse_state(TSNode self) {
|
|
534
|
+
return ts_subtree_parse_state(ts_node__subtree(self));
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
TSStateId ts_node_next_parse_state(TSNode self) {
|
|
538
|
+
const TSLanguage *language = self.tree->language;
|
|
539
|
+
uint16_t state = ts_node_parse_state(self);
|
|
540
|
+
if (state == TS_TREE_STATE_NONE) {
|
|
541
|
+
return TS_TREE_STATE_NONE;
|
|
542
|
+
}
|
|
543
|
+
uint16_t symbol = ts_node_grammar_symbol(self);
|
|
544
|
+
return ts_language_next_state(language, state, symbol);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
TSNode ts_node_parent(TSNode self) {
|
|
548
|
+
TSNode node = ts_tree_root_node(self.tree);
|
|
549
|
+
if (node.id == self.id) return ts_node__null();
|
|
550
|
+
|
|
551
|
+
while (true) {
|
|
552
|
+
TSNode next_node = ts_node_child_containing_descendant(node, self);
|
|
553
|
+
if (ts_node_is_null(next_node)) break;
|
|
554
|
+
node = next_node;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
return node;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
TSNode ts_node_child_containing_descendant(TSNode self, TSNode descendant) {
|
|
561
|
+
uint32_t start_byte = ts_node_start_byte(descendant);
|
|
562
|
+
uint32_t end_byte = ts_node_end_byte(descendant);
|
|
563
|
+
|
|
564
|
+
do {
|
|
565
|
+
NodeChildIterator iter = ts_node_iterate_children(&self);
|
|
566
|
+
do {
|
|
567
|
+
if (
|
|
568
|
+
!ts_node_child_iterator_next(&iter, &self)
|
|
569
|
+
|| ts_node_start_byte(self) > start_byte
|
|
570
|
+
|| self.id == descendant.id
|
|
571
|
+
) {
|
|
572
|
+
return ts_node__null();
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// Here we check the current self node and *all* of its zero-width token siblings that follow.
|
|
576
|
+
// If any of these nodes contain the target subnode, we return that node. Otherwise, we restore the node we started at
|
|
577
|
+
// for the loop condition, and that will continue with the next *non-zero-width* sibling.
|
|
578
|
+
TSNode old = self;
|
|
579
|
+
// While the next sibling is a zero-width token
|
|
580
|
+
while (ts_node_child_iterator_next_sibling_is_empty_adjacent(&iter, self)) {
|
|
581
|
+
TSNode current_node = ts_node_child_containing_descendant(self, descendant);
|
|
582
|
+
// If the target child is in self, return it
|
|
583
|
+
if (!ts_node_is_null(current_node)) {
|
|
584
|
+
return current_node;
|
|
585
|
+
}
|
|
586
|
+
ts_node_child_iterator_next(&iter, &self);
|
|
587
|
+
if (self.id == descendant.id) {
|
|
588
|
+
return ts_node__null();
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
self = old;
|
|
592
|
+
} while (iter.position.bytes < end_byte || ts_node_child_count(self) == 0);
|
|
593
|
+
} while (!ts_node__is_relevant(self, true));
|
|
594
|
+
|
|
595
|
+
return self;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
TSNode ts_node_child_with_descendant(TSNode self, TSNode descendant) {
|
|
599
|
+
uint32_t start_byte = ts_node_start_byte(descendant);
|
|
600
|
+
uint32_t end_byte = ts_node_end_byte(descendant);
|
|
601
|
+
|
|
602
|
+
do {
|
|
603
|
+
NodeChildIterator iter = ts_node_iterate_children(&self);
|
|
604
|
+
do {
|
|
605
|
+
if (
|
|
606
|
+
!ts_node_child_iterator_next(&iter, &self)
|
|
607
|
+
|| ts_node_start_byte(self) > start_byte
|
|
608
|
+
) {
|
|
609
|
+
return ts_node__null();
|
|
610
|
+
}
|
|
611
|
+
if (self.id == descendant.id) {
|
|
612
|
+
return self;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
// Here we check the current self node and *all* of its zero-width token siblings that follow.
|
|
616
|
+
// If any of these nodes contain the target subnode, we return that node. Otherwise, we restore the node we started at
|
|
617
|
+
// for the loop condition, and that will continue with the next *non-zero-width* sibling.
|
|
618
|
+
TSNode old = self;
|
|
619
|
+
// While the next sibling is a zero-width token
|
|
620
|
+
while (ts_node_child_iterator_next_sibling_is_empty_adjacent(&iter, self)) {
|
|
621
|
+
TSNode current_node = ts_node_child_with_descendant(self, descendant);
|
|
622
|
+
// If the target child is in self, return it
|
|
623
|
+
if (!ts_node_is_null(current_node)) {
|
|
624
|
+
return current_node;
|
|
625
|
+
}
|
|
626
|
+
ts_node_child_iterator_next(&iter, &self);
|
|
627
|
+
if (self.id == descendant.id) {
|
|
628
|
+
return self;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
self = old;
|
|
632
|
+
} while (iter.position.bytes < end_byte || ts_node_child_count(self) == 0);
|
|
633
|
+
} while (!ts_node__is_relevant(self, true));
|
|
634
|
+
|
|
635
|
+
return self;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
TSNode ts_node_child(TSNode self, uint32_t child_index) {
|
|
639
|
+
return ts_node__child(self, child_index, true);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
TSNode ts_node_named_child(TSNode self, uint32_t child_index) {
|
|
643
|
+
return ts_node__child(self, child_index, false);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
TSNode ts_node_child_by_field_id(TSNode self, TSFieldId field_id) {
|
|
647
|
+
recur:
|
|
648
|
+
if (!field_id || ts_node_child_count(self) == 0) return ts_node__null();
|
|
649
|
+
|
|
650
|
+
const TSFieldMapEntry *field_map, *field_map_end;
|
|
651
|
+
ts_language_field_map(
|
|
652
|
+
self.tree->language,
|
|
653
|
+
ts_node__subtree(self).ptr->production_id,
|
|
654
|
+
&field_map,
|
|
655
|
+
&field_map_end
|
|
656
|
+
);
|
|
657
|
+
if (field_map == field_map_end) return ts_node__null();
|
|
658
|
+
|
|
659
|
+
// The field mappings are sorted by their field id. Scan all
|
|
660
|
+
// the mappings to find the ones for the given field id.
|
|
661
|
+
while (field_map->field_id < field_id) {
|
|
662
|
+
field_map++;
|
|
663
|
+
if (field_map == field_map_end) return ts_node__null();
|
|
664
|
+
}
|
|
665
|
+
while (field_map_end[-1].field_id > field_id) {
|
|
666
|
+
field_map_end--;
|
|
667
|
+
if (field_map == field_map_end) return ts_node__null();
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
TSNode child;
|
|
671
|
+
NodeChildIterator iterator = ts_node_iterate_children(&self);
|
|
672
|
+
while (ts_node_child_iterator_next(&iterator, &child)) {
|
|
673
|
+
if (!ts_subtree_extra(ts_node__subtree(child))) {
|
|
674
|
+
uint32_t index = iterator.structural_child_index - 1;
|
|
675
|
+
if (index < field_map->child_index) continue;
|
|
676
|
+
|
|
677
|
+
// Hidden nodes' fields are "inherited" by their visible parent.
|
|
678
|
+
if (field_map->inherited) {
|
|
679
|
+
|
|
680
|
+
// If this is the *last* possible child node for this field,
|
|
681
|
+
// then perform a tail call to avoid recursion.
|
|
682
|
+
if (field_map + 1 == field_map_end) {
|
|
683
|
+
self = child;
|
|
684
|
+
goto recur;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// Otherwise, descend into this child, but if it doesn't contain
|
|
688
|
+
// the field, continue searching subsequent children.
|
|
689
|
+
else {
|
|
690
|
+
TSNode result = ts_node_child_by_field_id(child, field_id);
|
|
691
|
+
if (result.id) return result;
|
|
692
|
+
field_map++;
|
|
693
|
+
if (field_map == field_map_end) return ts_node__null();
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
else if (ts_node__is_relevant(child, true)) {
|
|
698
|
+
return child;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
// If the field refers to a hidden node with visible children,
|
|
702
|
+
// return the first visible child.
|
|
703
|
+
else if (ts_node_child_count(child) > 0 ) {
|
|
704
|
+
return ts_node_child(child, 0);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
// Otherwise, continue searching subsequent children.
|
|
708
|
+
else {
|
|
709
|
+
field_map++;
|
|
710
|
+
if (field_map == field_map_end) return ts_node__null();
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
return ts_node__null();
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
static inline const char *ts_node__field_name_from_language(TSNode self, uint32_t structural_child_index) {
|
|
719
|
+
const TSFieldMapEntry *field_map, *field_map_end;
|
|
720
|
+
ts_language_field_map(
|
|
721
|
+
self.tree->language,
|
|
722
|
+
ts_node__subtree(self).ptr->production_id,
|
|
723
|
+
&field_map,
|
|
724
|
+
&field_map_end
|
|
725
|
+
);
|
|
726
|
+
for (; field_map != field_map_end; field_map++) {
|
|
727
|
+
if (!field_map->inherited && field_map->child_index == structural_child_index) {
|
|
728
|
+
return self.tree->language->field_names[field_map->field_id];
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
return NULL;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
const char *ts_node_field_name_for_child(TSNode self, uint32_t child_index) {
|
|
735
|
+
TSNode result = self;
|
|
736
|
+
bool did_descend = true;
|
|
737
|
+
const char *inherited_field_name = NULL;
|
|
738
|
+
|
|
739
|
+
while (did_descend) {
|
|
740
|
+
did_descend = false;
|
|
741
|
+
|
|
742
|
+
TSNode child;
|
|
743
|
+
uint32_t index = 0;
|
|
744
|
+
NodeChildIterator iterator = ts_node_iterate_children(&result);
|
|
745
|
+
while (ts_node_child_iterator_next(&iterator, &child)) {
|
|
746
|
+
if (ts_node__is_relevant(child, true)) {
|
|
747
|
+
if (index == child_index) {
|
|
748
|
+
if (ts_node_is_extra(child)) {
|
|
749
|
+
return NULL;
|
|
750
|
+
}
|
|
751
|
+
const char *field_name = ts_node__field_name_from_language(result, iterator.structural_child_index - 1);
|
|
752
|
+
if (field_name) return field_name;
|
|
753
|
+
return inherited_field_name;
|
|
754
|
+
}
|
|
755
|
+
index++;
|
|
756
|
+
} else {
|
|
757
|
+
uint32_t grandchild_index = child_index - index;
|
|
758
|
+
uint32_t grandchild_count = ts_node__relevant_child_count(child, true);
|
|
759
|
+
if (grandchild_index < grandchild_count) {
|
|
760
|
+
const char *field_name = ts_node__field_name_from_language(result, iterator.structural_child_index - 1);
|
|
761
|
+
if (field_name) inherited_field_name = field_name;
|
|
762
|
+
|
|
763
|
+
did_descend = true;
|
|
764
|
+
result = child;
|
|
765
|
+
child_index = grandchild_index;
|
|
766
|
+
break;
|
|
767
|
+
}
|
|
768
|
+
index += grandchild_count;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
return NULL;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
const char *ts_node_field_name_for_named_child(TSNode self, uint32_t named_child_index) {
|
|
777
|
+
TSNode result = self;
|
|
778
|
+
bool did_descend = true;
|
|
779
|
+
const char *inherited_field_name = NULL;
|
|
780
|
+
|
|
781
|
+
while (did_descend) {
|
|
782
|
+
did_descend = false;
|
|
783
|
+
|
|
784
|
+
TSNode child;
|
|
785
|
+
uint32_t index = 0;
|
|
786
|
+
NodeChildIterator iterator = ts_node_iterate_children(&result);
|
|
787
|
+
while (ts_node_child_iterator_next(&iterator, &child)) {
|
|
788
|
+
if (ts_node__is_relevant(child, false)) {
|
|
789
|
+
if (index == named_child_index) {
|
|
790
|
+
if (ts_node_is_extra(child)) {
|
|
791
|
+
return NULL;
|
|
792
|
+
}
|
|
793
|
+
const char *field_name = ts_node__field_name_from_language(result, iterator.structural_child_index - 1);
|
|
794
|
+
if (field_name) return field_name;
|
|
795
|
+
return inherited_field_name;
|
|
796
|
+
}
|
|
797
|
+
index++;
|
|
798
|
+
} else {
|
|
799
|
+
uint32_t named_grandchild_index = named_child_index - index;
|
|
800
|
+
uint32_t grandchild_count = ts_node__relevant_child_count(child, false);
|
|
801
|
+
if (named_grandchild_index < grandchild_count) {
|
|
802
|
+
const char *field_name = ts_node__field_name_from_language(result, iterator.structural_child_index - 1);
|
|
803
|
+
if (field_name) inherited_field_name = field_name;
|
|
804
|
+
|
|
805
|
+
did_descend = true;
|
|
806
|
+
result = child;
|
|
807
|
+
named_child_index = named_grandchild_index;
|
|
808
|
+
break;
|
|
809
|
+
}
|
|
810
|
+
index += grandchild_count;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
return NULL;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
TSNode ts_node_child_by_field_name(
|
|
819
|
+
TSNode self,
|
|
820
|
+
const char *name,
|
|
821
|
+
uint32_t name_length
|
|
822
|
+
) {
|
|
823
|
+
TSFieldId field_id = ts_language_field_id_for_name(
|
|
824
|
+
self.tree->language,
|
|
825
|
+
name,
|
|
826
|
+
name_length
|
|
827
|
+
);
|
|
828
|
+
return ts_node_child_by_field_id(self, field_id);
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
uint32_t ts_node_child_count(TSNode self) {
|
|
832
|
+
Subtree tree = ts_node__subtree(self);
|
|
833
|
+
if (ts_subtree_child_count(tree) > 0) {
|
|
834
|
+
return tree.ptr->visible_child_count;
|
|
835
|
+
} else {
|
|
836
|
+
return 0;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
uint32_t ts_node_named_child_count(TSNode self) {
|
|
841
|
+
Subtree tree = ts_node__subtree(self);
|
|
842
|
+
if (ts_subtree_child_count(tree) > 0) {
|
|
843
|
+
return tree.ptr->named_child_count;
|
|
844
|
+
} else {
|
|
845
|
+
return 0;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
TSNode ts_node_next_sibling(TSNode self) {
|
|
850
|
+
return ts_node__next_sibling(self, true);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
TSNode ts_node_next_named_sibling(TSNode self) {
|
|
854
|
+
return ts_node__next_sibling(self, false);
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
TSNode ts_node_prev_sibling(TSNode self) {
|
|
858
|
+
return ts_node__prev_sibling(self, true);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
TSNode ts_node_prev_named_sibling(TSNode self) {
|
|
862
|
+
return ts_node__prev_sibling(self, false);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
TSNode ts_node_first_child_for_byte(TSNode self, uint32_t byte) {
|
|
866
|
+
return ts_node__first_child_for_byte(self, byte, true);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
TSNode ts_node_first_named_child_for_byte(TSNode self, uint32_t byte) {
|
|
870
|
+
return ts_node__first_child_for_byte(self, byte, false);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
TSNode ts_node_descendant_for_byte_range(
|
|
874
|
+
TSNode self,
|
|
875
|
+
uint32_t start,
|
|
876
|
+
uint32_t end
|
|
877
|
+
) {
|
|
878
|
+
return ts_node__descendant_for_byte_range(self, start, end, true);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
TSNode ts_node_named_descendant_for_byte_range(
|
|
882
|
+
TSNode self,
|
|
883
|
+
uint32_t start,
|
|
884
|
+
uint32_t end
|
|
885
|
+
) {
|
|
886
|
+
return ts_node__descendant_for_byte_range(self, start, end, false);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
TSNode ts_node_descendant_for_point_range(
|
|
890
|
+
TSNode self,
|
|
891
|
+
TSPoint start,
|
|
892
|
+
TSPoint end
|
|
893
|
+
) {
|
|
894
|
+
return ts_node__descendant_for_point_range(self, start, end, true);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
TSNode ts_node_named_descendant_for_point_range(
|
|
898
|
+
TSNode self,
|
|
899
|
+
TSPoint start,
|
|
900
|
+
TSPoint end
|
|
901
|
+
) {
|
|
902
|
+
return ts_node__descendant_for_point_range(self, start, end, false);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
void ts_node_edit(TSNode *self, const TSInputEdit *edit) {
|
|
906
|
+
uint32_t start_byte = ts_node_start_byte(*self);
|
|
907
|
+
TSPoint start_point = ts_node_start_point(*self);
|
|
908
|
+
|
|
909
|
+
if (start_byte >= edit->old_end_byte) {
|
|
910
|
+
start_byte = edit->new_end_byte + (start_byte - edit->old_end_byte);
|
|
911
|
+
start_point = point_add(edit->new_end_point, point_sub(start_point, edit->old_end_point));
|
|
912
|
+
} else if (start_byte > edit->start_byte) {
|
|
913
|
+
start_byte = edit->new_end_byte;
|
|
914
|
+
start_point = edit->new_end_point;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
self->context[0] = start_byte;
|
|
918
|
+
self->context[1] = start_point.row;
|
|
919
|
+
self->context[2] = start_point.column;
|
|
920
|
+
}
|