@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.
Files changed (149) hide show
  1. package/cli.mjs +1 -1
  2. package/package.json +1 -1
  3. package/reachability-analyzers-cli.mjs +1 -1
  4. package/repos/coana-tech/alucard/alucard.jar +0 -0
  5. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/cli.mjs +24669 -0
  6. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/LICENSE.md +9 -0
  7. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/README.md +95 -0
  8. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/common.gypi +21 -0
  9. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/except.gypi +25 -0
  10. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/index.js +14 -0
  11. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
  12. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/napi-inl.h +6941 -0
  13. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/napi.h +3295 -0
  14. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/node_addon_api.gyp +42 -0
  15. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/node_api.gyp +9 -0
  16. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/noexcept.gypi +26 -0
  17. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/nothing.c +0 -0
  18. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/package-support.json +21 -0
  19. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/package.json +480 -0
  20. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/tools/README.md +73 -0
  21. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/tools/check-napi.js +99 -0
  22. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/tools/clang-format.js +71 -0
  23. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-addon-api/tools/conversion.js +301 -0
  24. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/LICENSE +21 -0
  25. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/README.md +58 -0
  26. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/SECURITY.md +5 -0
  27. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/bin.js +84 -0
  28. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/build-test.js +19 -0
  29. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/index.js +6 -0
  30. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/node-gyp-build.js +207 -0
  31. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/optional.js +7 -0
  32. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/node-gyp-build/package.json +43 -0
  33. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/LICENSE +21 -0
  34. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/README.md +128 -0
  35. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/binding.gyp +80 -0
  36. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/index.js +919 -0
  37. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/node_modules/.bin/node-gyp-build +16 -0
  38. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/node_modules/.bin/node-gyp-build-optional +16 -0
  39. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/node_modules/.bin/node-gyp-build-test +16 -0
  40. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/package.json +76 -0
  41. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
  42. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
  43. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/linux-arm64/tree-sitter.node +0 -0
  44. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
  45. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/win32-arm64/tree-sitter.node +0 -0
  46. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
  47. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/addon_data.h +47 -0
  48. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/binding.cc +35 -0
  49. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/conversions.cc +140 -0
  50. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/conversions.h +22 -0
  51. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/language.cc +106 -0
  52. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/language.h +17 -0
  53. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/logger.cc +70 -0
  54. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/logger.h +19 -0
  55. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
  56. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
  57. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/node.cc +1088 -0
  58. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/node.h +30 -0
  59. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/parser.cc +306 -0
  60. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/parser.h +35 -0
  61. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/query.cc +397 -0
  62. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/query.h +40 -0
  63. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/tree.cc +316 -0
  64. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/tree.h +45 -0
  65. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
  66. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/src/tree_cursor.h +52 -0
  67. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/tree-sitter.d.ts +1042 -0
  68. 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
  69. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
  70. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
  71. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +291 -0
  72. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
  73. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
  74. 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
  75. 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
  76. 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
  77. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
  78. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +223 -0
  79. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +297 -0
  80. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
  81. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +435 -0
  82. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
  83. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +12 -0
  84. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +920 -0
  85. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2165 -0
  86. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +266 -0
  87. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
  88. 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
  89. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4187 -0
  90. 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
  91. 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
  92. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
  93. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +130 -0
  94. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1066 -0
  95. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +399 -0
  96. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +170 -0
  97. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
  98. 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
  99. 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
  100. 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
  101. 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
  102. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +83 -0
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/LICENSE +22 -0
  117. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/README.md +21 -0
  118. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/binding.gyp +30 -0
  119. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/bindings/node/binding.cc +20 -0
  120. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/bindings/node/binding_test.js +9 -0
  121. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/bindings/node/index.d.ts +28 -0
  122. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/bindings/node/index.js +11 -0
  123. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/grammar.js +1281 -0
  124. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/node_modules/.bin/node-gyp-build +16 -0
  125. 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
  126. 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
  127. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/package.json +77 -0
  128. 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
  129. 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
  130. 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
  131. 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
  132. 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
  133. 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
  134. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/queries/highlights.scm +154 -0
  135. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/queries/locals.scm +27 -0
  136. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/queries/tags.scm +64 -0
  137. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/grammar.json +8364 -0
  138. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/node-types.json +4108 -0
  139. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/parser.c +471247 -0
  140. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/scanner.c +1107 -0
  141. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/tree_sitter/alloc.h +54 -0
  142. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/tree_sitter/array.h +290 -0
  143. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/src/tree_sitter/parser.h +266 -0
  144. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/tree-sitter-ruby.wasm +0 -0
  145. package/repos/coana-tech/callgraph-reachability-analyzers/packages/cli/dist/bundle/node_modules/tree-sitter-ruby/tree-sitter.json +46 -0
  146. package/repos/coana-tech/goana/bin/goana-darwin-amd64.gz +0 -0
  147. package/repos/coana-tech/goana/bin/goana-darwin-arm64.gz +0 -0
  148. package/repos/coana-tech/goana/bin/goana-linux-amd64.gz +0 -0
  149. package/repos/coana-tech/goana/bin/goana-linux-arm64.gz +0 -0
