@coana-tech/cli 14.12.76 → 14.12.78
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 -2
- 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,16 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -x "$basedir/node" ]; then
|
|
13
|
+
exec "$basedir/node" "$basedir/../../../../../node-gyp-build@4.8.4/node_modules/node-gyp-build/bin.js" "$@"
|
|
14
|
+
else
|
|
15
|
+
exec node "$basedir/../../../../../node-gyp-build@4.8.4/node_modules/node-gyp-build/bin.js" "$@"
|
|
16
|
+
fi
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -x "$basedir/node" ]; then
|
|
13
|
+
exec "$basedir/node" "$basedir/../../../../../node-gyp-build@4.8.4/node_modules/node-gyp-build/optional.js" "$@"
|
|
14
|
+
else
|
|
15
|
+
exec node "$basedir/../../../../../node-gyp-build@4.8.4/node_modules/node-gyp-build/optional.js" "$@"
|
|
16
|
+
fi
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -x "$basedir/node" ]; then
|
|
13
|
+
exec "$basedir/node" "$basedir/../../../../../node-gyp-build@4.8.4/node_modules/node-gyp-build/build-test.js" "$@"
|
|
14
|
+
else
|
|
15
|
+
exec node "$basedir/../../../../../node-gyp-build@4.8.4/node_modules/node-gyp-build/build-test.js" "$@"
|
|
16
|
+
fi
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tree-sitter",
|
|
3
|
+
"version": "0.22.4",
|
|
4
|
+
"description": "Node.js bindings to the Tree-sitter parsing library",
|
|
5
|
+
"repository": "http://github.com/tree-sitter/node-tree-sitter",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Max Brunsfeld",
|
|
12
|
+
"email": "maxbrunsfeld@gmail.com"
|
|
13
|
+
},
|
|
14
|
+
"maintainers": [
|
|
15
|
+
{
|
|
16
|
+
"name": "Amaan Qureshi",
|
|
17
|
+
"email": "amaanq12@gmail.com"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"contributors": [
|
|
21
|
+
{
|
|
22
|
+
"name": "Segev Finer",
|
|
23
|
+
"email": "segev208@gmail.com"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "Boris Verkhovskiy",
|
|
27
|
+
"email": "boris.verk@gmail.com"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"main": "index.js",
|
|
31
|
+
"types": "tree-sitter.d.ts",
|
|
32
|
+
"keywords": [
|
|
33
|
+
"incremental",
|
|
34
|
+
"parsing",
|
|
35
|
+
"tree-sitter"
|
|
36
|
+
],
|
|
37
|
+
"files": [
|
|
38
|
+
"binding.gyp",
|
|
39
|
+
"tree-sitter.d.ts",
|
|
40
|
+
"prebuilds/*",
|
|
41
|
+
"src/*",
|
|
42
|
+
"vendor/tree-sitter/lib/include/*",
|
|
43
|
+
"vendor/tree-sitter/lib/src/*"
|
|
44
|
+
],
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"node-addon-api": "^8.3.0",
|
|
47
|
+
"node-gyp-build": "^4.8.4"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^22.10.2",
|
|
51
|
+
"@types/tmp": "^0.2.6",
|
|
52
|
+
"glob": "^11.0.0",
|
|
53
|
+
"node-gyp": "^11.0.0",
|
|
54
|
+
"prebuildify": "^6.0.1",
|
|
55
|
+
"tmp": "^0.2.3",
|
|
56
|
+
"tree-sitter-c": "^0.23.4",
|
|
57
|
+
"tree-sitter-embedded-template": "^0.23.2",
|
|
58
|
+
"tree-sitter-html": "^0.23.2",
|
|
59
|
+
"tree-sitter-java": "^0.23.5",
|
|
60
|
+
"tree-sitter-javascript": "^0.23.1",
|
|
61
|
+
"tree-sitter-json": "^0.24.8",
|
|
62
|
+
"tree-sitter-python": "^0.23.6",
|
|
63
|
+
"tree-sitter-ruby": "^0.23.1",
|
|
64
|
+
"tree-sitter-rust": "^0.23.2",
|
|
65
|
+
"typedoc": "^0.27.6",
|
|
66
|
+
"typedoc-plugin-rename-defaults": "^0.7.2",
|
|
67
|
+
"typescript": "^5.7.2"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"docs": "typedoc --out docs/api tree-sitter.d.ts --readme README.md",
|
|
71
|
+
"install": "node-gyp-build",
|
|
72
|
+
"build": "prebuildify --napi --strip",
|
|
73
|
+
"rebuild": "node-gyp rebuild",
|
|
74
|
+
"test": "node -e \"require('child_process').spawnSync('node', ['--test', ...require('glob').sync('test/**/*.js')], {stdio:'inherit'})\""
|
|
75
|
+
}
|
|
76
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#include "tree_sitter/api.h"
|
|
2
|
+
|
|
3
|
+
#include <napi.h>
|
|
4
|
+
|
|
5
|
+
#ifndef NODE_TREE_SITTER_ADDON_DATA_H_
|
|
6
|
+
#define NODE_TREE_SITTER_ADDON_DATA_H_
|
|
7
|
+
|
|
8
|
+
namespace node_tree_sitter {
|
|
9
|
+
|
|
10
|
+
class AddonData final {
|
|
11
|
+
public:
|
|
12
|
+
explicit AddonData(Napi::Env _env) {}
|
|
13
|
+
|
|
14
|
+
~AddonData() {
|
|
15
|
+
ts_query_cursor_delete(ts_query_cursor);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// conversions
|
|
19
|
+
uint32_t *point_transfer_buffer = nullptr;
|
|
20
|
+
|
|
21
|
+
// node
|
|
22
|
+
uint32_t *transfer_buffer = nullptr;
|
|
23
|
+
uint32_t transfer_buffer_length = 0;
|
|
24
|
+
Napi::ObjectReference module_exports;
|
|
25
|
+
TSTreeCursor scratch_cursor = {nullptr, nullptr, {0, 0}};
|
|
26
|
+
|
|
27
|
+
// parser
|
|
28
|
+
Napi::FunctionReference parser_constructor;
|
|
29
|
+
Napi::FunctionReference string_slice;
|
|
30
|
+
|
|
31
|
+
// query
|
|
32
|
+
TSQueryCursor *ts_query_cursor = nullptr;
|
|
33
|
+
Napi::FunctionReference query_constructor;
|
|
34
|
+
|
|
35
|
+
// tree_cursor
|
|
36
|
+
Napi::FunctionReference tree_cursor_constructor;
|
|
37
|
+
|
|
38
|
+
// tree
|
|
39
|
+
Napi::FunctionReference tree_constructor;
|
|
40
|
+
|
|
41
|
+
// lookaheaditerator
|
|
42
|
+
Napi::FunctionReference lookahead_iterator_constructor;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
} // namespace node_tree_sitter
|
|
46
|
+
|
|
47
|
+
#endif // NODE_TREE_SITTER_ADDON_DATA_H_
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#include "./addon_data.h"
|
|
2
|
+
#include "./conversions.h"
|
|
3
|
+
#include "./language.h"
|
|
4
|
+
#include "./lookaheaditerator.h"
|
|
5
|
+
#include "./node.h"
|
|
6
|
+
#include "./parser.h"
|
|
7
|
+
#include "./query.h"
|
|
8
|
+
#include "./tree.h"
|
|
9
|
+
#include "./tree_cursor.h"
|
|
10
|
+
|
|
11
|
+
#include <napi.h>
|
|
12
|
+
|
|
13
|
+
using namespace Napi;
|
|
14
|
+
|
|
15
|
+
namespace node_tree_sitter {
|
|
16
|
+
|
|
17
|
+
Napi::Object InitAll(Napi::Env env, Napi::Object exports) {
|
|
18
|
+
auto* data = new AddonData(env);
|
|
19
|
+
env.SetInstanceData(data);
|
|
20
|
+
|
|
21
|
+
InitConversions(env, exports);
|
|
22
|
+
node_methods::Init(env, exports);
|
|
23
|
+
language_methods::Init(env, exports);
|
|
24
|
+
LookaheadIterator::Init(env, exports);
|
|
25
|
+
Parser::Init(env, exports);
|
|
26
|
+
Query::Init(env, exports);
|
|
27
|
+
Tree::Init(env, exports);
|
|
28
|
+
TreeCursor::Init(env, exports);
|
|
29
|
+
|
|
30
|
+
return exports;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
NODE_API_MODULE(tree_sitter_runtime_binding, InitAll)
|
|
34
|
+
|
|
35
|
+
} // namespace node_tree_sitter
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#include "./conversions.h"
|
|
2
|
+
#include "./addon_data.h"
|
|
3
|
+
#include "tree_sitter/api.h"
|
|
4
|
+
|
|
5
|
+
#include <cmath>
|
|
6
|
+
#include <napi.h>
|
|
7
|
+
|
|
8
|
+
using namespace Napi;
|
|
9
|
+
|
|
10
|
+
namespace node_tree_sitter {
|
|
11
|
+
|
|
12
|
+
static const unsigned BYTES_PER_CHARACTER = 2;
|
|
13
|
+
|
|
14
|
+
void InitConversions(Napi::Env env, Napi::Object exports) {
|
|
15
|
+
auto *data = env.GetInstanceData<AddonData>();
|
|
16
|
+
|
|
17
|
+
auto js_point_transfer_buffer = Uint32Array::New(env, 2);
|
|
18
|
+
data->point_transfer_buffer = js_point_transfer_buffer.Data();
|
|
19
|
+
|
|
20
|
+
exports["pointTransferArray"] = js_point_transfer_buffer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
void TransferPoint(Napi::Env env, const TSPoint &point) {
|
|
24
|
+
auto *data = env.GetInstanceData<AddonData>();
|
|
25
|
+
data->point_transfer_buffer[0] = point.row;
|
|
26
|
+
data->point_transfer_buffer[1] = point.column / 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Napi::Object RangeToJS(Napi::Env env, const TSRange &range) {
|
|
30
|
+
Object result = Object::New(env);
|
|
31
|
+
result.Set("startPosition", PointToJS(env, range.start_point));
|
|
32
|
+
result.Set("startIndex", ByteCountToJS(env, range.start_byte));
|
|
33
|
+
result.Set("endPosition", PointToJS(env, range.end_point));
|
|
34
|
+
result.Set("endIndex", ByteCountToJS(env, range.end_byte));
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
Napi::Maybe<TSRange> RangeFromJS(const Napi::Value& arg) {
|
|
39
|
+
Env env = arg.Env();
|
|
40
|
+
if (!arg.IsObject()) {
|
|
41
|
+
TypeError::New(env, "Range must be a {startPosition, endPosition, startIndex, endIndex} object").ThrowAsJavaScriptException();
|
|
42
|
+
return Napi::Nothing<TSRange>();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
TSRange result;
|
|
46
|
+
|
|
47
|
+
auto js_range = arg.As<Object>();
|
|
48
|
+
|
|
49
|
+
#define INIT(field, key, Convert) { \
|
|
50
|
+
auto value = js_range.Get(key); \
|
|
51
|
+
if (value.IsEmpty()) { \
|
|
52
|
+
TypeError::New(env, "Range must be a {startPosition, endPosition, startIndex, endIndex} object").ThrowAsJavaScriptException(); \
|
|
53
|
+
return Napi::Nothing<TSRange>(); \
|
|
54
|
+
} \
|
|
55
|
+
auto field = Convert(value); \
|
|
56
|
+
if (field.IsJust()) { \
|
|
57
|
+
result.field = field.Unwrap(); \
|
|
58
|
+
} else { \
|
|
59
|
+
return Napi::Nothing<TSRange>(); \
|
|
60
|
+
} \
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
INIT(start_point, "startPosition", PointFromJS);
|
|
64
|
+
INIT(end_point, "endPosition", PointFromJS);
|
|
65
|
+
INIT(start_byte, "startIndex", ByteCountFromJS);
|
|
66
|
+
INIT(end_byte, "endIndex", ByteCountFromJS);
|
|
67
|
+
|
|
68
|
+
#undef INIT
|
|
69
|
+
|
|
70
|
+
return Napi::Just(result);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
Napi::Object PointToJS(Napi::Env env, const TSPoint &point) {
|
|
74
|
+
Object result = Object::New(env);
|
|
75
|
+
result["row"] = Number::New(env, point.row);
|
|
76
|
+
result["column"] = ByteCountToJS(env, point.column);
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Napi::Maybe<TSPoint> PointFromJS(const Napi::Value& arg) {
|
|
81
|
+
Env env = arg.Env();
|
|
82
|
+
|
|
83
|
+
if (!arg.IsObject()) {
|
|
84
|
+
TypeError::New(env, "Point must be a {row, column} object").ThrowAsJavaScriptException();
|
|
85
|
+
return Napi::Nothing<TSPoint>();
|
|
86
|
+
}
|
|
87
|
+
auto js_point = arg.As<Object>();
|
|
88
|
+
|
|
89
|
+
auto js_row = js_point.Get("row").As<Number>();
|
|
90
|
+
if (!js_row.IsNumber()) {
|
|
91
|
+
TypeError::New(env, "Point must be a {row, column} object").ThrowAsJavaScriptException();
|
|
92
|
+
return Napi::Nothing<TSPoint>();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
auto js_column = js_point.Get("column").As<Number>();
|
|
96
|
+
if (!js_column.IsNumber()) {
|
|
97
|
+
TypeError::New(env, "Point must be a {row, column} object").ThrowAsJavaScriptException();
|
|
98
|
+
return Napi::Nothing<TSPoint>();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
uint32_t row;
|
|
102
|
+
if (!std::isfinite(js_row.DoubleValue())) {
|
|
103
|
+
row = UINT32_MAX;
|
|
104
|
+
} else if (js_row.IsNumber()) {
|
|
105
|
+
row = js_row.Uint32Value();
|
|
106
|
+
} else {
|
|
107
|
+
TypeError::New(env, "Point.row must be a number").ThrowAsJavaScriptException();
|
|
108
|
+
return Napi::Nothing<TSPoint>();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
uint32_t column;
|
|
112
|
+
if (!std::isfinite(js_column.DoubleValue())) {
|
|
113
|
+
column = UINT32_MAX;
|
|
114
|
+
} else if (js_column.IsNumber()) {
|
|
115
|
+
column = js_column.Uint32Value() * BYTES_PER_CHARACTER;
|
|
116
|
+
} else {
|
|
117
|
+
TypeError::New(env, "Point.column must be a number").ThrowAsJavaScriptException();
|
|
118
|
+
return Napi::Nothing<TSPoint>();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return Napi::Just<TSPoint>({row, column});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
Napi::Number ByteCountToJS(Napi::Env env, uint32_t byte_count) {
|
|
125
|
+
return Number::New(env, byte_count / BYTES_PER_CHARACTER);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
Napi::Maybe<uint32_t> ByteCountFromJS(const Napi::Value &arg) {
|
|
129
|
+
Napi::Env env = arg.Env();
|
|
130
|
+
|
|
131
|
+
if (!arg.IsNumber()) {
|
|
132
|
+
TypeError::New(env, "Character index must be a number").ThrowAsJavaScriptException();
|
|
133
|
+
return Napi::Nothing<uint32_t>();
|
|
134
|
+
}
|
|
135
|
+
auto result = arg.As<Number>();
|
|
136
|
+
|
|
137
|
+
return Napi::Just<uint32_t>(result.Uint32Value() * BYTES_PER_CHARACTER);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
} // namespace node_tree_sitter
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#ifndef NODE_TREE_SITTER_CONVERSIONS_H_
|
|
2
|
+
#define NODE_TREE_SITTER_CONVERSIONS_H_
|
|
3
|
+
|
|
4
|
+
#include "./addon_data.h"
|
|
5
|
+
#include "tree_sitter/api.h"
|
|
6
|
+
|
|
7
|
+
#include <napi.h>
|
|
8
|
+
|
|
9
|
+
namespace node_tree_sitter {
|
|
10
|
+
|
|
11
|
+
void InitConversions(Napi::Env env, Napi::Object exports);
|
|
12
|
+
Napi::Object RangeToJS(Napi::Env env, const TSRange &);
|
|
13
|
+
Napi::Object PointToJS(Napi::Env env, const TSPoint &);
|
|
14
|
+
void TransferPoint(Napi::Env env, const TSPoint &);
|
|
15
|
+
Napi::Number ByteCountToJS(Napi::Env env, uint32_t);
|
|
16
|
+
Napi::Maybe<TSPoint> PointFromJS(const Napi::Value &);
|
|
17
|
+
Napi::Maybe<uint32_t> ByteCountFromJS(const Napi::Value &);
|
|
18
|
+
Napi::Maybe<TSRange> RangeFromJS(const Napi::Value&);
|
|
19
|
+
|
|
20
|
+
} // namespace node_tree_sitter
|
|
21
|
+
|
|
22
|
+
#endif // NODE_TREE_SITTER_CONVERSIONS_H_
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#include "./language.h"
|
|
2
|
+
#include "tree_sitter/api.h"
|
|
3
|
+
|
|
4
|
+
#include <napi.h>
|
|
5
|
+
#include <string>
|
|
6
|
+
|
|
7
|
+
using namespace Napi;
|
|
8
|
+
|
|
9
|
+
namespace node_tree_sitter::language_methods {
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
tstag() {
|
|
13
|
+
b2sum -l64 <(printf tree-sitter) <(printf "$1") | \
|
|
14
|
+
awk '{printf "0x" toupper($1) (NR == 1 ? ", " : "\n")}'
|
|
15
|
+
}
|
|
16
|
+
tstag language # => 0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16
|
|
17
|
+
*/
|
|
18
|
+
const napi_type_tag LANGUAGE_TYPE_TAG = {
|
|
19
|
+
0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const TSLanguage *UnwrapLanguage(Napi::Value value) {
|
|
23
|
+
Napi::Env env = value.Env();
|
|
24
|
+
|
|
25
|
+
if (value.IsObject()) {
|
|
26
|
+
value = value.As<Object>()["language"];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
auto arg = value.As<External<const TSLanguage>>();
|
|
30
|
+
if (arg.IsExternal() && arg.CheckTypeTag(&LANGUAGE_TYPE_TAG)) {
|
|
31
|
+
const TSLanguage *language = arg.Data();
|
|
32
|
+
if (language != nullptr) {
|
|
33
|
+
uint16_t version = ts_language_version(language);
|
|
34
|
+
if (
|
|
35
|
+
version < TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION ||
|
|
36
|
+
version > TREE_SITTER_LANGUAGE_VERSION
|
|
37
|
+
) {
|
|
38
|
+
std::string message =
|
|
39
|
+
"Incompatible language version. Compatible range: " +
|
|
40
|
+
std::to_string(TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION) + " - " +
|
|
41
|
+
std::to_string(TREE_SITTER_LANGUAGE_VERSION) + ". Got: " +
|
|
42
|
+
std::to_string(ts_language_version(language));
|
|
43
|
+
RangeError::New(env, message.c_str());
|
|
44
|
+
return nullptr;
|
|
45
|
+
}
|
|
46
|
+
return language;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
throw TypeError::New(env, "Invalid language object");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
namespace {
|
|
53
|
+
|
|
54
|
+
Napi::Value GetNodeTypeNamesById(const Napi::CallbackInfo &info) {
|
|
55
|
+
Env env = info.Env();
|
|
56
|
+
|
|
57
|
+
const TSLanguage *language = UnwrapLanguage(info[0]);
|
|
58
|
+
if (language == nullptr) {
|
|
59
|
+
return env.Undefined();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
auto result = Array::New(env);
|
|
63
|
+
uint32_t length = ts_language_symbol_count(language);
|
|
64
|
+
for (uint32_t i = 0; i < length; i++) {
|
|
65
|
+
const char *name = ts_language_symbol_name(language, i);
|
|
66
|
+
TSSymbolType type = ts_language_symbol_type(language, i);
|
|
67
|
+
if (type == TSSymbolTypeRegular) {
|
|
68
|
+
result[i] = String::New(env, name);
|
|
69
|
+
} else {
|
|
70
|
+
result[i] = env.Null();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
Napi::Value GetNodeFieldNamesById(const Napi::CallbackInfo &info) {
|
|
78
|
+
Env env = info.Env();
|
|
79
|
+
|
|
80
|
+
const TSLanguage *language = UnwrapLanguage(info[0]);
|
|
81
|
+
if (language == nullptr) {
|
|
82
|
+
return env.Undefined();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
auto result = Array::New(env);
|
|
86
|
+
uint32_t length = ts_language_field_count(language);
|
|
87
|
+
for (uint32_t i = 0; i < length + 1; i++) {
|
|
88
|
+
const char *name = ts_language_field_name_for_id(language, i);
|
|
89
|
+
if (name != nullptr) {
|
|
90
|
+
result[i] = String::New(env, name);
|
|
91
|
+
} else {
|
|
92
|
+
result[i] = env.Null();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
} // namespace
|
|
100
|
+
|
|
101
|
+
void Init(Napi::Env env, Napi::Object exports) {
|
|
102
|
+
exports["getNodeTypeNamesById"] = Function::New(env, GetNodeTypeNamesById);
|
|
103
|
+
exports["getNodeFieldNamesById"] = Function::New(env, GetNodeFieldNamesById);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
} // namespace node_tree_sitter::language_methods
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#ifndef NODE_TREE_SITTER_LANGUAGE_H_
|
|
2
|
+
#define NODE_TREE_SITTER_LANGUAGE_H_
|
|
3
|
+
|
|
4
|
+
#include "tree_sitter/api.h"
|
|
5
|
+
|
|
6
|
+
#include <napi.h>
|
|
7
|
+
#include <node_object_wrap.h>
|
|
8
|
+
|
|
9
|
+
namespace node_tree_sitter::language_methods {
|
|
10
|
+
|
|
11
|
+
void Init(Napi::Env env, Napi::Object);
|
|
12
|
+
|
|
13
|
+
const TSLanguage *UnwrapLanguage(Napi::Value);
|
|
14
|
+
|
|
15
|
+
} // namespace node_tree_sitter::language_methods
|
|
16
|
+
|
|
17
|
+
#endif // NODE_TREE_SITTER_LANGUAGE_H_
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#include "./logger.h"
|
|
2
|
+
#include "tree_sitter/api.h"
|
|
3
|
+
|
|
4
|
+
#include <napi.h>
|
|
5
|
+
#include <string>
|
|
6
|
+
|
|
7
|
+
using namespace Napi;
|
|
8
|
+
using std::string;
|
|
9
|
+
|
|
10
|
+
namespace node_tree_sitter {
|
|
11
|
+
|
|
12
|
+
void Logger::Log(void *payload, TSLogType type, const char *message_str) {
|
|
13
|
+
auto *debugger = static_cast<Logger *>(payload);
|
|
14
|
+
Env env = debugger->func.Env();
|
|
15
|
+
|
|
16
|
+
string message(message_str);
|
|
17
|
+
string param_sep = " ";
|
|
18
|
+
size_t param_sep_pos = message.find(param_sep, 0);
|
|
19
|
+
|
|
20
|
+
String type_name = String::New(env, (type == TSLogTypeParse) ? "parse" : "lex");;
|
|
21
|
+
String name = String::New(env, message.substr(0, param_sep_pos));
|
|
22
|
+
Object params = Object::New(env);
|
|
23
|
+
|
|
24
|
+
while (param_sep_pos != string::npos) {
|
|
25
|
+
size_t key_pos = param_sep_pos + param_sep.size();
|
|
26
|
+
size_t value_sep_pos = message.find(':', key_pos);
|
|
27
|
+
|
|
28
|
+
if (value_sep_pos == string::npos) {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
size_t val_pos = value_sep_pos + 1;
|
|
33
|
+
param_sep = ", ";
|
|
34
|
+
param_sep_pos = message.find(param_sep, value_sep_pos);
|
|
35
|
+
|
|
36
|
+
string key = message.substr(key_pos, (value_sep_pos - key_pos));
|
|
37
|
+
string value = message.substr(val_pos, (param_sep_pos - val_pos));
|
|
38
|
+
params[key] = String::New(env, value);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
debugger->func({ name, params, type_name });
|
|
43
|
+
} catch (const Error &error) {
|
|
44
|
+
Value console = env.Global()["console"];
|
|
45
|
+
if (!console.IsObject()) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
Value error_fn = console.As<Object>()["error"];
|
|
50
|
+
if (!error_fn.IsFunction()) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
error_fn.As<Function>()({
|
|
55
|
+
String::New(env, "Error in debug callback:"),
|
|
56
|
+
error.Value()
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
TSLogger Logger::Make(const Napi::Function &func) {
|
|
62
|
+
TSLogger result;
|
|
63
|
+
auto *logger = new Logger();
|
|
64
|
+
logger->func = Napi::Persistent(func);
|
|
65
|
+
result.payload = static_cast<void *>(logger);
|
|
66
|
+
result.log = Log;
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
} // namespace node_tree_sitter
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#ifndef NODE_TREE_SITTER_LOGGER_H_
|
|
2
|
+
#define NODE_TREE_SITTER_LOGGER_H_
|
|
3
|
+
|
|
4
|
+
#include "tree_sitter/api.h"
|
|
5
|
+
|
|
6
|
+
#include <napi.h>
|
|
7
|
+
|
|
8
|
+
namespace node_tree_sitter {
|
|
9
|
+
|
|
10
|
+
class Logger final {
|
|
11
|
+
public:
|
|
12
|
+
static TSLogger Make(const Napi::Function &);
|
|
13
|
+
Napi::FunctionReference func;
|
|
14
|
+
static void Log(void *, TSLogType, const char *);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
} // namespace node_tree_sitter
|
|
18
|
+
|
|
19
|
+
#endif // NODE_TREE_SITTER_LOGGER_H_
|