driftdetect-core 0.5.0 → 0.6.1

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 (350) hide show
  1. package/dist/boundaries/types.d.ts +1 -1
  2. package/dist/boundaries/types.d.ts.map +1 -1
  3. package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -1
  4. package/dist/call-graph/analysis/graph-builder.js +1 -0
  5. package/dist/call-graph/analysis/graph-builder.js.map +1 -1
  6. package/dist/call-graph/extractors/go-data-access-extractor.d.ts +80 -0
  7. package/dist/call-graph/extractors/go-data-access-extractor.d.ts.map +1 -0
  8. package/dist/call-graph/extractors/go-data-access-extractor.js +457 -0
  9. package/dist/call-graph/extractors/go-data-access-extractor.js.map +1 -0
  10. package/dist/call-graph/extractors/go-extractor.d.ts +103 -0
  11. package/dist/call-graph/extractors/go-extractor.d.ts.map +1 -0
  12. package/dist/call-graph/extractors/go-extractor.js +509 -0
  13. package/dist/call-graph/extractors/go-extractor.js.map +1 -0
  14. package/dist/call-graph/extractors/go-hybrid-extractor.d.ts +97 -0
  15. package/dist/call-graph/extractors/go-hybrid-extractor.d.ts.map +1 -0
  16. package/dist/call-graph/extractors/go-hybrid-extractor.js +496 -0
  17. package/dist/call-graph/extractors/go-hybrid-extractor.js.map +1 -0
  18. package/dist/call-graph/extractors/regex/go-regex.d.ts +51 -0
  19. package/dist/call-graph/extractors/regex/go-regex.d.ts.map +1 -0
  20. package/dist/call-graph/extractors/regex/go-regex.js +435 -0
  21. package/dist/call-graph/extractors/regex/go-regex.js.map +1 -0
  22. package/dist/call-graph/extractors/regex/index.d.ts +1 -0
  23. package/dist/call-graph/extractors/regex/index.d.ts.map +1 -1
  24. package/dist/call-graph/extractors/regex/index.js +8 -0
  25. package/dist/call-graph/extractors/regex/index.js.map +1 -1
  26. package/dist/call-graph/index.d.ts +3 -0
  27. package/dist/call-graph/index.d.ts.map +1 -1
  28. package/dist/call-graph/index.js +5 -0
  29. package/dist/call-graph/index.js.map +1 -1
  30. package/dist/call-graph/types.d.ts +1 -1
  31. package/dist/call-graph/types.d.ts.map +1 -1
  32. package/dist/constraints/extraction/constraint-synthesizer.d.ts +72 -0
  33. package/dist/constraints/extraction/constraint-synthesizer.d.ts.map +1 -0
  34. package/dist/constraints/extraction/constraint-synthesizer.js +336 -0
  35. package/dist/constraints/extraction/constraint-synthesizer.js.map +1 -0
  36. package/dist/constraints/extraction/index.d.ts +10 -0
  37. package/dist/constraints/extraction/index.d.ts.map +1 -0
  38. package/dist/constraints/extraction/index.js +10 -0
  39. package/dist/constraints/extraction/index.js.map +1 -0
  40. package/dist/constraints/extraction/invariant-detector.d.ts +109 -0
  41. package/dist/constraints/extraction/invariant-detector.d.ts.map +1 -0
  42. package/dist/constraints/extraction/invariant-detector.js +979 -0
  43. package/dist/constraints/extraction/invariant-detector.js.map +1 -0
  44. package/dist/constraints/index.d.ts +15 -0
  45. package/dist/constraints/index.d.ts.map +1 -0
  46. package/dist/constraints/index.js +16 -0
  47. package/dist/constraints/index.js.map +1 -0
  48. package/dist/constraints/store/constraint-store.d.ts +110 -0
  49. package/dist/constraints/store/constraint-store.d.ts.map +1 -0
  50. package/dist/constraints/store/constraint-store.js +584 -0
  51. package/dist/constraints/store/constraint-store.js.map +1 -0
  52. package/dist/constraints/types.d.ts +605 -0
  53. package/dist/constraints/types.d.ts.map +1 -0
  54. package/dist/constraints/types.js +57 -0
  55. package/dist/constraints/types.js.map +1 -0
  56. package/dist/constraints/verification/constraint-verifier.d.ts +100 -0
  57. package/dist/constraints/verification/constraint-verifier.d.ts.map +1 -0
  58. package/dist/constraints/verification/constraint-verifier.js +638 -0
  59. package/dist/constraints/verification/constraint-verifier.js.map +1 -0
  60. package/dist/constraints/verification/index.d.ts +8 -0
  61. package/dist/constraints/verification/index.d.ts.map +1 -0
  62. package/dist/constraints/verification/index.js +8 -0
  63. package/dist/constraints/verification/index.js.map +1 -0
  64. package/dist/decisions/analyzer/decision-mining-analyzer.d.ts +121 -0
  65. package/dist/decisions/analyzer/decision-mining-analyzer.d.ts.map +1 -0
  66. package/dist/decisions/analyzer/decision-mining-analyzer.js +904 -0
  67. package/dist/decisions/analyzer/decision-mining-analyzer.js.map +1 -0
  68. package/dist/decisions/analyzer/index.d.ts +5 -0
  69. package/dist/decisions/analyzer/index.d.ts.map +1 -0
  70. package/dist/decisions/analyzer/index.js +5 -0
  71. package/dist/decisions/analyzer/index.js.map +1 -0
  72. package/dist/decisions/extractors/base-commit-extractor.d.ts +104 -0
  73. package/dist/decisions/extractors/base-commit-extractor.d.ts.map +1 -0
  74. package/dist/decisions/extractors/base-commit-extractor.js +305 -0
  75. package/dist/decisions/extractors/base-commit-extractor.js.map +1 -0
  76. package/dist/decisions/extractors/csharp-commit-extractor.d.ts +18 -0
  77. package/dist/decisions/extractors/csharp-commit-extractor.d.ts.map +1 -0
  78. package/dist/decisions/extractors/csharp-commit-extractor.js +281 -0
  79. package/dist/decisions/extractors/csharp-commit-extractor.js.map +1 -0
  80. package/dist/decisions/extractors/index.d.ts +31 -0
  81. package/dist/decisions/extractors/index.d.ts.map +1 -0
  82. package/dist/decisions/extractors/index.js +63 -0
  83. package/dist/decisions/extractors/index.js.map +1 -0
  84. package/dist/decisions/extractors/java-commit-extractor.d.ts +18 -0
  85. package/dist/decisions/extractors/java-commit-extractor.d.ts.map +1 -0
  86. package/dist/decisions/extractors/java-commit-extractor.js +248 -0
  87. package/dist/decisions/extractors/java-commit-extractor.js.map +1 -0
  88. package/dist/decisions/extractors/php-commit-extractor.d.ts +18 -0
  89. package/dist/decisions/extractors/php-commit-extractor.d.ts.map +1 -0
  90. package/dist/decisions/extractors/php-commit-extractor.js +280 -0
  91. package/dist/decisions/extractors/php-commit-extractor.js.map +1 -0
  92. package/dist/decisions/extractors/python-commit-extractor.d.ts +18 -0
  93. package/dist/decisions/extractors/python-commit-extractor.d.ts.map +1 -0
  94. package/dist/decisions/extractors/python-commit-extractor.js +248 -0
  95. package/dist/decisions/extractors/python-commit-extractor.js.map +1 -0
  96. package/dist/decisions/extractors/typescript-commit-extractor.d.ts +37 -0
  97. package/dist/decisions/extractors/typescript-commit-extractor.d.ts.map +1 -0
  98. package/dist/decisions/extractors/typescript-commit-extractor.js +229 -0
  99. package/dist/decisions/extractors/typescript-commit-extractor.js.map +1 -0
  100. package/dist/decisions/git/commit-parser.d.ts +58 -0
  101. package/dist/decisions/git/commit-parser.d.ts.map +1 -0
  102. package/dist/decisions/git/commit-parser.js +344 -0
  103. package/dist/decisions/git/commit-parser.js.map +1 -0
  104. package/dist/decisions/git/diff-analyzer.d.ts +30 -0
  105. package/dist/decisions/git/diff-analyzer.d.ts.map +1 -0
  106. package/dist/decisions/git/diff-analyzer.js +492 -0
  107. package/dist/decisions/git/diff-analyzer.js.map +1 -0
  108. package/dist/decisions/git/git-walker.d.ts +64 -0
  109. package/dist/decisions/git/git-walker.d.ts.map +1 -0
  110. package/dist/decisions/git/git-walker.js +441 -0
  111. package/dist/decisions/git/git-walker.js.map +1 -0
  112. package/dist/decisions/git/index.d.ts +11 -0
  113. package/dist/decisions/git/index.d.ts.map +1 -0
  114. package/dist/decisions/git/index.js +13 -0
  115. package/dist/decisions/git/index.js.map +1 -0
  116. package/dist/decisions/git/types.d.ts +223 -0
  117. package/dist/decisions/git/types.d.ts.map +1 -0
  118. package/dist/decisions/git/types.js +7 -0
  119. package/dist/decisions/git/types.js.map +1 -0
  120. package/dist/decisions/index.d.ts +27 -0
  121. package/dist/decisions/index.d.ts.map +1 -0
  122. package/dist/decisions/index.js +45 -0
  123. package/dist/decisions/index.js.map +1 -0
  124. package/dist/decisions/types.d.ts +530 -0
  125. package/dist/decisions/types.d.ts.map +1 -0
  126. package/dist/decisions/types.js +8 -0
  127. package/dist/decisions/types.js.map +1 -0
  128. package/dist/go/go-analyzer.d.ts +203 -0
  129. package/dist/go/go-analyzer.d.ts.map +1 -0
  130. package/dist/go/go-analyzer.js +509 -0
  131. package/dist/go/go-analyzer.js.map +1 -0
  132. package/dist/go/index.d.ts +7 -0
  133. package/dist/go/index.d.ts.map +1 -0
  134. package/dist/go/index.js +8 -0
  135. package/dist/go/index.js.map +1 -0
  136. package/dist/index.d.ts +11 -0
  137. package/dist/index.d.ts.map +1 -1
  138. package/dist/index.js +56 -0
  139. package/dist/index.js.map +1 -1
  140. package/dist/parsers/tree-sitter/go-loader.d.ts +50 -0
  141. package/dist/parsers/tree-sitter/go-loader.d.ts.map +1 -0
  142. package/dist/parsers/tree-sitter/go-loader.js +161 -0
  143. package/dist/parsers/tree-sitter/go-loader.js.map +1 -0
  144. package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts +250 -0
  145. package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts.map +1 -0
  146. package/dist/parsers/tree-sitter/tree-sitter-go-parser.js +707 -0
  147. package/dist/parsers/tree-sitter/tree-sitter-go-parser.js.map +1 -0
  148. package/dist/parsers/types.d.ts +1 -1
  149. package/dist/parsers/types.d.ts.map +1 -1
  150. package/dist/simulation/approach-generator.d.ts +73 -0
  151. package/dist/simulation/approach-generator.d.ts.map +1 -0
  152. package/dist/simulation/approach-generator.js +371 -0
  153. package/dist/simulation/approach-generator.js.map +1 -0
  154. package/dist/simulation/index.d.ts +14 -0
  155. package/dist/simulation/index.d.ts.map +1 -0
  156. package/dist/simulation/index.js +19 -0
  157. package/dist/simulation/index.js.map +1 -0
  158. package/dist/simulation/language-strategies/csharp-strategies.d.ts +17 -0
  159. package/dist/simulation/language-strategies/csharp-strategies.d.ts.map +1 -0
  160. package/dist/simulation/language-strategies/csharp-strategies.js +118 -0
  161. package/dist/simulation/language-strategies/csharp-strategies.js.map +1 -0
  162. package/dist/simulation/language-strategies/index.d.ts +41 -0
  163. package/dist/simulation/language-strategies/index.d.ts.map +1 -0
  164. package/dist/simulation/language-strategies/index.js +92 -0
  165. package/dist/simulation/language-strategies/index.js.map +1 -0
  166. package/dist/simulation/language-strategies/java-strategies.d.ts +17 -0
  167. package/dist/simulation/language-strategies/java-strategies.d.ts.map +1 -0
  168. package/dist/simulation/language-strategies/java-strategies.js +119 -0
  169. package/dist/simulation/language-strategies/java-strategies.js.map +1 -0
  170. package/dist/simulation/language-strategies/php-strategies.d.ts +17 -0
  171. package/dist/simulation/language-strategies/php-strategies.d.ts.map +1 -0
  172. package/dist/simulation/language-strategies/php-strategies.js +129 -0
  173. package/dist/simulation/language-strategies/php-strategies.js.map +1 -0
  174. package/dist/simulation/language-strategies/python-strategies.d.ts +17 -0
  175. package/dist/simulation/language-strategies/python-strategies.d.ts.map +1 -0
  176. package/dist/simulation/language-strategies/python-strategies.js +208 -0
  177. package/dist/simulation/language-strategies/python-strategies.js.map +1 -0
  178. package/dist/simulation/language-strategies/types.d.ts +67 -0
  179. package/dist/simulation/language-strategies/types.d.ts.map +1 -0
  180. package/dist/simulation/language-strategies/types.js +23 -0
  181. package/dist/simulation/language-strategies/types.js.map +1 -0
  182. package/dist/simulation/language-strategies/typescript-strategies.d.ts +17 -0
  183. package/dist/simulation/language-strategies/typescript-strategies.d.ts.map +1 -0
  184. package/dist/simulation/language-strategies/typescript-strategies.js +251 -0
  185. package/dist/simulation/language-strategies/typescript-strategies.js.map +1 -0
  186. package/dist/simulation/scorers/friction-scorer.d.ts +45 -0
  187. package/dist/simulation/scorers/friction-scorer.d.ts.map +1 -0
  188. package/dist/simulation/scorers/friction-scorer.js +336 -0
  189. package/dist/simulation/scorers/friction-scorer.js.map +1 -0
  190. package/dist/simulation/scorers/impact-scorer.d.ts +56 -0
  191. package/dist/simulation/scorers/impact-scorer.d.ts.map +1 -0
  192. package/dist/simulation/scorers/impact-scorer.js +273 -0
  193. package/dist/simulation/scorers/impact-scorer.js.map +1 -0
  194. package/dist/simulation/scorers/index.d.ts +12 -0
  195. package/dist/simulation/scorers/index.d.ts.map +1 -0
  196. package/dist/simulation/scorers/index.js +12 -0
  197. package/dist/simulation/scorers/index.js.map +1 -0
  198. package/dist/simulation/scorers/pattern-alignment-scorer.d.ts +83 -0
  199. package/dist/simulation/scorers/pattern-alignment-scorer.d.ts.map +1 -0
  200. package/dist/simulation/scorers/pattern-alignment-scorer.js +367 -0
  201. package/dist/simulation/scorers/pattern-alignment-scorer.js.map +1 -0
  202. package/dist/simulation/scorers/security-scorer.d.ts +63 -0
  203. package/dist/simulation/scorers/security-scorer.d.ts.map +1 -0
  204. package/dist/simulation/scorers/security-scorer.js +346 -0
  205. package/dist/simulation/scorers/security-scorer.js.map +1 -0
  206. package/dist/simulation/simulation-engine.d.ts +89 -0
  207. package/dist/simulation/simulation-engine.d.ts.map +1 -0
  208. package/dist/simulation/simulation-engine.js +480 -0
  209. package/dist/simulation/simulation-engine.js.map +1 -0
  210. package/dist/simulation/types.d.ts +200 -0
  211. package/dist/simulation/types.d.ts.map +1 -0
  212. package/dist/simulation/types.js +23 -0
  213. package/dist/simulation/types.js.map +1 -0
  214. package/dist/speculative/approach-generator.d.ts +2 -0
  215. package/dist/speculative/approach-generator.d.ts.map +1 -0
  216. package/dist/speculative/approach-generator.js +2 -0
  217. package/dist/speculative/approach-generator.js.map +1 -0
  218. package/dist/speculative/templates/types.d.ts +133 -0
  219. package/dist/speculative/templates/types.d.ts.map +1 -0
  220. package/dist/speculative/templates/types.js +208 -0
  221. package/dist/speculative/templates/types.js.map +1 -0
  222. package/dist/speculative/types.d.ts +523 -0
  223. package/dist/speculative/types.d.ts.map +1 -0
  224. package/dist/speculative/types.js +71 -0
  225. package/dist/speculative/types.js.map +1 -0
  226. package/dist/test-topology/extractors/base-test-extractor.d.ts +1 -1
  227. package/dist/test-topology/extractors/base-test-extractor.d.ts.map +1 -1
  228. package/dist/test-topology/extractors/base-test-extractor.js.map +1 -1
  229. package/dist/test-topology/extractors/go-test-extractor.d.ts +33 -0
  230. package/dist/test-topology/extractors/go-test-extractor.d.ts.map +1 -0
  231. package/dist/test-topology/extractors/go-test-extractor.js +436 -0
  232. package/dist/test-topology/extractors/go-test-extractor.js.map +1 -0
  233. package/dist/test-topology/extractors/index.d.ts +1 -0
  234. package/dist/test-topology/extractors/index.d.ts.map +1 -1
  235. package/dist/test-topology/extractors/index.js +1 -0
  236. package/dist/test-topology/extractors/index.js.map +1 -1
  237. package/dist/test-topology/extractors/regex/go-test-regex.d.ts +62 -0
  238. package/dist/test-topology/extractors/regex/go-test-regex.d.ts.map +1 -0
  239. package/dist/test-topology/extractors/regex/go-test-regex.js +528 -0
  240. package/dist/test-topology/extractors/regex/go-test-regex.js.map +1 -0
  241. package/dist/test-topology/extractors/regex/index.d.ts +1 -0
  242. package/dist/test-topology/extractors/regex/index.d.ts.map +1 -1
  243. package/dist/test-topology/extractors/regex/index.js +4 -0
  244. package/dist/test-topology/extractors/regex/index.js.map +1 -1
  245. package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -1
  246. package/dist/test-topology/hybrid-test-topology-analyzer.js +1 -0
  247. package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -1
  248. package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -1
  249. package/dist/test-topology/test-topology-analyzer.js +1 -0
  250. package/dist/test-topology/test-topology-analyzer.js.map +1 -1
  251. package/dist/test-topology/types.d.ts +2 -2
  252. package/dist/test-topology/types.d.ts.map +1 -1
  253. package/dist/unified-provider/matching/database-sql-matcher.d.ts +42 -0
  254. package/dist/unified-provider/matching/database-sql-matcher.d.ts.map +1 -0
  255. package/dist/unified-provider/matching/database-sql-matcher.js +282 -0
  256. package/dist/unified-provider/matching/database-sql-matcher.js.map +1 -0
  257. package/dist/unified-provider/matching/gorm-matcher.d.ts +41 -0
  258. package/dist/unified-provider/matching/gorm-matcher.d.ts.map +1 -0
  259. package/dist/unified-provider/matching/gorm-matcher.js +222 -0
  260. package/dist/unified-provider/matching/gorm-matcher.js.map +1 -0
  261. package/dist/unified-provider/matching/index.d.ts +3 -0
  262. package/dist/unified-provider/matching/index.d.ts.map +1 -1
  263. package/dist/unified-provider/matching/index.js +4 -0
  264. package/dist/unified-provider/matching/index.js.map +1 -1
  265. package/dist/unified-provider/matching/matcher-registry.d.ts.map +1 -1
  266. package/dist/unified-provider/matching/matcher-registry.js +7 -0
  267. package/dist/unified-provider/matching/matcher-registry.js.map +1 -1
  268. package/dist/unified-provider/matching/sqlx-matcher.d.ts +40 -0
  269. package/dist/unified-provider/matching/sqlx-matcher.d.ts.map +1 -0
  270. package/dist/unified-provider/matching/sqlx-matcher.js +214 -0
  271. package/dist/unified-provider/matching/sqlx-matcher.js.map +1 -0
  272. package/dist/unified-provider/normalization/go-normalizer.d.ts +62 -0
  273. package/dist/unified-provider/normalization/go-normalizer.d.ts.map +1 -0
  274. package/dist/unified-provider/normalization/go-normalizer.js +608 -0
  275. package/dist/unified-provider/normalization/go-normalizer.js.map +1 -0
  276. package/dist/unified-provider/normalization/index.d.ts +1 -0
  277. package/dist/unified-provider/normalization/index.d.ts.map +1 -1
  278. package/dist/unified-provider/normalization/index.js +6 -1
  279. package/dist/unified-provider/normalization/index.js.map +1 -1
  280. package/dist/unified-provider/types.d.ts +1 -1
  281. package/dist/unified-provider/types.d.ts.map +1 -1
  282. package/dist/wpf/extractors/binding-error-detector.d.ts +75 -0
  283. package/dist/wpf/extractors/binding-error-detector.d.ts.map +1 -0
  284. package/dist/wpf/extractors/binding-error-detector.js +290 -0
  285. package/dist/wpf/extractors/binding-error-detector.js.map +1 -0
  286. package/dist/wpf/extractors/code-behind-linker.d.ts +70 -0
  287. package/dist/wpf/extractors/code-behind-linker.d.ts.map +1 -0
  288. package/dist/wpf/extractors/code-behind-linker.js +172 -0
  289. package/dist/wpf/extractors/code-behind-linker.js.map +1 -0
  290. package/dist/wpf/extractors/dependency-property-extractor.d.ts +61 -0
  291. package/dist/wpf/extractors/dependency-property-extractor.d.ts.map +1 -0
  292. package/dist/wpf/extractors/dependency-property-extractor.js +201 -0
  293. package/dist/wpf/extractors/dependency-property-extractor.js.map +1 -0
  294. package/dist/wpf/extractors/regex/viewmodel-regex.d.ts +82 -0
  295. package/dist/wpf/extractors/regex/viewmodel-regex.d.ts.map +1 -0
  296. package/dist/wpf/extractors/regex/viewmodel-regex.js +412 -0
  297. package/dist/wpf/extractors/regex/viewmodel-regex.js.map +1 -0
  298. package/dist/wpf/extractors/regex/xaml-regex.d.ts +77 -0
  299. package/dist/wpf/extractors/regex/xaml-regex.d.ts.map +1 -0
  300. package/dist/wpf/extractors/regex/xaml-regex.js +353 -0
  301. package/dist/wpf/extractors/regex/xaml-regex.js.map +1 -0
  302. package/dist/wpf/extractors/resource-dictionary-parser.d.ts +103 -0
  303. package/dist/wpf/extractors/resource-dictionary-parser.d.ts.map +1 -0
  304. package/dist/wpf/extractors/resource-dictionary-parser.js +296 -0
  305. package/dist/wpf/extractors/resource-dictionary-parser.js.map +1 -0
  306. package/dist/wpf/extractors/value-converter-extractor.d.ts +128 -0
  307. package/dist/wpf/extractors/value-converter-extractor.d.ts.map +1 -0
  308. package/dist/wpf/extractors/value-converter-extractor.js +312 -0
  309. package/dist/wpf/extractors/value-converter-extractor.js.map +1 -0
  310. package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts +104 -0
  311. package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts.map +1 -0
  312. package/dist/wpf/extractors/viewmodel-hybrid-extractor.js +513 -0
  313. package/dist/wpf/extractors/viewmodel-hybrid-extractor.js.map +1 -0
  314. package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts +98 -0
  315. package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts.map +1 -0
  316. package/dist/wpf/extractors/xaml-hybrid-extractor.js +444 -0
  317. package/dist/wpf/extractors/xaml-hybrid-extractor.js.map +1 -0
  318. package/dist/wpf/index.d.ts +25 -0
  319. package/dist/wpf/index.d.ts.map +1 -0
  320. package/dist/wpf/index.js +31 -0
  321. package/dist/wpf/index.js.map +1 -0
  322. package/dist/wpf/integration/wpf-callgraph-adapter.d.ts +82 -0
  323. package/dist/wpf/integration/wpf-callgraph-adapter.d.ts.map +1 -0
  324. package/dist/wpf/integration/wpf-callgraph-adapter.js +311 -0
  325. package/dist/wpf/integration/wpf-callgraph-adapter.js.map +1 -0
  326. package/dist/wpf/integration/wpf-data-flow-tracer.d.ts +129 -0
  327. package/dist/wpf/integration/wpf-data-flow-tracer.d.ts.map +1 -0
  328. package/dist/wpf/integration/wpf-data-flow-tracer.js +367 -0
  329. package/dist/wpf/integration/wpf-data-flow-tracer.js.map +1 -0
  330. package/dist/wpf/linkers/datacontext-resolver.d.ts +66 -0
  331. package/dist/wpf/linkers/datacontext-resolver.d.ts.map +1 -0
  332. package/dist/wpf/linkers/datacontext-resolver.js +240 -0
  333. package/dist/wpf/linkers/datacontext-resolver.js.map +1 -0
  334. package/dist/wpf/linkers/viewmodel-linker.d.ts +71 -0
  335. package/dist/wpf/linkers/viewmodel-linker.d.ts.map +1 -0
  336. package/dist/wpf/linkers/viewmodel-linker.js +268 -0
  337. package/dist/wpf/linkers/viewmodel-linker.js.map +1 -0
  338. package/dist/wpf/types.d.ts +451 -0
  339. package/dist/wpf/types.d.ts.map +1 -0
  340. package/dist/wpf/types.js +8 -0
  341. package/dist/wpf/types.js.map +1 -0
  342. package/dist/wpf/wpf-analyzer.d.ts +114 -0
  343. package/dist/wpf/wpf-analyzer.d.ts.map +1 -0
  344. package/dist/wpf/wpf-analyzer.js +332 -0
  345. package/dist/wpf/wpf-analyzer.js.map +1 -0
  346. package/dist/wrappers/integration/adapter.d.ts.map +1 -1
  347. package/dist/wrappers/integration/adapter.js +1 -0
  348. package/dist/wrappers/integration/adapter.js.map +1 -1
  349. package/package.json +29 -18
  350. package/LICENSE +0 -21