@@ -0,0 +1,712 @@
1
+ #include "tree_sitter/api.h"
2
+ #include "./tree_cursor.h"
3
+ #include "./language.h"
4
+ #include "./tree.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
+ uint32_t descendant_index;
13
+ const TSSymbol *alias_sequence;
14
+ } CursorChildIterator;
15
+
16
+ // CursorChildIterator
17
+
18
+ static inline bool ts_tree_cursor_is_entry_visible(const TreeCursor *self, uint32_t index) {
19
+ TreeCursorEntry *entry = &self->stack.contents[index];
20
+ if (index == 0 || ts_subtree_visible(*entry->subtree)) {
21
+ return true;
22
+ } else if (!ts_subtree_extra(*entry->subtree)) {
23
+ TreeCursorEntry *parent_entry = &self->stack.contents[index - 1];
24
+ return ts_language_alias_at(
25
+ self->tree->language,
26
+ parent_entry->subtree->ptr->production_id,
27
+ entry->structural_child_index
28
+ );
29
+ } else {
30
+ return false;
31
+ }
32
+ }
33
+
34
+ static inline CursorChildIterator ts_tree_cursor_iterate_children(const TreeCursor *self) {
35
+ TreeCursorEntry *last_entry = array_back(&self->stack);
36
+ if (ts_subtree_child_count(*last_entry->subtree) == 0) {
37
+ return (CursorChildIterator) {NULL_SUBTREE, self->tree, length_zero(), 0, 0, 0, NULL};
38
+ }
39
+ const TSSymbol *alias_sequence = ts_language_alias_sequence(
40
+ self->tree->language,
41
+ last_entry->subtree->ptr->production_id
42
+ );
43
+
44
+ uint32_t descendant_index = last_entry->descendant_index;
45
+ if (ts_tree_cursor_is_entry_visible(self, self->stack.size - 1)) {
46
+ descendant_index += 1;
47
+ }
48
+
49
+ return (CursorChildIterator) {
50
+ .tree = self->tree,
51
+ .parent = *last_entry->subtree,
52
+ .position = last_entry->position,
53
+ .child_index = 0,
54
+ .structural_child_index = 0,
55
+ .descendant_index = descendant_index,
56
+ .alias_sequence = alias_sequence,
57
+ };
58
+ }
59
+
60
+ static inline bool ts_tree_cursor_child_iterator_next(
61
+ CursorChildIterator *self,
62
+ TreeCursorEntry *result,
63
+ bool *visible
64
+ ) {
65
+ if (!self->parent.ptr || self->child_index == self->parent.ptr->child_count) return false;
66
+ const Subtree *child = &ts_subtree_children(self->parent)[self->child_index];
67
+ *result = (TreeCursorEntry) {
68
+ .subtree = child,
69
+ .position = self->position,
70
+ .child_index = self->child_index,
71
+ .structural_child_index = self->structural_child_index,
72
+ .descendant_index = self->descendant_index,
73
+ };
74
+ *visible = ts_subtree_visible(*child);
75
+ bool extra = ts_subtree_extra(*child);
76
+ if (!extra) {
77
+ if (self->alias_sequence) {
78
+ *visible |= self->alias_sequence[self->structural_child_index];
79
+ }
80
+ self->structural_child_index++;
81
+ }
82
+
83
+ self->descendant_index += ts_subtree_visible_descendant_count(*child);
84
+ if (*visible) {
85
+ self->descendant_index += 1;
86
+ }
87
+
88
+ self->position = length_add(self->position, ts_subtree_size(*child));
89
+ self->child_index++;
90
+
91
+ if (self->child_index < self->parent.ptr->child_count) {
92
+ Subtree next_child = ts_subtree_children(self->parent)[self->child_index];
93
+ self->position = length_add(self->position, ts_subtree_padding(next_child));
94
+ }
95
+
96
+ return true;
97
+ }
98
+
99
+ // Return a position that, when `b` is added to it, yields `a`. This
100
+ // can only be computed if `b` has zero rows. Otherwise, this function
101
+ // returns `LENGTH_UNDEFINED`, and the caller needs to recompute
102
+ // the position some other way.
103
+ static inline Length length_backtrack(Length a, Length b) {
104
+ if (length_is_undefined(a) || b.extent.row != 0) {
105
+ return LENGTH_UNDEFINED;
106
+ }
107
+
108
+ Length result;
109
+ result.bytes = a.bytes - b.bytes;
110
+ result.extent.row = a.extent.row;
111
+ result.extent.column = a.extent.column - b.extent.column;
112
+ return result;
113
+ }
114
+
115
+ static inline bool ts_tree_cursor_child_iterator_previous(
116
+ CursorChildIterator *self,
117
+ TreeCursorEntry *result,
118
+ bool *visible
119
+ ) {
120
+ // this is mostly a reverse `ts_tree_cursor_child_iterator_next` taking into
121
+ // account unsigned underflow
122
+ if (!self->parent.ptr || (int8_t)self->child_index == -1) return false;
123
+ const Subtree *child = &ts_subtree_children(self->parent)[self->child_index];
124
+ *result = (TreeCursorEntry) {
125
+ .subtree = child,
126
+ .position = self->position,
127
+ .child_index = self->child_index,
128
+ .structural_child_index = self->structural_child_index,
129
+ };
130
+ *visible = ts_subtree_visible(*child);
131
+ bool extra = ts_subtree_extra(*child);
132
+ if (!extra && self->alias_sequence) {
133
+ *visible |= self->alias_sequence[self->structural_child_index];
134
+ self->structural_child_index--;
135
+ }
136
+
137
+ self->position = length_backtrack(self->position, ts_subtree_padding(*child));
138
+ self->child_index--;
139
+
140
+ // unsigned can underflow so compare it to child_count
141
+ if (self->child_index < self->parent.ptr->child_count) {
142
+ Subtree previous_child = ts_subtree_children(self->parent)[self->child_index];
143
+ Length size = ts_subtree_size(previous_child);
144
+ self->position = length_backtrack(self->position, size);
145
+ }
146
+
147
+ return true;
148
+ }
149
+
150
+ // TSTreeCursor - lifecycle
151
+
152
+ TSTreeCursor ts_tree_cursor_new(TSNode node) {
153
+ TSTreeCursor self = {NULL, NULL, {0, 0, 0}};
154
+ ts_tree_cursor_init((TreeCursor *)&self, node);
155
+ return self;
156
+ }
157
+
158
+ void ts_tree_cursor_reset(TSTreeCursor *_self, TSNode node) {
159
+ ts_tree_cursor_init((TreeCursor *)_self, node);
160
+ }
161
+
162
+ void ts_tree_cursor_init(TreeCursor *self, TSNode node) {
163
+ self->tree = node.tree;
164
+ self->root_alias_symbol = node.context[3];
165
+ array_clear(&self->stack);
166
+ array_push(&self->stack, ((TreeCursorEntry) {
167
+ .subtree = (const Subtree *)node.id,
168
+ .position = {
169
+ ts_node_start_byte(node),
170
+ ts_node_start_point(node)
171
+ },
172
+ .child_index = 0,
173
+ .structural_child_index = 0,
174
+ .descendant_index = 0,
175
+ }));
176
+ }
177
+
178
+ void ts_tree_cursor_delete(TSTreeCursor *_self) {
179
+ TreeCursor *self = (TreeCursor *)_self;
180
+ array_delete(&self->stack);
181
+ }
182
+
183
+ // TSTreeCursor - walking the tree
184
+
185
+ TreeCursorStep ts_tree_cursor_goto_first_child_internal(TSTreeCursor *_self) {
186
+ TreeCursor *self = (TreeCursor *)_self;
187
+ bool visible;
188
+ TreeCursorEntry entry;
189
+ CursorChildIterator iterator = ts_tree_cursor_iterate_children(self);
190
+ while (ts_tree_cursor_child_iterator_next(&iterator, &entry, &visible)) {
191
+ if (visible) {
192
+ array_push(&self->stack, entry);
193
+ return TreeCursorStepVisible;
194
+ }
195
+ if (ts_subtree_visible_child_count(*entry.subtree) > 0) {
196
+ array_push(&self->stack, entry);
197
+ return TreeCursorStepHidden;
198
+ }
199
+ }
200
+ return TreeCursorStepNone;
201
+ }
202
+
203
+ bool ts_tree_cursor_goto_first_child(TSTreeCursor *self) {
204
+ for (;;) {
205
+ switch (ts_tree_cursor_goto_first_child_internal(self)) {
206
+ case TreeCursorStepHidden:
207
+ continue;
208
+ case TreeCursorStepVisible:
209
+ return true;
210
+ default:
211
+ return false;
212
+ }
213
+ }
214
+ }
215
+
216
+ TreeCursorStep ts_tree_cursor_goto_last_child_internal(TSTreeCursor *_self) {
217
+ TreeCursor *self = (TreeCursor *)_self;
218
+ bool visible;
219
+ TreeCursorEntry entry;
220
+ CursorChildIterator iterator = ts_tree_cursor_iterate_children(self);
221
+ if (!iterator.parent.ptr || iterator.parent.ptr->child_count == 0) return TreeCursorStepNone;
222
+
223
+ TreeCursorEntry last_entry = {0};
224
+ TreeCursorStep last_step = TreeCursorStepNone;
225
+ while (ts_tree_cursor_child_iterator_next(&iterator, &entry, &visible)) {
226
+ if (visible) {
227
+ last_entry = entry;
228
+ last_step = TreeCursorStepVisible;
229
+ }
230
+ else if (ts_subtree_visible_child_count(*entry.subtree) > 0) {
231
+ last_entry = entry;
232
+ last_step = TreeCursorStepHidden;
233
+ }
234
+ }
235
+ if (last_entry.subtree) {
236
+ array_push(&self->stack, last_entry);
237
+ return last_step;
238
+ }
239
+
240
+ return TreeCursorStepNone;
241
+ }
242
+
243
+ bool ts_tree_cursor_goto_last_child(TSTreeCursor *self) {
244
+ for (;;) {
245
+ switch (ts_tree_cursor_goto_last_child_internal(self)) {
246
+ case TreeCursorStepHidden:
247
+ continue;
248
+ case TreeCursorStepVisible:
249
+ return true;
250
+ default:
251
+ return false;
252
+ }
253
+ }
254
+ }
255
+
256
+ static inline int64_t ts_tree_cursor_goto_first_child_for_byte_and_point(
257
+ TSTreeCursor *_self,
258
+ uint32_t goal_byte,
259
+ TSPoint goal_point
260
+ ) {
261
+ TreeCursor *self = (TreeCursor *)_self;
262
+ uint32_t initial_size = self->stack.size;
263
+ uint32_t visible_child_index = 0;
264
+
265
+ bool did_descend;
266
+ do {
267
+ did_descend = false;
268
+
269
+ bool visible;
270
+ TreeCursorEntry entry;
271
+ CursorChildIterator iterator = ts_tree_cursor_iterate_children(self);
272
+ while (ts_tree_cursor_child_iterator_next(&iterator, &entry, &visible)) {
273
+ Length entry_end = length_add(entry.position, ts_subtree_size(*entry.subtree));
274
+ bool at_goal = entry_end.bytes > goal_byte && point_gt(entry_end.extent, goal_point);
275
+ uint32_t visible_child_count = ts_subtree_visible_child_count(*entry.subtree);
276
+ if (at_goal) {
277
+ if (visible) {
278
+ array_push(&self->stack, entry);
279
+ return visible_child_index;
280
+ }
281
+ if (visible_child_count > 0) {
282
+ array_push(&self->stack, entry);
283
+ did_descend = true;
284
+ break;
285
+ }
286
+ } else if (visible) {
287
+ visible_child_index++;
288
+ } else {
289
+ visible_child_index += visible_child_count;
290
+ }
291
+ }
292
+ } while (did_descend);
293
+
294
+ self->stack.size = initial_size;
295
+ return -1;
296
+ }
297
+
298
+ int64_t ts_tree_cursor_goto_first_child_for_byte(TSTreeCursor *self, uint32_t goal_byte) {
299
+ return ts_tree_cursor_goto_first_child_for_byte_and_point(self, goal_byte, POINT_ZERO);
300
+ }
301
+
302
+ int64_t ts_tree_cursor_goto_first_child_for_point(TSTreeCursor *self, TSPoint goal_point) {
303
+ return ts_tree_cursor_goto_first_child_for_byte_and_point(self, 0, goal_point);
304
+ }
305
+
306
+ TreeCursorStep ts_tree_cursor_goto_sibling_internal(
307
+ TSTreeCursor *_self,
308
+ bool (*advance)(CursorChildIterator *, TreeCursorEntry *, bool *)) {
309
+ TreeCursor *self = (TreeCursor *)_self;
310
+ uint32_t initial_size = self->stack.size;
311
+
312
+ while (self->stack.size > 1) {
313
+ TreeCursorEntry entry = array_pop(&self->stack);
314
+ CursorChildIterator iterator = ts_tree_cursor_iterate_children(self);
315
+ iterator.child_index = entry.child_index;
316
+ iterator.structural_child_index = entry.structural_child_index;
317
+ iterator.position = entry.position;
318
+ iterator.descendant_index = entry.descendant_index;
319
+
320
+ bool visible = false;
321
+ advance(&iterator, &entry, &visible);
322
+ if (visible && self->stack.size + 1 < initial_size) break;
323
+
324
+ while (advance(&iterator, &entry, &visible)) {
325
+ if (visible) {
326
+ array_push(&self->stack, entry);
327
+ return TreeCursorStepVisible;
328
+ }
329
+
330
+ if (ts_subtree_visible_child_count(*entry.subtree)) {
331
+ array_push(&self->stack, entry);
332
+ return TreeCursorStepHidden;
333
+ }
334
+ }
335
+ }
336
+
337
+ self->stack.size = initial_size;
338
+ return TreeCursorStepNone;
339
+ }
340
+
341
+ TreeCursorStep ts_tree_cursor_goto_next_sibling_internal(TSTreeCursor *_self) {
342
+ return ts_tree_cursor_goto_sibling_internal(_self, ts_tree_cursor_child_iterator_next);
343
+ }
344
+
345
+ bool ts_tree_cursor_goto_next_sibling(TSTreeCursor *self) {
346
+ switch (ts_tree_cursor_goto_next_sibling_internal(self)) {
347
+ case TreeCursorStepHidden:
348
+ ts_tree_cursor_goto_first_child(self);
349
+ return true;
350
+ case TreeCursorStepVisible:
351
+ return true;
352
+ default:
353
+ return false;
354
+ }
355
+ }
356
+
357
+ TreeCursorStep ts_tree_cursor_goto_previous_sibling_internal(TSTreeCursor *_self) {
358
+ // since subtracting across row loses column information, we may have to
359
+ // restore it
360
+ TreeCursor *self = (TreeCursor *)_self;
361
+
362
+ // for that, save current position before traversing
363
+ TreeCursorStep step = ts_tree_cursor_goto_sibling_internal(
364
+ _self, ts_tree_cursor_child_iterator_previous);
365
+ if (step == TreeCursorStepNone)
366
+ return step;
367
+
368
+ // if length is already valid, there's no need to recompute it
369
+ if (!length_is_undefined(array_back(&self->stack)->position))
370
+ return step;
371
+
372
+ // restore position from the parent node
373
+ const TreeCursorEntry *parent = &self->stack.contents[self->stack.size - 2];
374
+ Length position = parent->position;
375
+ uint32_t child_index = array_back(&self->stack)->child_index;
376
+ const Subtree *children = ts_subtree_children((*(parent->subtree)));
377
+
378
+ if (child_index > 0) {
379
+ // skip first child padding since its position should match the position of the parent
380
+ position = length_add(position, ts_subtree_size(children[0]));
381
+ for (uint32_t i = 1; i < child_index; ++i) {
382
+ position = length_add(position, ts_subtree_total_size(children[i]));
383
+ }
384
+ position = length_add(position, ts_subtree_padding(children[child_index]));
385
+ }
386
+
387
+ array_back(&self->stack)->position = position;
388
+
389
+ return step;
390
+ }
391
+
392
+ bool ts_tree_cursor_goto_previous_sibling(TSTreeCursor *self) {
393
+ switch (ts_tree_cursor_goto_previous_sibling_internal(self)) {
394
+ case TreeCursorStepHidden:
395
+ ts_tree_cursor_goto_last_child(self);
396
+ return true;
397
+ case TreeCursorStepVisible:
398
+ return true;
399
+ default:
400
+ return false;
401
+ }
402
+ }
403
+
404
+ bool ts_tree_cursor_goto_parent(TSTreeCursor *_self) {
405
+ TreeCursor *self = (TreeCursor *)_self;
406
+ for (unsigned i = self->stack.size - 2; i + 1 > 0; i--) {
407
+ if (ts_tree_cursor_is_entry_visible(self, i)) {
408
+ self->stack.size = i + 1;
409
+ return true;
410
+ }
411
+ }
412
+ return false;
413
+ }
414
+
415
+ void ts_tree_cursor_goto_descendant(
416
+ TSTreeCursor *_self,
417
+ uint32_t goal_descendant_index
418
+ ) {
419
+ TreeCursor *self = (TreeCursor *)_self;
420
+
421
+ // Ascend to the lowest ancestor that contains the goal node.
422
+ for (;;) {
423
+ uint32_t i = self->stack.size - 1;
424
+ TreeCursorEntry *entry = &self->stack.contents[i];
425
+ uint32_t next_descendant_index =
426
+ entry->descendant_index +
427
+ (ts_tree_cursor_is_entry_visible(self, i) ? 1 : 0) +
428
+ ts_subtree_visible_descendant_count(*entry->subtree);
429
+ if (
430
+ (entry->descendant_index <= goal_descendant_index) &&
431
+ (next_descendant_index > goal_descendant_index)
432
+ ) {
433
+ break;
434
+ } else if (self->stack.size <= 1) {
435
+ return;
436
+ } else {
437
+ self->stack.size--;
438
+ }
439
+ }
440
+
441
+ // Descend to the goal node.
442
+ bool did_descend = true;
443
+ do {
444
+ did_descend = false;
445
+ bool visible;
446
+ TreeCursorEntry entry;
447
+ CursorChildIterator iterator = ts_tree_cursor_iterate_children(self);
448
+ if (iterator.descendant_index > goal_descendant_index) {
449
+ return;
450
+ }
451
+
452
+ while (ts_tree_cursor_child_iterator_next(&iterator, &entry, &visible)) {
453
+ if (iterator.descendant_index > goal_descendant_index) {
454
+ array_push(&self->stack, entry);
455
+ if (visible && entry.descendant_index == goal_descendant_index) {
456
+ return;
457
+ } else {
458
+ did_descend = true;
459
+ break;
460
+ }
461
+ }
462
+ }
463
+ } while (did_descend);
464
+ }
465
+
466
+ uint32_t ts_tree_cursor_current_descendant_index(const TSTreeCursor *_self) {
467
+ const TreeCursor *self = (const TreeCursor *)_self;
468
+ TreeCursorEntry *last_entry = array_back(&self->stack);
469
+ return last_entry->descendant_index;
470
+ }
471
+
472
+ TSNode ts_tree_cursor_current_node(const TSTreeCursor *_self) {
473
+ const TreeCursor *self = (const TreeCursor *)_self;
474
+ TreeCursorEntry *last_entry = array_back(&self->stack);
475
+ bool is_extra = ts_subtree_extra(*last_entry->subtree);
476
+ TSSymbol alias_symbol = is_extra ? 0 : self->root_alias_symbol;
477
+ if (self->stack.size > 1 && !is_extra) {
478
+ TreeCursorEntry *parent_entry = &self->stack.contents[self->stack.size - 2];
479
+ alias_symbol = ts_language_alias_at(
480
+ self->tree->language,
481
+ parent_entry->subtree->ptr->production_id,
482
+ last_entry->structural_child_index
483
+ );
484
+ }
485
+ return ts_node_new(
486
+ self->tree,
487
+ last_entry->subtree,
488
+ last_entry->position,
489
+ alias_symbol
490
+ );
491
+ }
492
+
493
+ // Private - Get various facts about the current node that are needed
494
+ // when executing tree queries.
495
+ void ts_tree_cursor_current_status(
496
+ const TSTreeCursor *_self,
497
+ TSFieldId *field_id,
498
+ bool *has_later_siblings,
499
+ bool *has_later_named_siblings,
500
+ bool *can_have_later_siblings_with_this_field,
501
+ TSSymbol *supertypes,
502
+ unsigned *supertype_count
503
+ ) {
504
+ const TreeCursor *self = (const TreeCursor *)_self;
505
+ unsigned max_supertypes = *supertype_count;
506
+ *field_id = 0;
507
+ *supertype_count = 0;
508
+ *has_later_siblings = false;
509
+ *has_later_named_siblings = false;
510
+ *can_have_later_siblings_with_this_field = false;
511
+
512
+ // Walk up the tree, visiting the current node and its invisible ancestors,
513
+ // because fields can refer to nodes through invisible *wrapper* nodes,
514
+ for (unsigned i = self->stack.size - 1; i > 0; i--) {
515
+ TreeCursorEntry *entry = &self->stack.contents[i];
516
+ TreeCursorEntry *parent_entry = &self->stack.contents[i - 1];
517
+
518
+ const TSSymbol *alias_sequence = ts_language_alias_sequence(
519
+ self->tree->language,
520
+ parent_entry->subtree->ptr->production_id
521
+ );
522
+
523
+ #define subtree_symbol(subtree, structural_child_index) \
524
+ (( \
525
+ !ts_subtree_extra(subtree) && \
526
+ alias_sequence && \
527
+ alias_sequence[structural_child_index] \
528
+ ) ? \
529
+ alias_sequence[structural_child_index] : \
530
+ ts_subtree_symbol(subtree))
531
+
532
+ // Stop walking up when a visible ancestor is found.
533
+ TSSymbol entry_symbol = subtree_symbol(
534
+ *entry->subtree,
535
+ entry->structural_child_index
536
+ );
537
+ TSSymbolMetadata entry_metadata = ts_language_symbol_metadata(
538
+ self->tree->language,
539
+ entry_symbol
540
+ );
541
+ if (i != self->stack.size - 1 && entry_metadata.visible) break;
542
+
543
+ // Record any supertypes
544
+ if (entry_metadata.supertype && *supertype_count < max_supertypes) {
545
+ supertypes[*supertype_count] = entry_symbol;
546
+ (*supertype_count)++;
547
+ }
548
+
549
+ // Determine if the current node has later siblings.
550
+ if (!*has_later_siblings) {
551
+ unsigned sibling_count = parent_entry->subtree->ptr->child_count;
552
+ unsigned structural_child_index = entry->structural_child_index;
553
+ if (!ts_subtree_extra(*entry->subtree)) structural_child_index++;
554
+ for (unsigned j = entry->child_index + 1; j < sibling_count; j++) {
555
+ Subtree sibling = ts_subtree_children(*parent_entry->subtree)[j];
556
+ TSSymbolMetadata sibling_metadata = ts_language_symbol_metadata(
557
+ self->tree->language,
558
+ subtree_symbol(sibling, structural_child_index)
559
+ );
560
+ if (sibling_metadata.visible) {
561
+ *has_later_siblings = true;
562
+ if (*has_later_named_siblings) break;
563
+ if (sibling_metadata.named) {
564
+ *has_later_named_siblings = true;
565
+ break;
566
+ }
567
+ } else if (ts_subtree_visible_child_count(sibling) > 0) {
568
+ *has_later_siblings = true;
569
+ if (*has_later_named_siblings) break;
570
+ if (sibling.ptr->named_child_count > 0) {
571
+ *has_later_named_siblings = true;
572
+ break;
573
+ }
574
+ }
575
+ if (!ts_subtree_extra(sibling)) structural_child_index++;
576
+ }
577
+ }
578
+
579
+ #undef subtree_symbol
580
+
581
+ if (!ts_subtree_extra(*entry->subtree)) {
582
+ const TSFieldMapEntry *field_map, *field_map_end;
583
+ ts_language_field_map(
584
+ self->tree->language,
585
+ parent_entry->subtree->ptr->production_id,
586
+ &field_map, &field_map_end
587
+ );
588
+
589
+ // Look for a field name associated with the current node.
590
+ if (!*field_id) {
591
+ for (const TSFieldMapEntry *map = field_map; map < field_map_end; map++) {
592
+ if (!map->inherited && map->child_index == entry->structural_child_index) {
593
+ *field_id = map->field_id;
594
+ break;
595
+ }
596
+ }
597
+ }
598
+
599
+ // Determine if the current node can have later siblings with the same field name.
600
+ if (*field_id) {
601
+ for (const TSFieldMapEntry *map = field_map; map < field_map_end; map++) {
602
+ if (
603
+ map->field_id == *field_id &&
604
+ map->child_index > entry->structural_child_index
605
+ ) {
606
+ *can_have_later_siblings_with_this_field = true;
607
+ break;
608
+ }
609
+ }
610
+ }
611
+ }
612
+ }
613
+ }
614
+
615
+ uint32_t ts_tree_cursor_current_depth(const TSTreeCursor *_self) {
616
+ const TreeCursor *self = (const TreeCursor *)_self;
617
+ uint32_t depth = 0;
618
+ for (unsigned i = 1; i < self->stack.size; i++) {
619
+ if (ts_tree_cursor_is_entry_visible(self, i)) {
620
+ depth++;
621
+ }
622
+ }
623
+ return depth;
624
+ }
625
+
626
+ TSNode ts_tree_cursor_parent_node(const TSTreeCursor *_self) {
627
+ const TreeCursor *self = (const TreeCursor *)_self;
628
+ for (int i = (int)self->stack.size - 2; i >= 0; i--) {
629
+ TreeCursorEntry *entry = &self->stack.contents[i];
630
+ bool is_visible = true;
631
+ TSSymbol alias_symbol = 0;
632
+ if (i > 0) {
633
+ TreeCursorEntry *parent_entry = &self->stack.contents[i - 1];
634
+ alias_symbol = ts_language_alias_at(
635
+ self->tree->language,
636
+ parent_entry->subtree->ptr->production_id,
637
+ entry->structural_child_index
638
+ );
639
+ is_visible = (alias_symbol != 0) || ts_subtree_visible(*entry->subtree);
640
+ }
641
+ if (is_visible) {
642
+ return ts_node_new(
643
+ self->tree,
644
+ entry->subtree,
645
+ entry->position,
646
+ alias_symbol
647
+ );
648
+ }
649
+ }
650
+ return ts_node_new(NULL, NULL, length_zero(), 0);
651
+ }
652
+
653
+ TSFieldId ts_tree_cursor_current_field_id(const TSTreeCursor *_self) {
654
+ const TreeCursor *self = (const TreeCursor *)_self;
655
+
656
+ // Walk up the tree, visiting the current node and its invisible ancestors.
657
+ for (unsigned i = self->stack.size - 1; i > 0; i--) {
658
+ TreeCursorEntry *entry = &self->stack.contents[i];
659
+ TreeCursorEntry *parent_entry = &self->stack.contents[i - 1];
660
+
661
+ // Stop walking up when another visible node is found.
662
+ if (
663
+ i != self->stack.size - 1 &&
664
+ ts_tree_cursor_is_entry_visible(self, i)
665
+ ) break;
666
+
667
+ if (ts_subtree_extra(*entry->subtree)) break;
668
+
669
+ const TSFieldMapEntry *field_map, *field_map_end;
670
+ ts_language_field_map(
671
+ self->tree->language,
672
+ parent_entry->subtree->ptr->production_id,
673
+ &field_map, &field_map_end
674
+ );
675
+ for (const TSFieldMapEntry *map = field_map; map < field_map_end; map++) {
676
+ if (!map->inherited && map->child_index == entry->structural_child_index) {
677
+ return map->field_id;
678
+ }
679
+ }
680
+ }
681
+ return 0;
682
+ }
683
+
684
+ const char *ts_tree_cursor_current_field_name(const TSTreeCursor *_self) {
685
+ TSFieldId id = ts_tree_cursor_current_field_id(_self);
686
+ if (id) {
687
+ const TreeCursor *self = (const TreeCursor *)_self;
688
+ return self->tree->language->field_names[id];
689
+ } else {
690
+ return NULL;
691
+ }
692
+ }
693
+
694
+ TSTreeCursor ts_tree_cursor_copy(const TSTreeCursor *_cursor) {
695
+ const TreeCursor *cursor = (const TreeCursor *)_cursor;
696
+ TSTreeCursor res = {NULL, NULL, {0, 0}};
697
+ TreeCursor *copy = (TreeCursor *)&res;
698
+ copy->tree = cursor->tree;
699
+ copy->root_alias_symbol = cursor->root_alias_symbol;
700
+ array_init(&copy->stack);
701
+ array_push_all(&copy->stack, &cursor->stack);
702
+ return res;
703
+ }
704
+
705
+ void ts_tree_cursor_reset_to(TSTreeCursor *_dst, const TSTreeCursor *_src) {
706
+ const TreeCursor *cursor = (const TreeCursor *)_src;
707
+ TreeCursor *copy = (TreeCursor *)_dst;
708
+ copy->tree = cursor->tree;
709
+ copy->root_alias_symbol = cursor->root_alias_symbol;
710
+ array_clear(&copy->stack);
711
+ array_push_all(&copy->stack, &cursor->stack);
712
+ }