@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,1281 @@
1
+ /// <reference types="tree-sitter-cli/dsl" />
2
+ // @ts-check
3
+
4
+ const PREC = {
5
+ COMMENT: -2,
6
+ CURLY_BLOCK: 1,
7
+ DO_BLOCK: -1,
8
+
9
+ AND: -2,
10
+ OR: -2,
11
+ NOT: 5,
12
+ DEFINED: 10,
13
+ ALIAS: 11,
14
+ ASSIGN: 15,
15
+ RESCUE: 16,
16
+ CONDITIONAL: 20,
17
+ RANGE: 25,
18
+ BOOLEAN_OR: 30,
19
+ BOOLEAN_AND: 35,
20
+ RELATIONAL: 40,
21
+ COMPARISON: 45,
22
+ BITWISE_OR: 50,
23
+ BITWISE_AND: 55,
24
+ CALL: 56,
25
+ SHIFT: 60,
26
+ ADDITIVE: 65,
27
+ MULTIPLICATIVE: 70,
28
+ UNARY_MINUS: 75,
29
+ EXPONENTIAL: 80,
30
+ COMPLEMENT: 85,
31
+ };
32
+
33
+ const IDENTIFIER_CHARS = /[^\x00-\x1F\s:;`"'@$#.,|^&<=>+\-*/\\%?!~()\[\]{}]*/;
34
+ const LOWER_ALPHA_CHAR = /[^\x00-\x1F\sA-Z0-9:;`"'@$#.,|^&<=>+\-*/\\%?!~()\[\]{}]/;
35
+ const ALPHA_CHAR = /[^\x00-\x1F\s0-9:;`"'@$#.,|^&<=>+\-*/\\%?!~()\[\]{}]/;
36
+
37
+ module.exports = grammar({
38
+ name: 'ruby',
39
+ inline: $ => [$._arg_rhs, $._call_operator],
40
+ externals: $ => [
41
+ $._line_break,
42
+ $._no_line_break,
43
+
44
+ // Delimited literals
45
+ $.simple_symbol,
46
+ $._string_start,
47
+ $._symbol_start,
48
+ $._subshell_start,
49
+ $._regex_start,
50
+ $._string_array_start,
51
+ $._symbol_array_start,
52
+ $._heredoc_body_start,
53
+ $.string_content,
54
+ $.heredoc_content,
55
+ $._string_end,
56
+ $.heredoc_end,
57
+ $.heredoc_beginning,
58
+
59
+ // Tokens that require lookahead
60
+ '/',
61
+ $._block_ampersand,
62
+ $._splat_star,
63
+ $._unary_minus,
64
+ $._unary_minus_num,
65
+ $._binary_minus,
66
+ $._binary_star,
67
+ $._singleton_class_left_angle_left_langle,
68
+ $.hash_key_symbol,
69
+ $._identifier_suffix,
70
+ $._constant_suffix,
71
+ $._hash_splat_star_star,
72
+ $._binary_star_star,
73
+ $._element_reference_bracket,
74
+ $._short_interpolation,
75
+ ],
76
+
77
+ extras: $ => [
78
+ $.comment,
79
+ $.heredoc_body,
80
+ /\s/,
81
+ /\\\r?\n/,
82
+ ],
83
+
84
+ word: $ => $.identifier,
85
+
86
+ supertypes: $ => [
87
+ $._statement,
88
+ $._arg,
89
+ $._call_operator,
90
+ $._method_name,
91
+ $._expression,
92
+ $._variable,
93
+ $._primary,
94
+ $._simple_numeric,
95
+ $._lhs,
96
+ $._nonlocal_variable,
97
+ $._pattern_top_expr_body,
98
+ $._pattern_expr,
99
+ $._pattern_expr_basic,
100
+ $._pattern_primitive,
101
+ $._pattern_constant,
102
+ ],
103
+
104
+ rules: {
105
+ program: $ => seq(
106
+ optional($._statements),
107
+ optional(
108
+ choice(
109
+ seq(/__END__/, $.uninterpreted),
110
+ ),
111
+ ),
112
+ ),
113
+
114
+ uninterpreted: _ => /(.|\s)*/,
115
+
116
+ block_body: $ => $._statements,
117
+
118
+ _statements: $ => choice(
119
+ seq(
120
+ repeat1(choice(
121
+ seq($._statement, $._terminator),
122
+ $.empty_statement,
123
+ )),
124
+ optional($._statement),
125
+ ),
126
+ $._statement,
127
+ ),
128
+
129
+ begin_block: $ => seq('BEGIN', '{', optional($._statements), '}'),
130
+ end_block: $ => seq('END', '{', optional($._statements), '}'),
131
+
132
+ _statement: $ => choice(
133
+ $.undef,
134
+ $.alias,
135
+ $.if_modifier,
136
+ $.unless_modifier,
137
+ $.while_modifier,
138
+ $.until_modifier,
139
+ $.rescue_modifier,
140
+ $.begin_block,
141
+ $.end_block,
142
+ $._expression,
143
+ ),
144
+
145
+ method: $ => seq('def', $._method_rest),
146
+
147
+ singleton_method: $ => seq(
148
+ 'def',
149
+ seq(
150
+ choice(
151
+ field('object', $._variable),
152
+ seq('(', field('object', $._arg), ')'),
153
+ ),
154
+ choice('.', '::'),
155
+ ),
156
+ $._method_rest,
157
+ ),
158
+
159
+ _method_rest: $ => seq(
160
+ field('name', $._method_name),
161
+ choice(
162
+ $._body_expr,
163
+ seq(
164
+ field('parameters', alias($.parameters, $.method_parameters)),
165
+ choice(
166
+ seq(optional($._terminator), optional(field('body', $.body_statement)), 'end'),
167
+ $._body_expr,
168
+ ),
169
+
170
+ ),
171
+ seq(
172
+ optional(
173
+ field('parameters', alias($.bare_parameters, $.method_parameters)),
174
+ ),
175
+ $._terminator,
176
+ optional(field('body', $.body_statement)),
177
+ 'end',
178
+ ),
179
+ ),
180
+ ),
181
+
182
+ rescue_modifier_arg: $ => prec(PREC.RESCUE,
183
+ seq(
184
+ field('body', $._arg),
185
+ 'rescue',
186
+ field('handler', $._arg),
187
+ ),
188
+ ),
189
+
190
+ rescue_modifier_expression: $ => prec(PREC.RESCUE,
191
+ seq(
192
+ field('body', $._expression),
193
+ 'rescue',
194
+ field('handler', $._arg),
195
+ ),
196
+ ),
197
+
198
+ _body_expr: $ =>
199
+ seq(
200
+ '=',
201
+ field('body',
202
+ choice(
203
+ $._arg,
204
+ alias($.rescue_modifier_arg, $.rescue_modifier),
205
+ )),
206
+ ),
207
+
208
+
209
+ parameters: $ => seq(
210
+ '(',
211
+ commaSep($._formal_parameter),
212
+ ')',
213
+ ),
214
+
215
+ bare_parameters: $ => seq(
216
+ $._simple_formal_parameter,
217
+ repeat(seq(',', $._formal_parameter)),
218
+ ),
219
+
220
+ block_parameters: $ => seq(
221
+ '|',
222
+ seq(commaSep($._formal_parameter), optional(',')),
223
+ optional(seq(';', sep1(field('locals', $.identifier), ','))), // Block shadow args e.g. {|; a, b| ...}
224
+ '|',
225
+ ),
226
+
227
+ _formal_parameter: $ => choice(
228
+ $._simple_formal_parameter,
229
+ alias($.parameters, $.destructured_parameter),
230
+ ),
231
+
232
+ _simple_formal_parameter: $ => choice(
233
+ $.identifier,
234
+ $.splat_parameter,
235
+ $.hash_splat_parameter,
236
+ $.hash_splat_nil,
237
+ $.forward_parameter,
238
+ $.block_parameter,
239
+ $.keyword_parameter,
240
+ $.optional_parameter,
241
+ ),
242
+
243
+ forward_parameter: _ => '...',
244
+
245
+ splat_parameter: $ => prec.right(-2, seq(
246
+ '*',
247
+ field('name', optional($.identifier)),
248
+ )),
249
+ hash_splat_parameter: $ => seq(
250
+ '**',
251
+ field('name', optional($.identifier)),
252
+ ),
253
+ hash_splat_nil: _ => seq('**', 'nil'),
254
+ block_parameter: $ => seq(
255
+ '&',
256
+ field('name', optional($.identifier)),
257
+ ),
258
+ keyword_parameter: $ => prec.right(PREC.BITWISE_OR + 1, seq(
259
+ field('name', $.identifier),
260
+ token.immediate(':'),
261
+ field('value', optional($._arg)),
262
+ )),
263
+ optional_parameter: $ => prec(PREC.BITWISE_OR + 1, seq(
264
+ field('name', $.identifier),
265
+ '=',
266
+ field('value', $._arg),
267
+ )),
268
+
269
+ class: $ => seq(
270
+ 'class',
271
+ field('name', choice($.constant, $.scope_resolution)),
272
+ choice(
273
+ seq(field('superclass', $.superclass), $._terminator),
274
+ optional($._terminator),
275
+ ),
276
+ optional(field('body', $.body_statement)),
277
+ 'end',
278
+ ),
279
+
280
+ superclass: $ => seq('<', $._expression),
281
+
282
+ singleton_class: $ => seq(
283
+ 'class',
284
+ alias($._singleton_class_left_angle_left_langle, '<<'),
285
+ field('value', $._arg),
286
+ $._terminator,
287
+ optional(field('body', $.body_statement)),
288
+ 'end',
289
+ ),
290
+
291
+ module: $ => seq(
292
+ 'module',
293
+ field('name', choice($.constant, $.scope_resolution)),
294
+ optional($._terminator),
295
+ optional(field('body', $.body_statement)),
296
+ 'end',
297
+ ),
298
+
299
+ return_command: $ => prec.left(seq('return', alias($.command_argument_list, $.argument_list))),
300
+ yield_command: $ => prec.left(seq('yield', alias($.command_argument_list, $.argument_list))),
301
+ break_command: $ => prec.left(seq('break', alias($.command_argument_list, $.argument_list))),
302
+ next_command: $ => prec.left(seq('next', alias($.command_argument_list, $.argument_list))),
303
+ return: $ => prec.left(seq('return', optional($.argument_list))),
304
+ yield: $ => prec.left(seq('yield', optional($.argument_list))),
305
+ break: $ => prec.left(seq('break', optional($.argument_list))),
306
+ next: $ => prec.left(seq('next', optional($.argument_list))),
307
+ redo: $ => prec.left(seq('redo', optional($.argument_list))),
308
+ retry: $ => prec.left(seq('retry', optional($.argument_list))),
309
+
310
+ if_modifier: $ => prec(PREC.RESCUE, seq(
311
+ field('body', $._statement),
312
+ 'if',
313
+ field('condition', $._expression),
314
+ )),
315
+
316
+ unless_modifier: $ => prec(PREC.RESCUE, seq(
317
+ field('body', $._statement),
318
+ 'unless',
319
+ field('condition', $._expression),
320
+ )),
321
+
322
+ while_modifier: $ => prec(PREC.RESCUE, seq(
323
+ field('body', $._statement),
324
+ 'while',
325
+ field('condition', $._expression),
326
+ )),
327
+
328
+ until_modifier: $ => prec(PREC.RESCUE, seq(
329
+ field('body', $._statement),
330
+ 'until',
331
+ field('condition', $._expression),
332
+ )),
333
+
334
+ rescue_modifier: $ => prec(PREC.RESCUE, seq(
335
+ field('body', $._statement),
336
+ 'rescue',
337
+ field('handler', $._expression),
338
+ )),
339
+
340
+ while: $ => seq(
341
+ 'while',
342
+ field('condition', $._statement),
343
+ field('body', $.do),
344
+ ),
345
+
346
+ until: $ => seq(
347
+ 'until',
348
+ field('condition', $._statement),
349
+ field('body', $.do),
350
+ ),
351
+
352
+ for: $ => seq(
353
+ 'for',
354
+ field('pattern', choice($._lhs, $.left_assignment_list)),
355
+ field('value', $.in),
356
+ field('body', $.do),
357
+ ),
358
+
359
+ in: $ => seq('in', $._arg),
360
+ do: $ => seq(
361
+ choice('do', $._terminator),
362
+ optional($._statements),
363
+ 'end',
364
+ ),
365
+
366
+ case: $ => seq(
367
+ 'case',
368
+ optional(seq(optional($._line_break), field('value', $._statement))),
369
+ optional($._terminator),
370
+ repeat($.when),
371
+ optional($.else),
372
+ 'end',
373
+ ),
374
+
375
+ case_match: $ => seq(
376
+ 'case',
377
+ seq(optional($._line_break), field('value', $._statement)),
378
+ optional($._terminator),
379
+ repeat1(field('clauses', $.in_clause)),
380
+ optional(field('else', $.else)),
381
+ 'end',
382
+ ),
383
+
384
+ when: $ => seq(
385
+ 'when',
386
+ commaSep1(field('pattern', $.pattern)),
387
+ choice($._terminator, field('body', $.then)),
388
+ ),
389
+
390
+ in_clause: $ => seq(
391
+ 'in',
392
+ field('pattern', $._pattern_top_expr_body),
393
+ field('guard', optional($._guard)),
394
+ choice($._terminator, field('body', $.then)),
395
+ ),
396
+
397
+ pattern: $ => choice($._arg, $.splat_argument),
398
+
399
+ _guard: $ => choice(
400
+ $.if_guard,
401
+ $.unless_guard,
402
+ ),
403
+
404
+ if_guard: $ => seq(
405
+ 'if',
406
+ field('condition', $._expression),
407
+ ),
408
+
409
+ unless_guard: $ => seq(
410
+ 'unless',
411
+ field('condition', $._expression),
412
+ ),
413
+
414
+ _pattern_top_expr_body: $ => prec(-1, choice(
415
+ $._pattern_expr,
416
+ alias($._array_pattern_n, $.array_pattern),
417
+ alias($._find_pattern_body, $.find_pattern),
418
+ alias($._hash_pattern_body, $.hash_pattern),
419
+ )),
420
+
421
+ _array_pattern_n: $ => prec.right(choice(
422
+ seq($._pattern_expr, alias(',', $.splat_parameter)),
423
+ seq($._pattern_expr, ',', choice($._pattern_expr, $._array_pattern_n)),
424
+ seq($.splat_parameter, repeat(seq(',', $._pattern_expr))),
425
+ )),
426
+
427
+ _pattern_expr: $ => choice(
428
+ $.as_pattern,
429
+ $._pattern_expr_alt,
430
+ ),
431
+
432
+ as_pattern: $ => seq(field('value', $._pattern_expr), '=>', field('name', $.identifier)),
433
+
434
+ _pattern_expr_alt: $ => choice(
435
+ $.alternative_pattern,
436
+ $._pattern_expr_basic,
437
+ ),
438
+
439
+ alternative_pattern: $ => seq(field('alternatives', $._pattern_expr_basic), repeat1(seq('|', field('alternatives', $._pattern_expr_basic)))),
440
+
441
+ _array_pattern_body: $ => choice(
442
+ $._pattern_expr,
443
+ $._array_pattern_n,
444
+ ),
445
+
446
+ array_pattern: $ => prec.right(-1, choice(
447
+ seq('[', optional($._array_pattern_body), ']'),
448
+ seq(field('class', $._pattern_constant), token.immediate('['), optional($._array_pattern_body), ']'),
449
+ seq(field('class', $._pattern_constant), token.immediate('('), optional($._array_pattern_body), ')'),
450
+ )),
451
+
452
+ _find_pattern_body: $ => seq($.splat_parameter, repeat1(seq(',', $._pattern_expr)), ',', $.splat_parameter),
453
+ find_pattern: $ => choice(
454
+ seq('[', $._find_pattern_body, ']'),
455
+ seq(field('class', $._pattern_constant), token.immediate('['), $._find_pattern_body, ']'),
456
+ seq(field('class', $._pattern_constant), token.immediate('('), $._find_pattern_body, ')'),
457
+ ),
458
+
459
+ _hash_pattern_body: $ => prec.right(choice(
460
+ seq(commaSep1($.keyword_pattern), optional(',')),
461
+ seq(commaSep1($.keyword_pattern), ',', $._hash_pattern_any_rest),
462
+ $._hash_pattern_any_rest,
463
+ )),
464
+
465
+ keyword_pattern: $ => prec.right(-1, seq(
466
+ field('key',
467
+ choice(
468
+ alias($.identifier, $.hash_key_symbol),
469
+ alias($.constant, $.hash_key_symbol),
470
+ alias($.identifier_suffix, $.hash_key_symbol),
471
+ alias($.constant_suffix, $.hash_key_symbol),
472
+ $.string,
473
+ ),
474
+ ),
475
+ token.immediate(':'),
476
+ optional(field('value', $._pattern_expr)),
477
+ )),
478
+
479
+ _hash_pattern_any_rest: $ => choice($.hash_splat_parameter, $.hash_splat_nil),
480
+
481
+ hash_pattern: $ => prec.right(-1, choice(
482
+ seq('{', optional($._hash_pattern_body), '}'),
483
+ seq(field('class', $._pattern_constant), token.immediate('['), $._hash_pattern_body, ']'),
484
+ seq(field('class', $._pattern_constant), token.immediate('('), $._hash_pattern_body, ')'),
485
+ )),
486
+
487
+ _pattern_expr_basic: $ => prec.right(-1, choice(
488
+ $._pattern_value,
489
+ $.identifier,
490
+ $.array_pattern,
491
+ $.find_pattern,
492
+ $.hash_pattern,
493
+ $.parenthesized_pattern,
494
+ )),
495
+
496
+ parenthesized_pattern: $ => seq('(', $._pattern_expr, ')'),
497
+
498
+ _pattern_value: $ => prec.right(-1, choice(
499
+ $._pattern_primitive,
500
+ alias($._pattern_range, $.range),
501
+ $.variable_reference_pattern,
502
+ $.expression_reference_pattern,
503
+ $._pattern_constant,
504
+ )),
505
+
506
+ _pattern_range: $ => {
507
+ const begin = field('begin', $._pattern_primitive);
508
+ const end = field('end', $._pattern_primitive);
509
+ const operator = field('operator', choice('..', '...'));
510
+ return choice(
511
+ seq(begin, operator, end),
512
+ seq(operator, end),
513
+ seq(begin, operator),
514
+ );
515
+ },
516
+
517
+ _pattern_primitive: $ => choice(
518
+ $._pattern_literal,
519
+ $._pattern_lambda,
520
+ ),
521
+
522
+ _pattern_lambda: $ => prec.right(-1, $.lambda),
523
+
524
+ _pattern_literal: $ => prec.right(-1, choice(
525
+ $._literal,
526
+ $.string,
527
+ $.subshell,
528
+ $.heredoc_beginning,
529
+ $.regex,
530
+ $.string_array,
531
+ $.symbol_array,
532
+ $._keyword_variable,
533
+ )),
534
+
535
+ _keyword_variable: $ => prec.right(-1, choice(
536
+ $.nil,
537
+ $.self,
538
+ $.true,
539
+ $.false,
540
+ $.line,
541
+ $.file,
542
+ $.encoding,
543
+ )),
544
+
545
+ line: _ => '__LINE__',
546
+ file: _ => '__FILE__',
547
+ encoding: _ => '__ENCODING__',
548
+
549
+ variable_reference_pattern: $ => seq('^', field('name', choice($.identifier, $._nonlocal_variable))),
550
+
551
+ expression_reference_pattern: $ => seq('^', '(', field('value', $._expression), ')'),
552
+
553
+ _pattern_constant: $ => prec.right(-1, choice(
554
+ $.constant,
555
+ alias($._pattern_constant_resolution, $.scope_resolution),
556
+ )),
557
+
558
+ _pattern_constant_resolution: $ => seq(
559
+ optional(field('scope', $._pattern_constant)),
560
+ '::',
561
+ field('name', $.constant),
562
+ ),
563
+
564
+ if: $ => seq(
565
+ 'if',
566
+ field('condition', $._statement),
567
+ choice($._terminator, field('consequence', $.then)),
568
+ field('alternative', optional(choice($.else, $.elsif))),
569
+ 'end',
570
+ ),
571
+
572
+ unless: $ => seq(
573
+ 'unless',
574
+ field('condition', $._statement),
575
+ choice($._terminator, field('consequence', $.then)),
576
+ field('alternative', optional(choice($.else, $.elsif))),
577
+ 'end',
578
+ ),
579
+
580
+ elsif: $ => seq(
581
+ 'elsif',
582
+ field('condition', $._statement),
583
+ choice($._terminator, field('consequence', $.then)),
584
+ field('alternative', optional(choice($.else, $.elsif))),
585
+ ),
586
+
587
+ else: $ => seq(
588
+ 'else',
589
+ optional($._terminator),
590
+ optional($._statements),
591
+ ),
592
+
593
+ then: $ => choice(
594
+ seq(
595
+ $._terminator,
596
+ $._statements,
597
+ ),
598
+ seq(
599
+ optional($._terminator),
600
+ 'then',
601
+ optional($._statements),
602
+ ),
603
+ ),
604
+
605
+ begin: $ => seq('begin', optional($._terminator), optional($._body_statement), 'end'),
606
+
607
+ ensure: $ => seq('ensure', optional($._statements)),
608
+
609
+ rescue: $ => seq(
610
+ 'rescue',
611
+ field('exceptions', optional($.exceptions)),
612
+ field('variable', optional($.exception_variable)),
613
+ choice(
614
+ $._terminator,
615
+ field('body', $.then),
616
+ ),
617
+ ),
618
+
619
+ exceptions: $ => commaSep1(choice($._arg, $.splat_argument)),
620
+
621
+ exception_variable: $ => seq('=>', $._lhs),
622
+
623
+ body_statement: $ => $._body_statement,
624
+
625
+ _body_statement: $ => choice(
626
+ seq($._statements, repeat(choice($.rescue, $.else, $.ensure))),
627
+ seq(optional($._statements), repeat1(choice($.rescue, $.else, $.ensure))),
628
+ ),
629
+
630
+ // Method calls without parentheses (aka "command calls") are only allowed
631
+ // in certain positions, like the top-level of a statement, the condition
632
+ // of a postfix control-flow operator like `if`, or as the value of a
633
+ // control-flow statement like `return`. In many other places, they're not
634
+ // allowed.
635
+ //
636
+ // Because of this distinction, a lot of rules have two variants: the
637
+ // normal variant, which can appear anywhere that an expression is valid,
638
+ // and the "command" varaint, which is only valid in a more limited set of
639
+ // positions, because it can contain "command calls".
640
+ //
641
+ // The `_expression` rule can appear in relatively few places, but can
642
+ // contain command calls. The `_arg` rule can appear in many more places,
643
+ // but cannot contain command calls (unless they are wrapped in parens).
644
+ // This naming convention is based on Ruby's standard grammar.
645
+ _expression: $ => choice(
646
+ alias($.command_binary, $.binary),
647
+ alias($.command_unary, $.unary),
648
+ alias($.command_assignment, $.assignment),
649
+ alias($.command_operator_assignment, $.operator_assignment),
650
+ alias($.command_call, $.call),
651
+ alias($.command_call_with_block, $.call),
652
+ prec.left(alias($._chained_command_call, $.call)),
653
+ alias($.return_command, $.return),
654
+ alias($.yield_command, $.yield),
655
+ alias($.break_command, $.break),
656
+ alias($.next_command, $.next),
657
+ $.match_pattern,
658
+ $.test_pattern,
659
+ $._arg,
660
+ ),
661
+
662
+ match_pattern: $ => prec(100, seq(field('value', $._arg), '=>', field('pattern', $._pattern_top_expr_body))),
663
+
664
+ test_pattern: $ => prec(100, seq(field('value', $._arg), 'in', field('pattern', $._pattern_top_expr_body))),
665
+
666
+ _arg: $ => choice(
667
+ alias($._unary_minus_pow, $.unary),
668
+ $._primary,
669
+ $.assignment,
670
+ $.operator_assignment,
671
+ $.conditional,
672
+ $.range,
673
+ $.binary,
674
+ $.unary,
675
+ ),
676
+
677
+ _unary_minus_pow: $ => seq(field('operator', alias($._unary_minus_num, '-')), field('operand', alias($._pow, $.binary))),
678
+ _pow: $ => prec.right(PREC.EXPONENTIAL, seq(field('left', $._simple_numeric), field('operator', alias($._binary_star_star, '**')), field('right', $._arg))),
679
+
680
+ _primary: $ => choice(
681
+ $.parenthesized_statements,
682
+ $._lhs,
683
+ alias($._function_identifier_call, $.call),
684
+ $.call,
685
+ $.array,
686
+ $.string_array,
687
+ $.symbol_array,
688
+ $.hash,
689
+ $.subshell,
690
+ $._literal,
691
+ $.string,
692
+ $.character,
693
+ $.chained_string,
694
+ $.regex,
695
+ $.lambda,
696
+ $.method,
697
+ $.singleton_method,
698
+ $.class,
699
+ $.singleton_class,
700
+ $.module,
701
+ $.begin,
702
+ $.while,
703
+ $.until,
704
+ $.if,
705
+ $.unless,
706
+ $.for,
707
+ $.case,
708
+ $.case_match,
709
+ $.return,
710
+ $.yield,
711
+ $.break,
712
+ $.next,
713
+ $.redo,
714
+ $.retry,
715
+ alias($.parenthesized_unary, $.unary),
716
+ $.heredoc_beginning,
717
+ ),
718
+
719
+ parenthesized_statements: $ => seq('(', optional($._statements), ')'),
720
+
721
+ element_reference: $ => prec.left(1, seq(
722
+ field('object', $._primary),
723
+ alias($._element_reference_bracket, '['),
724
+ optional($._argument_list_with_trailing_comma),
725
+ ']',
726
+ optional(field('block', choice($.block, $.do_block))),
727
+ )),
728
+
729
+ scope_resolution: $ => prec.left(PREC.CALL + 1, seq(
730
+ choice(
731
+ '::',
732
+ seq(field('scope', $._primary), token.immediate('::')),
733
+ ),
734
+ field('name', $.constant),
735
+ )),
736
+
737
+ _call_operator: _ => choice('.', '&.', token.immediate('::')),
738
+ _call: $ => prec.left(PREC.CALL, seq(
739
+ field('receiver', $._primary),
740
+ field('operator', $._call_operator),
741
+ field('method', choice($.identifier, $.operator, $.constant, $._function_identifier)),
742
+ )),
743
+
744
+ command_call: $ => seq(
745
+ choice(
746
+ $._call,
747
+ $._chained_command_call,
748
+ field('method', choice(
749
+ $._variable,
750
+ $._function_identifier,
751
+ )),
752
+ ),
753
+ field('arguments', alias($.command_argument_list, $.argument_list)),
754
+ ),
755
+
756
+ command_call_with_block: $ => {
757
+ const receiver = choice(
758
+ $._call,
759
+ field('method', choice($._variable, $._function_identifier)),
760
+ );
761
+ const args = field('arguments', alias($.command_argument_list, $.argument_list));
762
+ const block = field('block', $.block);
763
+ const doBlock = field('block', $.do_block);
764
+ return choice(
765
+ seq(receiver, prec(PREC.CURLY_BLOCK, seq(args, block))),
766
+ seq(receiver, prec(PREC.DO_BLOCK, seq(args, doBlock))),
767
+ );
768
+ },
769
+
770
+ _chained_command_call: $ => seq(
771
+ field('receiver', alias($.command_call_with_block, $.call)),
772
+ field('operator', $._call_operator),
773
+ field('method', choice($.identifier, $._function_identifier, $.operator, $.constant)),
774
+ ),
775
+
776
+ call: $ => {
777
+ const receiver = choice(
778
+ $._call,
779
+ field('method', choice(
780
+ $._variable, $._function_identifier,
781
+ )),
782
+ );
783
+
784
+ const args = field('arguments', $.argument_list);
785
+ const receiverArguments =
786
+ seq(
787
+ choice(
788
+ receiver,
789
+ prec.left(PREC.CALL, seq(
790
+ field('receiver', $._primary),
791
+ field('operator', $._call_operator),
792
+ )),
793
+ ),
794
+ args,
795
+ );
796
+
797
+ const block = field('block', $.block);
798
+ const doBlock = field('block', $.do_block);
799
+ return choice(
800
+ receiverArguments,
801
+ prec(PREC.CURLY_BLOCK, seq(receiverArguments, block)),
802
+ prec(PREC.DO_BLOCK, seq(receiverArguments, doBlock)),
803
+ prec(PREC.CURLY_BLOCK, seq(receiver, block)),
804
+ prec(PREC.DO_BLOCK, seq(receiver, doBlock)),
805
+ );
806
+ },
807
+
808
+ command_argument_list: $ => prec.right(commaSep1($._argument)),
809
+
810
+ argument_list: $ => prec.right(seq(
811
+ token.immediate('('),
812
+ optional($._argument_list_with_trailing_comma),
813
+ ')',
814
+ )),
815
+
816
+ _argument_list_with_trailing_comma: $ => prec.right(seq(
817
+ commaSep1($._argument),
818
+ optional(','),
819
+ )),
820
+
821
+ _argument: $ => prec.left(choice(
822
+ $._expression,
823
+ $.splat_argument,
824
+ $.hash_splat_argument,
825
+ $.forward_argument,
826
+ $.block_argument,
827
+ $.pair,
828
+ )),
829
+
830
+ forward_argument: _ => '...',
831
+ splat_argument: $ => prec.right(seq(alias($._splat_star, '*'), optional($._arg))),
832
+ hash_splat_argument: $ => prec.right(seq(alias($._hash_splat_star_star, '**'), optional($._arg))),
833
+ block_argument: $ => prec.right(seq(alias($._block_ampersand, '&'), optional($._arg))),
834
+
835
+ do_block: $ => seq(
836
+ 'do',
837
+ optional($._terminator),
838
+ optional(seq(
839
+ field('parameters', $.block_parameters),
840
+ optional($._terminator),
841
+ )),
842
+ optional(field('body', $.body_statement)),
843
+ 'end',
844
+ ),
845
+
846
+ block: $ => prec(PREC.CURLY_BLOCK, seq(
847
+ '{',
848
+ field('parameters', optional($.block_parameters)),
849
+ optional(field('body', $.block_body)),
850
+ '}',
851
+ )),
852
+
853
+ _arg_rhs: $ => choice($._arg, alias($.rescue_modifier_arg, $.rescue_modifier)),
854
+ assignment: $ => prec.right(PREC.ASSIGN, choice(
855
+ seq(
856
+ field('left', choice($._lhs, $.left_assignment_list)),
857
+ '=',
858
+ field('right', choice(
859
+ $._arg_rhs,
860
+ $.splat_argument,
861
+ $.right_assignment_list,
862
+ )),
863
+ ),
864
+ )),
865
+
866
+ command_assignment: $ => prec.right(PREC.ASSIGN,
867
+ seq(
868
+ field('left', choice($._lhs, $.left_assignment_list)),
869
+ '=',
870
+ field('right', choice($._expression, alias($.rescue_modifier_expression, $.rescue_modifier))),
871
+ ),
872
+ ),
873
+
874
+ operator_assignment: $ => prec.right(PREC.ASSIGN, seq(
875
+ field('left', $._lhs),
876
+ field('operator', choice('+=', '-=', '*=', '**=', '/=', '||=', '|=', '&&=', '&=', '%=', '>>=', '<<=', '^=')),
877
+ field('right', $._arg_rhs),
878
+ )),
879
+
880
+ command_operator_assignment: $ => prec.right(PREC.ASSIGN, seq(
881
+ field('left', $._lhs),
882
+ field('operator', choice('+=', '-=', '*=', '**=', '/=', '||=', '|=', '&&=', '&=', '%=', '>>=', '<<=', '^=')),
883
+ field('right', choice($._expression, alias($.rescue_modifier_expression, $.rescue_modifier))),
884
+ )),
885
+
886
+ conditional: $ => prec.right(PREC.CONDITIONAL, seq(
887
+ field('condition', $._arg),
888
+ '?',
889
+ field('consequence', $._arg),
890
+ ':',
891
+ field('alternative', $._arg),
892
+ )),
893
+
894
+ range: $ => {
895
+ const begin = field('begin', $._arg);
896
+ const end = field('end', $._arg);
897
+ const operator = field('operator', choice('..', '...'));
898
+ return prec.right(PREC.RANGE, choice(
899
+ seq(begin, operator, end),
900
+ seq(operator, end),
901
+ seq(begin, operator),
902
+ ));
903
+ },
904
+
905
+ binary: $ => {
906
+ const operators = [
907
+ [prec.left, PREC.AND, 'and'],
908
+ [prec.left, PREC.OR, 'or'],
909
+ [prec.left, PREC.BOOLEAN_OR, '||'],
910
+ [prec.left, PREC.BOOLEAN_AND, '&&'],
911
+ [prec.left, PREC.SHIFT, choice('<<', '>>')],
912
+ [prec.left, PREC.COMPARISON, choice('<', '<=', '>', '>=')],
913
+ [prec.left, PREC.BITWISE_AND, '&'],
914
+ [prec.left, PREC.BITWISE_OR, choice('^', '|')],
915
+ [prec.left, PREC.ADDITIVE, choice('+', alias($._binary_minus, '-'))],
916
+ [prec.left, PREC.MULTIPLICATIVE, choice('/', '%', alias($._binary_star, '*'))],
917
+ [prec.right, PREC.RELATIONAL, choice('==', '!=', '===', '<=>', '=~', '!~')],
918
+ [prec.right, PREC.EXPONENTIAL, alias($._binary_star_star, '**')],
919
+ ];
920
+
921
+ // @ts-ignore
922
+ return choice(...operators.map(([fn, precedence, operator]) => fn(precedence, seq(
923
+ field('left', $._arg),
924
+ // @ts-ignore
925
+ field('operator', operator),
926
+ field('right', $._arg),
927
+ ))));
928
+ },
929
+
930
+ command_binary: $ => prec.left(seq(
931
+ field('left', $._expression),
932
+ field('operator', choice('or', 'and')),
933
+ field('right', $._expression),
934
+ )),
935
+
936
+ unary: $ => {
937
+ const operators = [
938
+ [prec, PREC.DEFINED, 'defined?'],
939
+ [prec.right, PREC.NOT, 'not'],
940
+ [prec.right, PREC.UNARY_MINUS, choice(alias($._unary_minus, '-'), alias($._binary_minus, '-'), '+')],
941
+ [prec.right, PREC.COMPLEMENT, choice('!', '~')],
942
+ ];
943
+ // @ts-ignore
944
+ return choice(...operators.map(([fn, precedence, operator]) => fn(precedence, seq(
945
+ // @ts-ignore
946
+ field('operator', operator),
947
+ field('operand', $._arg),
948
+ ))));
949
+ },
950
+
951
+ command_unary: $ => {
952
+ const operators = [
953
+ [prec, PREC.DEFINED, 'defined?'],
954
+ [prec.right, PREC.NOT, 'not'],
955
+ [prec.right, PREC.UNARY_MINUS, choice(alias($._unary_minus, '-'), '+')],
956
+ [prec.right, PREC.COMPLEMENT, choice('!', '~')],
957
+ ];
958
+ // @ts-ignore
959
+ return choice(...operators.map(([fn, precedence, operator]) => fn(precedence, seq(
960
+ // @ts-ignore
961
+ field('operator', operator),
962
+ field('operand', $._expression),
963
+ ))));
964
+ },
965
+
966
+ parenthesized_unary: $ => prec(PREC.CALL, seq(
967
+ field('operator', choice('defined?', 'not')),
968
+ field('operand', $.parenthesized_statements),
969
+ )),
970
+
971
+ unary_literal: $ => prec.right(PREC.UNARY_MINUS, seq(
972
+ field('operator', choice(alias($._unary_minus_num, '-'), '+')),
973
+ field('operand', $._simple_numeric),
974
+ )),
975
+
976
+ _literal: $ => choice(
977
+ $.simple_symbol,
978
+ $.delimited_symbol,
979
+ $._numeric,
980
+ ),
981
+
982
+ _numeric: $ => choice(
983
+ $._simple_numeric,
984
+ alias($.unary_literal, $.unary),
985
+ ),
986
+
987
+ _simple_numeric: $ =>
988
+ choice(
989
+ $.integer,
990
+ $.float,
991
+ $.complex,
992
+ $.rational,
993
+ ),
994
+
995
+ right_assignment_list: $ => prec(-1, commaSep1(choice($._arg, $.splat_argument))),
996
+
997
+ left_assignment_list: $ => $._mlhs,
998
+ _mlhs: $ => prec.left(-1, seq(
999
+ commaSep1(choice($._lhs, $.rest_assignment, $.destructured_left_assignment)),
1000
+ optional(','),
1001
+ )),
1002
+ destructured_left_assignment: $ => prec(-1, seq('(', $._mlhs, ')')),
1003
+
1004
+ rest_assignment: $ => prec(-1, seq('*', optional($._lhs))),
1005
+
1006
+ _function_identifier: $ => choice(alias($.identifier_suffix, $.identifier), alias($.constant_suffix, $.constant)),
1007
+ _function_identifier_call: $ => prec.left(field('method', $._function_identifier)),
1008
+ _lhs: $ => prec.left(choice(
1009
+ $._variable,
1010
+ $.true,
1011
+ $.false,
1012
+ $.nil,
1013
+ $.scope_resolution,
1014
+ $.element_reference,
1015
+ alias($._call, $.call),
1016
+ )),
1017
+
1018
+ _variable: $ => prec.right(choice(
1019
+ $.self,
1020
+ $.super,
1021
+ $._nonlocal_variable,
1022
+ $.identifier,
1023
+ $.constant,
1024
+ )),
1025
+
1026
+ operator: _ => choice(
1027
+ '..', '|', '^', '&', '<=>', '==', '===', '=~', '>', '>=', '<', '<=', '+', '!=',
1028
+ '-', '*', '/', '%', '!', '!~', '**', '<<', '>>', '~', '+@', '-@', '~@', '[]', '[]=', '`',
1029
+ ),
1030
+
1031
+ _method_name: $ => choice(
1032
+ $.identifier,
1033
+ $._function_identifier,
1034
+ $.constant,
1035
+ $.setter,
1036
+ $.simple_symbol,
1037
+ $.delimited_symbol,
1038
+ $.operator,
1039
+ $._nonlocal_variable,
1040
+ ),
1041
+
1042
+ _nonlocal_variable: $ => choice(
1043
+ $.instance_variable,
1044
+ $.class_variable,
1045
+ $.global_variable,
1046
+ ),
1047
+
1048
+ setter: $ => seq(field('name', $.identifier), token.immediate('=')),
1049
+
1050
+ undef: $ => seq('undef', commaSep1($._method_name)),
1051
+ alias: $ => seq(
1052
+ 'alias',
1053
+ field('name', $._method_name),
1054
+ field('alias', $._method_name),
1055
+ ),
1056
+
1057
+ comment: _ => token(prec(PREC.COMMENT, choice(
1058
+ seq('#', /.*/),
1059
+ seq(
1060
+ /=begin.*\r?\n/,
1061
+ repeat(choice(
1062
+ /[^=]/,
1063
+ /=[^e]/,
1064
+ /=e[^n]/,
1065
+ /=en[^d]/,
1066
+ )),
1067
+ /[\s*]*=end.*/,
1068
+ ),
1069
+ ))),
1070
+
1071
+ integer: _ => /0[bB][01](_?[01])*|0[oO]?[0-7](_?[0-7])*|(0[dD])?\d(_?\d)*|0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/,
1072
+ _int_or_float: $ => choice($.integer, $.float),
1073
+ float: _ => /\d(_?\d)*(\.\d)?(_?\d)*([eE][\+-]?\d(_?\d)*)?/,
1074
+ complex: $ => choice(
1075
+ seq($._int_or_float, token.immediate('i')),
1076
+ seq(alias($._int_or_float, $.rational), token.immediate('ri')),
1077
+ ),
1078
+ rational: $ => seq($._int_or_float, token.immediate('r')),
1079
+ super: _ => 'super',
1080
+ self: _ => 'self',
1081
+ true: _ => 'true',
1082
+ false: _ => 'false',
1083
+ nil: _ => 'nil',
1084
+
1085
+ constant: _ => token(seq(/[A-Z]/, IDENTIFIER_CHARS)),
1086
+ constant_suffix: $ => choice(token(seq(/[A-Z]/, IDENTIFIER_CHARS, /[?]/)), $._constant_suffix),
1087
+ identifier: _ => token(seq(LOWER_ALPHA_CHAR, IDENTIFIER_CHARS)),
1088
+ identifier_suffix: $ => choice(token(seq(LOWER_ALPHA_CHAR, IDENTIFIER_CHARS, /[?]/)), $._identifier_suffix),
1089
+ instance_variable: _ => token(seq('@', ALPHA_CHAR, IDENTIFIER_CHARS)),
1090
+ class_variable: _ => token(seq('@@', ALPHA_CHAR, IDENTIFIER_CHARS)),
1091
+
1092
+ global_variable: _ => /\$(-[a-zA-Z0-9_]|[!@&`'+~=/\\,;.<>*$?:"]|[0-9]+|[a-zA-Z_][a-zA-Z0-9_]*)/,
1093
+
1094
+ chained_string: $ => seq($.string, repeat1($.string)),
1095
+
1096
+ character: _ => /\?(\\\S(\{[0-9A-Fa-f]*\}|[0-9A-Fa-f]*|-\S([MC]-\S)?)?|\S)/,
1097
+
1098
+ interpolation: $ => choice(
1099
+ seq('#{', optional($._statements), '}'),
1100
+ seq($._short_interpolation, $._nonlocal_variable),
1101
+ ),
1102
+
1103
+ string: $ => seq(
1104
+ alias($._string_start, '"'),
1105
+ optional($._literal_contents),
1106
+ alias($._string_end, '"'),
1107
+ ),
1108
+
1109
+ subshell: $ => seq(
1110
+ alias($._subshell_start, '`'),
1111
+ optional($._literal_contents),
1112
+ alias($._string_end, '`'),
1113
+ ),
1114
+
1115
+ string_array: $ => seq(
1116
+ alias($._string_array_start, '%w('),
1117
+ optional(/\s+/),
1118
+ sep(alias($._literal_contents, $.bare_string), /\s+/),
1119
+ optional(/\s+/),
1120
+ alias($._string_end, ')'),
1121
+ ),
1122
+
1123
+ symbol_array: $ => seq(
1124
+ alias($._symbol_array_start, '%i('),
1125
+ optional(/\s+/),
1126
+ sep(alias($._literal_contents, $.bare_symbol), /\s+/),
1127
+ optional(/\s+/),
1128
+ alias($._string_end, ')'),
1129
+ ),
1130
+
1131
+ delimited_symbol: $ => seq(
1132
+ alias($._symbol_start, ':"'),
1133
+ optional($._literal_contents),
1134
+ alias($._string_end, '"'),
1135
+ ),
1136
+
1137
+ regex: $ => seq(
1138
+ alias($._regex_start, '/'),
1139
+ optional($._literal_contents),
1140
+ alias($._string_end, '/'),
1141
+ ),
1142
+
1143
+ heredoc_body: $ => seq(
1144
+ $._heredoc_body_start,
1145
+ repeat(choice(
1146
+ $.heredoc_content,
1147
+ $.interpolation,
1148
+ $.escape_sequence,
1149
+ )),
1150
+ $.heredoc_end,
1151
+ ),
1152
+
1153
+ _literal_contents: $ => repeat1(choice(
1154
+ $.string_content,
1155
+ $.interpolation,
1156
+ $.escape_sequence,
1157
+ )),
1158
+
1159
+ // https://ruby-doc.org/core-2.5.0/doc/syntax/literals_rdoc.html#label-Strings
1160
+ escape_sequence: _ => token(seq(
1161
+ '\\',
1162
+ choice(
1163
+ /[^ux0-7]/, // single character
1164
+ /x[0-9a-fA-F]{1,2}/, // hex code
1165
+ /[0-7]{1,3}/, // octal
1166
+ /u[0-9a-fA-F]{4}/, // single unicode
1167
+ /u\{[0-9a-fA-F ]+\}/, // multiple unicode
1168
+ ),
1169
+ )),
1170
+
1171
+ array: $ => seq(
1172
+ '[',
1173
+ optional($._argument_list_with_trailing_comma),
1174
+ ']',
1175
+ ),
1176
+
1177
+ hash: $ => seq(
1178
+ '{',
1179
+ optional(seq(
1180
+ commaSep1(choice($.pair, $.hash_splat_argument)),
1181
+ optional(','),
1182
+ )),
1183
+ '}',
1184
+ ),
1185
+
1186
+ pair: $ => prec.right(choice(
1187
+ seq(
1188
+ field('key', $._arg),
1189
+ '=>',
1190
+ field('value', $._arg),
1191
+ ),
1192
+ seq(
1193
+ field('key', choice(
1194
+ $.string,
1195
+ )),
1196
+ token.immediate(':'),
1197
+ field('value', $._arg),
1198
+ ),
1199
+ seq(
1200
+ field('key', choice(
1201
+ $.hash_key_symbol,
1202
+ alias($.identifier, $.hash_key_symbol),
1203
+ alias($.constant, $.hash_key_symbol),
1204
+ alias($.identifier_suffix, $.hash_key_symbol),
1205
+ alias($.constant_suffix, $.hash_key_symbol),
1206
+ )),
1207
+ token.immediate(':'),
1208
+ choice(
1209
+ field('value', optional($._arg)),
1210
+ // This alternative never matches, because '_no_line_break' tokens do not exist.
1211
+ // The purpose is give a hint to the scanner that it should not produce any line-break
1212
+ // terminators at this point.
1213
+ $._no_line_break),
1214
+ ),
1215
+ )),
1216
+
1217
+ lambda: $ => seq(
1218
+ '->',
1219
+ field('parameters', optional(choice(
1220
+ alias($.parameters, $.lambda_parameters),
1221
+ alias($.bare_parameters, $.lambda_parameters),
1222
+ ))),
1223
+ field('body', choice($.block, $.do_block)),
1224
+ ),
1225
+
1226
+ empty_statement: _ => prec(-1, ';'),
1227
+
1228
+ _terminator: $ => choice(
1229
+ $._line_break,
1230
+ ';',
1231
+ ),
1232
+ },
1233
+ });
1234
+
1235
+ /**
1236
+ * Creates a rule to optionally match one or more of the rules separated by `separator`
1237
+ *
1238
+ * @param {RuleOrLiteral} rule
1239
+ *
1240
+ * @param {RuleOrLiteral} separator
1241
+ *
1242
+ * @returns {ChoiceRule}
1243
+ */
1244
+ function sep(rule, separator) {
1245
+ return optional(sep1(rule, separator));
1246
+ }
1247
+
1248
+ /**
1249
+ * Creates a rule to match one or more of the rules separated by `separator`
1250
+ *
1251
+ * @param {RuleOrLiteral} rule
1252
+ *
1253
+ * @param {RuleOrLiteral} separator
1254
+ *
1255
+ * @returns {SeqRule}
1256
+ */
1257
+ function sep1(rule, separator) {
1258
+ return seq(rule, repeat(seq(separator, rule)));
1259
+ }
1260
+
1261
+ /**
1262
+ * Creates a rule to match one or more of the rules separated by a comma
1263
+ *
1264
+ * @param {RuleOrLiteral} rule
1265
+ *
1266
+ * @returns {SeqRule}
1267
+ */
1268
+ function commaSep1(rule) {
1269
+ return sep1(rule, ',');
1270
+ }
1271
+
1272
+ /**
1273
+ * Creates a rule to optionally match one or more of the rules separated by a comma
1274
+ *
1275
+ * @param {RuleOrLiteral} rule
1276
+ *
1277
+ * @returns {ChoiceRule}
1278
+ */
1279
+ function commaSep(rule) {
1280
+ return optional(commaSep1(rule));
1281
+ }