@@ -0,0 +1,707 @@
1
+ /**
2
+ * Tree-sitter Go Parser
3
+ *
4
+ * Full Go parser using tree-sitter-go for semantic extraction.
5
+ * Extracts packages, imports, structs, interfaces, functions,
6
+ * methods, and type declarations from Go source files.
7
+ *
8
+ * Supports Go-specific features including receivers, embedded types,
9
+ * multiple return values, and interface embedding.
10
+ *
11
+ * @requirements Go Language Support
12
+ */
13
+ import { isGoTreeSitterAvailable, createGoParser, getGoLoadingError, } from './go-loader.js';
14
+ // ============================================
15
+ // Parser Class
16
+ // ============================================
17
+ /**
18
+ * Go parser using tree-sitter-go.
19
+ *
20
+ * Provides full semantic extraction for Go source files including:
21
+ * - Package declarations
22
+ * - Import statements
23
+ * - Function and method declarations
24
+ * - Struct and interface declarations
25
+ * - Type aliases
26
+ */
27
+ export class TreeSitterGoParser {
28
+ parser = null;
29
+ initError = null;
30
+ /**
31
+ * Check if the parser is available.
32
+ */
33
+ isAvailable() {
34
+ return isGoTreeSitterAvailable();
35
+ }
36
+ /**
37
+ * Get the initialization error if parser is not available.
38
+ */
39
+ getError() {
40
+ return this.initError ?? getGoLoadingError();
41
+ }
42
+ /**
43
+ * Initialize the parser.
44
+ * Call this before parsing or check isAvailable() first.
45
+ */
46
+ initialize() {
47
+ if (this.parser) {
48
+ return true;
49
+ }
50
+ if (!isGoTreeSitterAvailable()) {
51
+ this.initError = getGoLoadingError() ?? 'tree-sitter-go not available';
52
+ return false;
53
+ }
54
+ try {
55
+ this.parser = createGoParser();
56
+ return true;
57
+ }
58
+ catch (error) {
59
+ this.initError = error instanceof Error ? error.message : 'Failed to create Go parser';
60
+ return false;
61
+ }
62
+ }
63
+ /**
64
+ * Parse Go source code and extract semantic information.
65
+ *
66
+ * @param source - Go source code
67
+ * @param filePath - Optional file path for error reporting
68
+ * @returns GoParseResult with full semantic information
69
+ */
70
+ parse(source, _filePath) {
71
+ // Ensure parser is initialized
72
+ if (!this.parser && !this.initialize()) {
73
+ return this.createErrorResult(this.initError ?? 'Parser not initialized');
74
+ }
75
+ if (!this.parser) {
76
+ return this.createErrorResult('Parser not available');
77
+ }
78
+ try {
79
+ // Parse the source
80
+ const tree = this.parser.parse(source);
81
+ const rootNode = tree.rootNode;
82
+ // Extract semantic information
83
+ const packageInfo = this.extractPackage(rootNode);
84
+ const imports = this.extractImports(rootNode);
85
+ const packageName = packageInfo?.name ?? 'main';
86
+ // Extract declarations
87
+ const functions = this.extractFunctions(rootNode, packageName);
88
+ const methods = this.extractMethods(rootNode, packageName);
89
+ const structs = this.extractStructs(rootNode);
90
+ const interfaces = this.extractInterfaces(rootNode);
91
+ const typeAliases = this.extractTypeAliases(rootNode);
92
+ // Convert to AST for base result
93
+ const ast = this.convertToAST(rootNode, source);
94
+ return {
95
+ success: true,
96
+ language: 'go',
97
+ ast,
98
+ errors: [],
99
+ package: packageInfo,
100
+ imports,
101
+ functions,
102
+ methods,
103
+ structs,
104
+ interfaces,
105
+ typeAliases,
106
+ };
107
+ }
108
+ catch (error) {
109
+ return this.createErrorResult(error instanceof Error ? error.message : 'Parse error');
110
+ }
111
+ }
112
+ // ============================================
113
+ // Extraction Methods
114
+ // ============================================
115
+ /**
116
+ * Extract package declaration from the AST.
117
+ */
118
+ extractPackage(root) {
119
+ const packageNode = this.findChildByType(root, 'package_clause');
120
+ if (!packageNode) {
121
+ return null;
122
+ }
123
+ const nameNode = packageNode.childForFieldName('name') ??
124
+ this.findChildByType(packageNode, 'package_identifier');
125
+ if (!nameNode) {
126
+ return null;
127
+ }
128
+ return {
129
+ name: nameNode.text,
130
+ startPosition: this.toPosition(packageNode.startPosition),
131
+ endPosition: this.toPosition(packageNode.endPosition),
132
+ };
133
+ }
134
+ /**
135
+ * Extract import statements from the AST.
136
+ */
137
+ extractImports(root) {
138
+ const imports = [];
139
+ this.findNodesOfType(root, 'import_declaration', (node) => {
140
+ // Handle import spec list (grouped imports)
141
+ this.findNodesOfType(node, 'import_spec', (specNode) => {
142
+ const importInfo = this.parseImportSpec(specNode);
143
+ if (importInfo) {
144
+ imports.push(importInfo);
145
+ }
146
+ });
147
+ });
148
+ return imports;
149
+ }
150
+ /**
151
+ * Parse a single import spec.
152
+ */
153
+ parseImportSpec(node) {
154
+ const pathNode = node.childForFieldName('path') ??
155
+ this.findChildByType(node, 'interpreted_string_literal');
156
+ if (!pathNode) {
157
+ return null;
158
+ }
159
+ // Remove quotes from path
160
+ const path = pathNode.text.replace(/^"|"$/g, '');
161
+ // Check for alias
162
+ const nameNode = node.childForFieldName('name') ??
163
+ this.findChildByType(node, 'package_identifier') ??
164
+ this.findChildByType(node, 'blank_identifier') ??
165
+ this.findChildByType(node, 'dot');
166
+ let alias = null;
167
+ let isBlankImport = false;
168
+ let isDotImport = false;
169
+ if (nameNode) {
170
+ if (nameNode.type === 'blank_identifier' || nameNode.text === '_') {
171
+ isBlankImport = true;
172
+ alias = '_';
173
+ }
174
+ else if (nameNode.type === 'dot' || nameNode.text === '.') {
175
+ isDotImport = true;
176
+ alias = '.';
177
+ }
178
+ else {
179
+ alias = nameNode.text;
180
+ }
181
+ }
182
+ return {
183
+ path,
184
+ alias,
185
+ isBlankImport,
186
+ isDotImport,
187
+ startPosition: this.toPosition(node.startPosition),
188
+ endPosition: this.toPosition(node.endPosition),
189
+ };
190
+ }
191
+ /**
192
+ * Extract function declarations (non-method functions).
193
+ */
194
+ extractFunctions(root, packageName) {
195
+ const functions = [];
196
+ this.findNodesOfType(root, 'function_declaration', (node) => {
197
+ const funcInfo = this.parseFunctionDeclaration(node, packageName);
198
+ if (funcInfo) {
199
+ functions.push(funcInfo);
200
+ }
201
+ });
202
+ return functions;
203
+ }
204
+ /**
205
+ * Parse a function declaration.
206
+ */
207
+ parseFunctionDeclaration(node, packageName) {
208
+ const nameNode = node.childForFieldName('name');
209
+ if (!nameNode) {
210
+ return null;
211
+ }
212
+ const name = nameNode.text;
213
+ const isExported = /^[A-Z]/.test(name);
214
+ const parametersNode = node.childForFieldName('parameters');
215
+ const resultNode = node.childForFieldName('result');
216
+ const bodyNode = node.childForFieldName('body');
217
+ const parameters = parametersNode ? this.extractParameters(parametersNode) : [];
218
+ const returns = resultNode ? this.extractReturns(resultNode) : [];
219
+ const isVariadic = parameters.some(p => p.isVariadic);
220
+ return {
221
+ name,
222
+ qualifiedName: `${packageName}.${name}`,
223
+ parameters,
224
+ returns,
225
+ isExported,
226
+ isVariadic,
227
+ startPosition: this.toPosition(node.startPosition),
228
+ endPosition: this.toPosition(node.endPosition),
229
+ bodyStartPosition: bodyNode ? this.toPosition(bodyNode.startPosition) : null,
230
+ bodyEndPosition: bodyNode ? this.toPosition(bodyNode.endPosition) : null,
231
+ };
232
+ }
233
+ /**
234
+ * Extract method declarations (functions with receivers).
235
+ */
236
+ extractMethods(root, packageName) {
237
+ const methods = [];
238
+ this.findNodesOfType(root, 'method_declaration', (node) => {
239
+ const methodInfo = this.parseMethodDeclaration(node, packageName);
240
+ if (methodInfo) {
241
+ methods.push(methodInfo);
242
+ }
243
+ });
244
+ return methods;
245
+ }
246
+ /**
247
+ * Parse a method declaration.
248
+ */
249
+ parseMethodDeclaration(node, packageName) {
250
+ const nameNode = node.childForFieldName('name');
251
+ const receiverNode = node.childForFieldName('receiver');
252
+ if (!nameNode || !receiverNode) {
253
+ return null;
254
+ }
255
+ const name = nameNode.text;
256
+ const isExported = /^[A-Z]/.test(name);
257
+ const receiver = this.parseReceiver(receiverNode);
258
+ if (!receiver) {
259
+ return null;
260
+ }
261
+ const parametersNode = node.childForFieldName('parameters');
262
+ const resultNode = node.childForFieldName('result');
263
+ const bodyNode = node.childForFieldName('body');
264
+ const parameters = parametersNode ? this.extractParameters(parametersNode) : [];
265
+ const returns = resultNode ? this.extractReturns(resultNode) : [];
266
+ const isVariadic = parameters.some(p => p.isVariadic);
267
+ return {
268
+ name,
269
+ qualifiedName: `${packageName}.${receiver.type}.${name}`,
270
+ receiver,
271
+ parameters,
272
+ returns,
273
+ isExported,
274
+ isVariadic,
275
+ startPosition: this.toPosition(node.startPosition),
276
+ endPosition: this.toPosition(node.endPosition),
277
+ bodyStartPosition: bodyNode ? this.toPosition(bodyNode.startPosition) : null,
278
+ bodyEndPosition: bodyNode ? this.toPosition(bodyNode.endPosition) : null,
279
+ };
280
+ }
281
+ /**
282
+ * Parse a receiver declaration.
283
+ */
284
+ parseReceiver(node) {
285
+ // Receiver is a parameter_list with one parameter
286
+ for (const child of node.children) {
287
+ if (child.type === 'parameter_declaration') {
288
+ const nameNode = this.findChildByType(child, 'identifier');
289
+ const typeNode = child.childForFieldName('type');
290
+ if (!typeNode)
291
+ continue;
292
+ let typeName;
293
+ let isPointer = false;
294
+ if (typeNode.type === 'pointer_type') {
295
+ isPointer = true;
296
+ // Use namedChildren instead of namedChild
297
+ const innerType = typeNode.namedChildren[0];
298
+ typeName = innerType?.text ?? 'unknown';
299
+ }
300
+ else {
301
+ typeName = typeNode.text;
302
+ }
303
+ return {
304
+ name: nameNode?.text ?? '_',
305
+ type: typeName,
306
+ isPointer,
307
+ };
308
+ }
309
+ }
310
+ return null;
311
+ }
312
+ /**
313
+ * Extract parameters from a parameter list.
314
+ */
315
+ extractParameters(node) {
316
+ const params = [];
317
+ for (const child of node.children) {
318
+ if (child.type === 'parameter_declaration') {
319
+ const names = [];
320
+ let type;
321
+ let isVariadic = false;
322
+ for (const paramChild of child.children) {
323
+ if (paramChild.type === 'identifier') {
324
+ names.push(paramChild.text);
325
+ }
326
+ else if (paramChild.type === 'variadic_parameter_declaration') {
327
+ isVariadic = true;
328
+ const variadicType = paramChild.childForFieldName('type');
329
+ type = variadicType?.text;
330
+ }
331
+ else if (this.isTypeNode(paramChild)) {
332
+ type = paramChild.text;
333
+ }
334
+ }
335
+ // If no names, it's an unnamed parameter
336
+ if (names.length === 0) {
337
+ params.push({
338
+ name: '_',
339
+ type: type ?? 'unknown',
340
+ isVariadic,
341
+ });
342
+ }
343
+ else {
344
+ for (const name of names) {
345
+ params.push({
346
+ name,
347
+ type: type ?? 'unknown',
348
+ isVariadic,
349
+ });
350
+ }
351
+ }
352
+ }
353
+ else if (child.type === 'variadic_parameter_declaration') {
354
+ const nameNode = this.findChildByType(child, 'identifier');
355
+ const typeNode = child.childForFieldName('type');
356
+ params.push({
357
+ name: nameNode?.text ?? '_',
358
+ type: typeNode?.text ?? 'unknown',
359
+ isVariadic: true,
360
+ });
361
+ }
362
+ }
363
+ return params;
364
+ }
365
+ /**
366
+ * Extract return types from a result node.
367
+ */
368
+ extractReturns(node) {
369
+ const returns = [];
370
+ if (node.type === 'parameter_list') {
371
+ // Multiple/named returns: (int, error) or (result int, err error)
372
+ for (const child of node.children) {
373
+ if (child.type === 'parameter_declaration') {
374
+ const names = [];
375
+ let type;
376
+ for (const paramChild of child.children) {
377
+ if (paramChild.type === 'identifier') {
378
+ names.push(paramChild.text);
379
+ }
380
+ else if (this.isTypeNode(paramChild)) {
381
+ type = paramChild.text;
382
+ }
383
+ }
384
+ if (names.length === 0) {
385
+ returns.push({ name: null, type: type ?? 'unknown' });
386
+ }
387
+ else {
388
+ for (const name of names) {
389
+ returns.push({ name, type: type ?? 'unknown' });
390
+ }
391
+ }
392
+ }
393
+ }
394
+ }
395
+ else {
396
+ // Single return type
397
+ returns.push({ name: null, type: node.text });
398
+ }
399
+ return returns;
400
+ }
401
+ /**
402
+ * Extract struct declarations.
403
+ */
404
+ extractStructs(root) {
405
+ const structs = [];
406
+ this.findNodesOfType(root, 'type_declaration', (node) => {
407
+ for (const child of node.children) {
408
+ if (child.type === 'type_spec') {
409
+ const nameNode = child.childForFieldName('name');
410
+ const typeNode = child.childForFieldName('type');
411
+ if (nameNode && typeNode?.type === 'struct_type') {
412
+ const structInfo = this.parseStruct(nameNode.text, typeNode);
413
+ if (structInfo) {
414
+ structs.push(structInfo);
415
+ }
416
+ }
417
+ }
418
+ }
419
+ });
420
+ return structs;
421
+ }
422
+ /**
423
+ * Parse a struct type.
424
+ */
425
+ parseStruct(name, node) {
426
+ const isExported = /^[A-Z]/.test(name);
427
+ const fields = [];
428
+ const embeddedTypes = [];
429
+ const fieldListNode = node.childForFieldName('fields') ??
430
+ this.findChildByType(node, 'field_declaration_list');
431
+ if (fieldListNode) {
432
+ for (const child of fieldListNode.children) {
433
+ if (child.type === 'field_declaration') {
434
+ const fieldInfo = this.parseField(child);
435
+ if (fieldInfo) {
436
+ if (fieldInfo.isEmbedded) {
437
+ embeddedTypes.push(fieldInfo.type);
438
+ }
439
+ fields.push(fieldInfo);
440
+ }
441
+ }
442
+ }
443
+ }
444
+ return {
445
+ name,
446
+ isExported,
447
+ fields,
448
+ embeddedTypes,
449
+ startPosition: this.toPosition(node.startPosition),
450
+ endPosition: this.toPosition(node.endPosition),
451
+ };
452
+ }
453
+ /**
454
+ * Parse a struct field.
455
+ */
456
+ parseField(node) {
457
+ const names = [];
458
+ let type;
459
+ let tag = null;
460
+ for (const child of node.children) {
461
+ if (child.type === 'field_identifier') {
462
+ names.push(child.text);
463
+ }
464
+ else if (this.isTypeNode(child)) {
465
+ type = child.text.replace(/^\*/, ''); // Remove pointer for embedded type check
466
+ }
467
+ else if (child.type === 'raw_string_literal' || child.type === 'interpreted_string_literal') {
468
+ tag = child.text;
469
+ }
470
+ }
471
+ if (!type) {
472
+ return null;
473
+ }
474
+ // Embedded type (no name, just type)
475
+ const isEmbedded = names.length === 0;
476
+ const fieldName = isEmbedded ? type : names[0];
477
+ const isExported = /^[A-Z]/.test(fieldName);
478
+ return {
479
+ name: fieldName,
480
+ type,
481
+ tag,
482
+ isExported,
483
+ isEmbedded,
484
+ startPosition: this.toPosition(node.startPosition),
485
+ endPosition: this.toPosition(node.endPosition),
486
+ };
487
+ }
488
+ /**
489
+ * Extract interface declarations.
490
+ */
491
+ extractInterfaces(root) {
492
+ const interfaces = [];
493
+ this.findNodesOfType(root, 'type_declaration', (node) => {
494
+ for (const child of node.children) {
495
+ if (child.type === 'type_spec') {
496
+ const nameNode = child.childForFieldName('name');
497
+ const typeNode = child.childForFieldName('type');
498
+ if (nameNode && typeNode?.type === 'interface_type') {
499
+ const interfaceInfo = this.parseInterface(nameNode.text, typeNode);
500
+ if (interfaceInfo) {
501
+ interfaces.push(interfaceInfo);
502
+ }
503
+ }
504
+ }
505
+ }
506
+ });
507
+ return interfaces;
508
+ }
509
+ /**
510
+ * Parse an interface type.
511
+ */
512
+ parseInterface(name, node) {
513
+ const isExported = /^[A-Z]/.test(name);
514
+ const methods = [];
515
+ const embeddedInterfaces = [];
516
+ for (const child of node.children) {
517
+ if (child.type === 'method_spec') {
518
+ const methodInfo = this.parseInterfaceMethod(child);
519
+ if (methodInfo) {
520
+ methods.push(methodInfo);
521
+ }
522
+ }
523
+ else if (child.type === 'type_identifier' || child.type === 'qualified_type') {
524
+ // Embedded interface
525
+ embeddedInterfaces.push(child.text);
526
+ }
527
+ }
528
+ return {
529
+ name,
530
+ isExported,
531
+ methods,
532
+ embeddedInterfaces,
533
+ startPosition: this.toPosition(node.startPosition),
534
+ endPosition: this.toPosition(node.endPosition),
535
+ };
536
+ }
537
+ /**
538
+ * Parse an interface method signature.
539
+ */
540
+ parseInterfaceMethod(node) {
541
+ const nameNode = node.childForFieldName('name');
542
+ if (!nameNode) {
543
+ return null;
544
+ }
545
+ const parametersNode = node.childForFieldName('parameters');
546
+ const resultNode = node.childForFieldName('result');
547
+ return {
548
+ name: nameNode.text,
549
+ parameters: parametersNode ? this.extractParameters(parametersNode) : [],
550
+ returns: resultNode ? this.extractReturns(resultNode) : [],
551
+ };
552
+ }
553
+ /**
554
+ * Extract type alias declarations.
555
+ */
556
+ extractTypeAliases(root) {
557
+ const aliases = [];
558
+ this.findNodesOfType(root, 'type_declaration', (node) => {
559
+ for (const child of node.children) {
560
+ if (child.type === 'type_spec') {
561
+ const nameNode = child.childForFieldName('name');
562
+ const typeNode = child.childForFieldName('type');
563
+ if (nameNode && typeNode &&
564
+ typeNode.type !== 'struct_type' &&
565
+ typeNode.type !== 'interface_type') {
566
+ aliases.push({
567
+ name: nameNode.text,
568
+ underlyingType: typeNode.text,
569
+ isExported: /^[A-Z]/.test(nameNode.text),
570
+ startPosition: this.toPosition(child.startPosition),
571
+ endPosition: this.toPosition(child.endPosition),
572
+ });
573
+ }
574
+ }
575
+ }
576
+ });
577
+ return aliases;
578
+ }
579
+ // ============================================
580
+ // Utility Methods
581
+ // ============================================
582
+ /**
583
+ * Check if a node is a type node.
584
+ */
585
+ isTypeNode(node) {
586
+ const typeNodes = [
587
+ 'type_identifier',
588
+ 'pointer_type',
589
+ 'slice_type',
590
+ 'array_type',
591
+ 'map_type',
592
+ 'channel_type',
593
+ 'function_type',
594
+ 'qualified_type',
595
+ 'struct_type',
596
+ 'interface_type',
597
+ ];
598
+ return typeNodes.includes(node.type);
599
+ }
600
+ /**
601
+ * Convert tree-sitter AST to drift AST format.
602
+ */
603
+ convertToAST(node, source) {
604
+ const rootNode = this.convertNode(node);
605
+ return {
606
+ rootNode,
607
+ text: source,
608
+ };
609
+ }
610
+ /**
611
+ * Convert a single tree-sitter node to drift ASTNode.
612
+ */
613
+ convertNode(node) {
614
+ const children = [];
615
+ for (const child of node.children) {
616
+ children.push(this.convertNode(child));
617
+ }
618
+ return {
619
+ type: this.mapNodeType(node.type),
620
+ text: node.text,
621
+ children,
622
+ startPosition: this.toPosition(node.startPosition),
623
+ endPosition: this.toPosition(node.endPosition),
624
+ };
625
+ }
626
+ /**
627
+ * Map tree-sitter node types to drift node types.
628
+ */
629
+ mapNodeType(type) {
630
+ const typeMap = {
631
+ source_file: 'Program',
632
+ package_clause: 'PackageDeclaration',
633
+ import_declaration: 'ImportDeclaration',
634
+ function_declaration: 'FunctionDeclaration',
635
+ method_declaration: 'MethodDeclaration',
636
+ type_declaration: 'TypeDeclaration',
637
+ struct_type: 'StructType',
638
+ interface_type: 'InterfaceType',
639
+ identifier: 'Identifier',
640
+ type_identifier: 'TypeIdentifier',
641
+ block: 'Block',
642
+ return_statement: 'ReturnStatement',
643
+ if_statement: 'IfStatement',
644
+ for_statement: 'ForStatement',
645
+ go_statement: 'GoStatement',
646
+ defer_statement: 'DeferStatement',
647
+ call_expression: 'CallExpression',
648
+ selector_expression: 'SelectorExpression',
649
+ };
650
+ return typeMap[type] ?? type;
651
+ }
652
+ /**
653
+ * Convert tree-sitter position to drift Position.
654
+ */
655
+ toPosition(point) {
656
+ return {
657
+ row: point.row,
658
+ column: point.column,
659
+ };
660
+ }
661
+ /**
662
+ * Find a child node by type.
663
+ */
664
+ findChildByType(node, type) {
665
+ for (const child of node.children) {
666
+ if (child.type === type) {
667
+ return child;
668
+ }
669
+ }
670
+ return null;
671
+ }
672
+ /**
673
+ * Find all nodes of a specific type in the tree.
674
+ */
675
+ findNodesOfType(node, type, callback) {
676
+ if (node.type === type) {
677
+ callback(node);
678
+ }
679
+ for (const child of node.children) {
680
+ this.findNodesOfType(child, type, callback);
681
+ }
682
+ }
683
+ /**
684
+ * Create an error result.
685
+ */
686
+ createErrorResult(message) {
687
+ return {
688
+ success: false,
689
+ language: 'go',
690
+ ast: null,
691
+ errors: [
692
+ {
693
+ message,
694
+ position: { row: 0, column: 0 },
695
+ },
696
+ ],
697
+ package: null,
698
+ imports: [],
699
+ functions: [],
700
+ methods: [],
701
+ structs: [],
702
+ interfaces: [],
703
+ typeAliases: [],
704
+ };
705
+ }
706
+ }
707
+ //# sourceMappingURL=tree-sitter-go-parser.js.map