yukigo 0.2.2 → 0.3.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 (266) hide show
  1. package/.mocharc.json +3 -3
  2. package/CHANGELOG.md +102 -41
  3. package/README.md +193 -193
  4. package/dist/analyzer/GraphBuilder.d.ts +1 -0
  5. package/dist/analyzer/GraphBuilder.js +2 -1
  6. package/dist/analyzer/index.d.ts +0 -7
  7. package/dist/analyzer/index.js +3 -3
  8. package/dist/analyzer/inspections/functional/functional.d.ts +1 -1
  9. package/dist/analyzer/inspections/functional/functional.js +1 -1
  10. package/dist/analyzer/inspections/functional/smells.d.ts +3 -3
  11. package/dist/analyzer/inspections/functional/smells.js +27 -35
  12. package/dist/analyzer/inspections/generic/generic.d.ts +21 -14
  13. package/dist/analyzer/inspections/generic/generic.js +78 -59
  14. package/dist/analyzer/inspections/generic/smells.d.ts +2 -0
  15. package/dist/analyzer/inspections/generic/smells.js +55 -64
  16. package/dist/analyzer/inspections/imperative/imperative.d.ts +3 -3
  17. package/dist/analyzer/inspections/imperative/imperative.js +3 -3
  18. package/dist/analyzer/inspections/imperative/smells.d.ts +1 -0
  19. package/dist/analyzer/inspections/imperative/smells.js +8 -5
  20. package/dist/analyzer/inspections/logic/logic.d.ts +8 -8
  21. package/dist/analyzer/inspections/logic/logic.js +5 -5
  22. package/dist/analyzer/inspections/logic/smells.js +2 -2
  23. package/dist/analyzer/inspections/object/object.d.ts +5 -5
  24. package/dist/analyzer/inspections/object/object.js +22 -21
  25. package/dist/analyzer/inspections/object/smells.js +11 -23
  26. package/dist/analyzer/utils.d.ts +6 -2
  27. package/dist/analyzer/utils.js +6 -2
  28. package/dist/interpreter/components/EnvBuilder.d.ts +20 -1
  29. package/dist/interpreter/components/EnvBuilder.js +211 -66
  30. package/dist/interpreter/components/EqualityComparer.d.ts +15 -0
  31. package/dist/interpreter/components/EqualityComparer.js +69 -0
  32. package/dist/interpreter/components/Operations.d.ts +17 -14
  33. package/dist/interpreter/components/Operations.js +61 -62
  34. package/dist/interpreter/components/PatternMatcher.d.ts +19 -58
  35. package/dist/interpreter/components/PatternMatcher.js +185 -286
  36. package/dist/interpreter/components/RuntimeContext.d.ts +24 -15
  37. package/dist/interpreter/components/RuntimeContext.js +43 -4
  38. package/dist/interpreter/components/TestRunner.d.ts +15 -13
  39. package/dist/interpreter/components/TestRunner.js +86 -53
  40. package/dist/interpreter/components/evaluators/BaseEvaluator.d.ts +19 -0
  41. package/dist/interpreter/components/evaluators/BaseEvaluator.js +20 -0
  42. package/dist/interpreter/components/evaluators/ExpressionEvaluator.d.ts +34 -0
  43. package/dist/interpreter/components/evaluators/ExpressionEvaluator.js +298 -0
  44. package/dist/interpreter/components/evaluators/OperationEvaluator.d.ts +25 -0
  45. package/dist/interpreter/components/evaluators/OperationEvaluator.js +226 -0
  46. package/dist/interpreter/components/evaluators/PrimitiveEvaluator.d.ts +19 -0
  47. package/dist/interpreter/components/evaluators/PrimitiveEvaluator.js +50 -0
  48. package/dist/interpreter/components/evaluators/StatementEvaluator.d.ts +28 -0
  49. package/dist/interpreter/components/evaluators/StatementEvaluator.js +240 -0
  50. package/dist/interpreter/components/evaluators/TestingEvaluator.d.ts +15 -0
  51. package/dist/interpreter/components/evaluators/TestingEvaluator.js +14 -0
  52. package/dist/interpreter/components/evaluators/index.d.ts +110 -0
  53. package/dist/interpreter/components/evaluators/index.js +21 -0
  54. package/dist/interpreter/components/evaluators/utils.d.ts +7 -0
  55. package/dist/interpreter/components/evaluators/utils.js +50 -0
  56. package/dist/interpreter/components/hooks/YukigoHook.d.ts +27 -0
  57. package/dist/interpreter/components/hooks/YukigoHook.js +1 -0
  58. package/dist/interpreter/components/kernel/commands.d.ts +122 -0
  59. package/dist/interpreter/components/kernel/commands.js +203 -0
  60. package/dist/interpreter/components/kernel/index.d.ts +51 -0
  61. package/dist/interpreter/components/kernel/index.js +176 -0
  62. package/dist/interpreter/components/logic/LogicEngine.d.ts +26 -23
  63. package/dist/interpreter/components/logic/LogicEngine.js +234 -221
  64. package/dist/interpreter/components/logic/LogicResolver.d.ts +22 -51
  65. package/dist/interpreter/components/logic/LogicResolver.js +73 -440
  66. package/dist/interpreter/components/logic/LogicTerm.d.ts +104 -0
  67. package/dist/interpreter/components/logic/LogicTerm.js +423 -0
  68. package/dist/interpreter/components/logic/LogicTranslator.d.ts +25 -9
  69. package/dist/interpreter/components/logic/LogicTranslator.js +211 -74
  70. package/dist/interpreter/components/runtimes/FunctionRuntime.d.ts +6 -4
  71. package/dist/interpreter/components/runtimes/FunctionRuntime.js +82 -84
  72. package/dist/interpreter/components/runtimes/LazyRuntime.d.ts +13 -14
  73. package/dist/interpreter/components/runtimes/LazyRuntime.js +112 -239
  74. package/dist/interpreter/components/runtimes/ObjectRuntime.d.ts +17 -14
  75. package/dist/interpreter/components/runtimes/ObjectRuntime.js +105 -74
  76. package/dist/interpreter/errors.d.ts +10 -0
  77. package/dist/interpreter/errors.js +17 -0
  78. package/dist/interpreter/index.d.ts +9 -5
  79. package/dist/interpreter/index.js +11 -13
  80. package/dist/interpreter/primitives/YuValue.d.ts +21 -0
  81. package/dist/interpreter/primitives/YuValue.js +40 -0
  82. package/dist/interpreter/primitives/capabilities.d.ts +90 -0
  83. package/dist/interpreter/primitives/capabilities.js +1 -0
  84. package/dist/interpreter/primitives/entities/LazyList.d.ts +48 -0
  85. package/dist/interpreter/primitives/entities/LazyList.js +164 -0
  86. package/dist/interpreter/primitives/entities/LogicResult.d.ts +51 -0
  87. package/dist/interpreter/primitives/entities/LogicResult.js +101 -0
  88. package/dist/interpreter/primitives/entities/RuntimeClass.d.ts +24 -0
  89. package/dist/interpreter/primitives/entities/RuntimeClass.js +57 -0
  90. package/dist/interpreter/primitives/entities/RuntimeFunction.d.ts +40 -0
  91. package/dist/interpreter/primitives/entities/RuntimeFunction.js +73 -0
  92. package/dist/interpreter/primitives/entities/RuntimeObject.d.ts +27 -0
  93. package/dist/interpreter/primitives/entities/RuntimeObject.js +82 -0
  94. package/dist/interpreter/primitives/entities/RuntimePredicate.d.ts +19 -0
  95. package/dist/interpreter/primitives/entities/RuntimePredicate.js +59 -0
  96. package/dist/interpreter/primitives/index.d.ts +14 -0
  97. package/dist/interpreter/primitives/index.js +14 -0
  98. package/dist/interpreter/primitives/scalars/YuBoolean.d.ts +24 -0
  99. package/dist/interpreter/primitives/scalars/YuBoolean.js +69 -0
  100. package/dist/interpreter/primitives/scalars/YuChar.d.ts +28 -0
  101. package/dist/interpreter/primitives/scalars/YuChar.js +78 -0
  102. package/dist/interpreter/primitives/scalars/YuNil.d.ts +25 -0
  103. package/dist/interpreter/primitives/scalars/YuNil.js +73 -0
  104. package/dist/interpreter/primitives/scalars/YuNumber.d.ts +49 -0
  105. package/dist/interpreter/primitives/scalars/YuNumber.js +165 -0
  106. package/dist/interpreter/primitives/sequences/YuArray.d.ts +33 -0
  107. package/dist/interpreter/primitives/sequences/YuArray.js +150 -0
  108. package/dist/interpreter/primitives/sequences/YuString.d.ts +40 -0
  109. package/dist/interpreter/primitives/sequences/YuString.js +130 -0
  110. package/dist/interpreter/utils.d.ts +23 -10
  111. package/dist/interpreter/utils.js +25 -30
  112. package/dist/tester/index.d.ts +3 -3
  113. package/dist/tester/index.js +39 -28
  114. package/dist/utils/helpers.d.ts +12 -5
  115. package/dist/utils/helpers.js +6 -79
  116. package/package.json +3 -16
  117. package/src/analyzer/GraphBuilder.ts +143 -142
  118. package/src/analyzer/index.ts +185 -194
  119. package/src/analyzer/inspections/functional/functional.ts +121 -121
  120. package/src/analyzer/inspections/functional/smells.ts +88 -102
  121. package/src/analyzer/inspections/generic/generic.ts +610 -581
  122. package/src/analyzer/inspections/generic/smells.ts +355 -365
  123. package/src/analyzer/inspections/imperative/imperative.ts +104 -101
  124. package/src/analyzer/inspections/imperative/smells.ts +58 -54
  125. package/src/analyzer/inspections/logic/logic.ts +84 -90
  126. package/src/analyzer/inspections/logic/smells.ts +54 -54
  127. package/src/analyzer/inspections/object/object.ts +295 -264
  128. package/src/analyzer/inspections/object/smells.ts +130 -144
  129. package/src/analyzer/utils.ts +115 -109
  130. package/src/index.ts +3 -3
  131. package/src/interpreter/components/EnvBuilder.ts +405 -202
  132. package/src/interpreter/components/EqualityComparer.ts +107 -0
  133. package/src/interpreter/components/Operations.ts +126 -99
  134. package/src/interpreter/components/PatternMatcher.ts +375 -475
  135. package/src/interpreter/components/RuntimeContext.ts +181 -119
  136. package/src/interpreter/components/TestRunner.ts +223 -151
  137. package/src/interpreter/components/evaluators/BaseEvaluator.ts +36 -0
  138. package/src/interpreter/components/evaluators/ExpressionEvaluator.ts +475 -0
  139. package/src/interpreter/components/evaluators/OperationEvaluator.ts +477 -0
  140. package/src/interpreter/components/evaluators/PrimitiveEvaluator.ts +80 -0
  141. package/src/interpreter/components/evaluators/StatementEvaluator.ts +372 -0
  142. package/src/interpreter/components/evaluators/TestingEvaluator.ts +26 -0
  143. package/src/interpreter/components/evaluators/index.ts +34 -0
  144. package/src/interpreter/components/evaluators/utils.ts +64 -0
  145. package/src/interpreter/components/hooks/YukigoHook.ts +45 -0
  146. package/src/interpreter/components/kernel/commands.ts +255 -0
  147. package/src/interpreter/components/kernel/index.ts +222 -0
  148. package/src/interpreter/components/logic/LogicEngine.ts +509 -519
  149. package/src/interpreter/components/logic/LogicResolver.ts +209 -858
  150. package/src/interpreter/components/logic/LogicTerm.ts +477 -0
  151. package/src/interpreter/components/logic/LogicTranslator.ts +362 -149
  152. package/src/interpreter/components/runtimes/FunctionRuntime.ts +249 -227
  153. package/src/interpreter/components/runtimes/LazyRuntime.ts +226 -334
  154. package/src/interpreter/components/runtimes/ObjectRuntime.ts +262 -224
  155. package/src/interpreter/errors.ts +68 -47
  156. package/src/interpreter/index.ts +50 -52
  157. package/src/interpreter/primitives/YuValue.ts +64 -0
  158. package/src/interpreter/primitives/capabilities.ts +111 -0
  159. package/src/interpreter/primitives/entities/LazyList.ts +225 -0
  160. package/src/interpreter/primitives/entities/LogicResult.ts +133 -0
  161. package/src/interpreter/primitives/entities/RuntimeClass.ts +70 -0
  162. package/src/interpreter/primitives/entities/RuntimeFunction.ts +108 -0
  163. package/src/interpreter/primitives/entities/RuntimeObject.ts +110 -0
  164. package/src/interpreter/primitives/entities/RuntimePredicate.ts +77 -0
  165. package/src/interpreter/primitives/index.ts +17 -0
  166. package/src/interpreter/primitives/scalars/YuBoolean.ts +79 -0
  167. package/src/interpreter/primitives/scalars/YuChar.ts +94 -0
  168. package/src/interpreter/primitives/scalars/YuNil.ts +84 -0
  169. package/src/interpreter/primitives/scalars/YuNumber.ts +187 -0
  170. package/src/interpreter/primitives/sequences/YuArray.ts +178 -0
  171. package/src/interpreter/primitives/sequences/YuString.ts +165 -0
  172. package/src/interpreter/utils.ts +105 -84
  173. package/src/tester/index.ts +157 -128
  174. package/src/utils/helpers.ts +81 -168
  175. package/tests/analyzer/functional.spec.ts +221 -207
  176. package/tests/analyzer/generic.spec.ts +178 -178
  177. package/tests/analyzer/helpers.spec.ts +83 -89
  178. package/tests/analyzer/logic.spec.ts +237 -237
  179. package/tests/analyzer/oop.spec.ts +320 -323
  180. package/tests/analyzer/transitive.spec.ts +166 -166
  181. package/tests/interpreter/EnvBuilder.spec.ts +181 -183
  182. package/tests/interpreter/FunctionRuntime.spec.ts +224 -223
  183. package/tests/interpreter/LazyRuntime.spec.ts +227 -225
  184. package/tests/interpreter/LogicEngine.spec.ts +371 -327
  185. package/tests/interpreter/LogicSubstitution.spec.ts +90 -80
  186. package/tests/interpreter/ObjectRuntime.spec.ts +431 -606
  187. package/tests/interpreter/Operations.spec.ts +312 -220
  188. package/tests/interpreter/PatternSystem.spec.ts +254 -213
  189. package/tests/interpreter/Tests.spec.ts +122 -122
  190. package/tests/interpreter/interpreter.spec.ts +1143 -991
  191. package/tests/kernel/YukigoKernel.spec.ts +112 -0
  192. package/tests/tester/Tester.spec.ts +188 -152
  193. package/tsconfig.build.json +16 -15
  194. package/tsconfig.json +27 -25
  195. package/dist/interpreter/components/Visitor.d.ts +0 -70
  196. package/dist/interpreter/components/Visitor.js +0 -634
  197. package/dist/interpreter/entities.d.ts +0 -105
  198. package/dist/interpreter/entities.js +0 -96
  199. package/dist/interpreter/trampoline.d.ts +0 -17
  200. package/dist/interpreter/trampoline.js +0 -38
  201. package/dist/src/analyzer/GraphBuilder.d.ts +0 -30
  202. package/dist/src/analyzer/GraphBuilder.js +0 -100
  203. package/dist/src/analyzer/index.d.ts +0 -59
  204. package/dist/src/analyzer/index.js +0 -152
  205. package/dist/src/analyzer/inspections/functional/functional.d.ts +0 -44
  206. package/dist/src/analyzer/inspections/functional/functional.js +0 -149
  207. package/dist/src/analyzer/inspections/functional/smells.d.ts +0 -16
  208. package/dist/src/analyzer/inspections/functional/smells.js +0 -98
  209. package/dist/src/analyzer/inspections/generic/generic.d.ts +0 -178
  210. package/dist/src/analyzer/inspections/generic/generic.js +0 -604
  211. package/dist/src/analyzer/inspections/generic/smells.d.ts +0 -61
  212. package/dist/src/analyzer/inspections/generic/smells.js +0 -349
  213. package/dist/src/analyzer/inspections/imperative/imperative.d.ts +0 -35
  214. package/dist/src/analyzer/inspections/imperative/imperative.js +0 -109
  215. package/dist/src/analyzer/inspections/imperative/smells.d.ts +0 -16
  216. package/dist/src/analyzer/inspections/imperative/smells.js +0 -58
  217. package/dist/src/analyzer/inspections/logic/logic.d.ts +0 -32
  218. package/dist/src/analyzer/inspections/logic/logic.js +0 -96
  219. package/dist/src/analyzer/inspections/logic/smells.d.ts +0 -15
  220. package/dist/src/analyzer/inspections/logic/smells.js +0 -60
  221. package/dist/src/analyzer/inspections/object/object.d.ts +0 -90
  222. package/dist/src/analyzer/inspections/object/object.js +0 -321
  223. package/dist/src/analyzer/inspections/object/smells.d.ts +0 -30
  224. package/dist/src/analyzer/inspections/object/smells.js +0 -135
  225. package/dist/src/analyzer/utils.d.ts +0 -30
  226. package/dist/src/analyzer/utils.js +0 -78
  227. package/dist/src/index.d.ts +0 -4
  228. package/dist/src/index.js +0 -4
  229. package/dist/src/interpreter/components/EnvBuilder.d.ts +0 -21
  230. package/dist/src/interpreter/components/EnvBuilder.js +0 -155
  231. package/dist/src/interpreter/components/Operations.d.ts +0 -14
  232. package/dist/src/interpreter/components/Operations.js +0 -84
  233. package/dist/src/interpreter/components/PatternMatcher.d.ts +0 -73
  234. package/dist/src/interpreter/components/PatternMatcher.js +0 -358
  235. package/dist/src/interpreter/components/RuntimeContext.d.ts +0 -35
  236. package/dist/src/interpreter/components/RuntimeContext.js +0 -93
  237. package/dist/src/interpreter/components/TestRunner.d.ts +0 -19
  238. package/dist/src/interpreter/components/TestRunner.js +0 -110
  239. package/dist/src/interpreter/components/Visitor.d.ts +0 -71
  240. package/dist/src/interpreter/components/Visitor.js +0 -638
  241. package/dist/src/interpreter/components/logic/LogicEngine.d.ts +0 -29
  242. package/dist/src/interpreter/components/logic/LogicEngine.js +0 -259
  243. package/dist/src/interpreter/components/logic/LogicResolver.d.ts +0 -53
  244. package/dist/src/interpreter/components/logic/LogicResolver.js +0 -484
  245. package/dist/src/interpreter/components/logic/LogicTranslator.d.ts +0 -14
  246. package/dist/src/interpreter/components/logic/LogicTranslator.js +0 -99
  247. package/dist/src/interpreter/components/runtimes/FunctionRuntime.d.ts +0 -12
  248. package/dist/src/interpreter/components/runtimes/FunctionRuntime.js +0 -149
  249. package/dist/src/interpreter/components/runtimes/LazyRuntime.d.ts +0 -19
  250. package/dist/src/interpreter/components/runtimes/LazyRuntime.js +0 -269
  251. package/dist/src/interpreter/components/runtimes/ObjectRuntime.d.ts +0 -35
  252. package/dist/src/interpreter/components/runtimes/ObjectRuntime.js +0 -126
  253. package/dist/src/interpreter/errors.d.ts +0 -19
  254. package/dist/src/interpreter/errors.js +0 -36
  255. package/dist/src/interpreter/index.d.ts +0 -24
  256. package/dist/src/interpreter/index.js +0 -41
  257. package/dist/src/interpreter/trampoline.d.ts +0 -17
  258. package/dist/src/interpreter/trampoline.js +0 -38
  259. package/dist/src/interpreter/utils.d.ts +0 -11
  260. package/dist/src/interpreter/utils.js +0 -65
  261. package/dist/src/tester/index.d.ts +0 -25
  262. package/dist/src/tester/index.js +0 -113
  263. package/dist/src/utils/helpers.d.ts +0 -13
  264. package/dist/src/utils/helpers.js +0 -52
  265. package/src/interpreter/components/Visitor.ts +0 -1065
  266. package/src/interpreter/trampoline.ts +0 -71
package/.mocharc.json CHANGED
@@ -1,4 +1,4 @@
1
- {
2
- "extension": ["ts"],
3
- "spec": "tests/**/*.spec.ts"
1
+ {
2
+ "extension": ["ts"],
3
+ "spec": "tests/**/*.spec.ts"
4
4
  }
package/CHANGELOG.md CHANGED
@@ -1,60 +1,121 @@
1
- ## 0.2.2 (2026-05-01)
2
-
3
- ### 🩹 Fixes
4
-
5
- - **yukigo:** MulangAdapter handle v1 and v2 inspections ([872558f](https://github.com/miyukiproject/yukigo/commit/872558f))
1
+ ## 0.3.1 (2026-08-01)
6
2
 
7
3
  ### 🧱 Updated Dependencies
8
4
 
9
- - Updated yukigo-ast to 0.2.1
5
+ - Updated yukigo-ast to 0.3.1
10
6
 
11
- ### ❤️ Thank You
12
-
13
- - noiseArch
14
-
15
- ## 0.2.1 (2026-05-01)
16
-
17
- ### 🩹 Fixes
18
-
19
- - **yukigo:** MulangAdapter handle v1 and v2 inspections ([872558f](https://github.com/miyukiproject/yukigo/commit/872558f))
20
-
21
- ### 🧱 Updated Dependencies
22
-
23
- - Updated yukigo-ast to 0.2.0
24
-
25
- ### ❤️ Thank You
26
-
27
- - noiseArch
28
-
29
- ## 0.2.0 (2026-04-11)
7
+ ## 0.3.0 (2026-08-01)
30
8
 
31
9
  ### 🚀 Features
32
10
 
33
- - **yukigo:** agrego `clone` a `RuntimeContext` para clonar el entorno ([ee8e0af](https://github.com/miyukiproject/yukigo/commit/ee8e0af))
11
+ - Interpreter NativeBody support & YukigoHooks ([0b854b4](https://github.com/miyukiproject/yukigo/commit/0b854b4))
12
+ - **interpreter:** implement semantic error handling and stack traces ([b61768f](https://github.com/miyukiproject/yukigo/commit/b61768f))
13
+ - **interpreter:** integrate Kernel as the primary execution engine ([503af3d](https://github.com/miyukiproject/yukigo/commit/503af3d))
14
+ - **interpreter:** introduce YukigoKernel and command-based infrastructure ([9380892](https://github.com/miyukiproject/yukigo/commit/9380892))
15
+ - **yukigo:** implement and test YukigoKernel ([3d42ac4](https://github.com/miyukiproject/yukigo/commit/3d42ac4))
34
16
 
35
17
  ### 🩹 Fixes
36
18
 
37
- - **yukigo:** permitir a las inspections tener args undefined ([4f36ebe](https://github.com/miyukiproject/yukigo/commit/4f36ebe))
38
- - **yukigo:** Evaluar `Equal` y `NotEqual` fuera de `processBinary` ([31eca15](https://github.com/miyukiproject/yukigo/commit/31eca15))
39
- - **yukigo:** delegue logica de deepEqual a LazyRuntime ([8496113](https://github.com/miyukiproject/yukigo/commit/8496113))
40
- - **yukigo:** evaluateConcatLazy permite eager y lazy evaluation ([3faf646](https://github.com/miyukiproject/yukigo/commit/3faf646))
41
- - **yukigo:** corrijo `isEqual` para que compare strings con listas ([d6225c9](https://github.com/miyukiproject/yukigo/commit/d6225c9))
42
- - **yukigo:** corrijo manejo de entorno en `applyArguments` y `visitApplication` ([5c7ab1f](https://github.com/miyukiproject/yukigo/commit/5c7ab1f))
43
- - **yukigo:** capturar correctamente el entorno en `evaluateCons` ([a1bc7a4](https://github.com/miyukiproject/yukigo/commit/a1bc7a4))
44
- - **yukigo:** `popEnv` no tiene que esperar el `env` por parametro ([575bacf](https://github.com/miyukiproject/yukigo/commit/575bacf))
45
- - **yukigo:** agrego metodo visitTypeCast faltante ([61c9984](https://github.com/miyukiproject/yukigo/commit/61c9984))
19
+ - **yukigo-e2e:** fixes to pass E2E tests ([02d895f](https://github.com/miyukiproject/yukigo/commit/02d895f))
20
+ - **yukigo:** allow concatenation with Plus operator ([7799416](https://github.com/miyukiproject/yukigo/commit/7799416))
21
+ - **yukigo:** fix circular dependency ([64534a8](https://github.com/miyukiproject/yukigo/commit/64534a8))
22
+ - **yukigo:** failed test didnt throw bc now it handles 1 + "a" ([23ebeb6](https://github.com/miyukiproject/yukigo/commit/23ebeb6))
23
+ - **yukigo:** zero-arity functions and Wollok bugs ([995dad4](https://github.com/miyukiproject/yukigo/commit/995dad4))
24
+ - **yukigo:** ObjectRuntime error should return RaiseCommand not FailCommand ([ccb31fa](https://github.com/miyukiproject/yukigo/commit/ccb31fa))
25
+ - **yukigo:** method registration with arity to allow overload ([8ffcb36](https://github.com/miyukiproject/yukigo/commit/8ffcb36))
26
+ - TypeSignature is not a Binding ([13c2c5a](https://github.com/miyukiproject/yukigo/commit/13c2c5a))
27
+ - **yukigo:** support If and Call nodes in LogicEngine ([a0f4086](https://github.com/miyukiproject/yukigo/commit/a0f4086))
28
+ - **yukigo:** fixed functional tester was evaluating logic tests ([914310e](https://github.com/miyukiproject/yukigo/commit/914310e))
29
+ - **yukigo:** solved scope leak at logical binary operations ([8779899](https://github.com/miyukiproject/yukigo/commit/8779899))
30
+ - ToString operator ([f5284ab](https://github.com/miyukiproject/yukigo/commit/f5284ab))
31
+ - **yukigo:** fix pattern matching in FunctionRuntime ([467cdf7](https://github.com/miyukiproject/yukigo/commit/467cdf7))
32
+ - **yukigo:** fix bitwise negation ([b13ef4d](https://github.com/miyukiproject/yukigo/commit/b13ef4d))
33
+ - **yukigo:** fix asynchronous logic unification and parameter resolution ([e467068](https://github.com/miyukiproject/yukigo/commit/e467068))
34
+ - **yukigo:** arreglo operaciones y sustitucion logica ([c95f33f](https://github.com/miyukiproject/yukigo/commit/c95f33f))
35
+ - fix parsers grammar compilation to export to .cjs ([ef59727](https://github.com/miyukiproject/yukigo/commit/ef59727))
36
+ - **yukigo:** fix tests to reflect correct representations ([76b1512](https://github.com/miyukiproject/yukigo/commit/76b1512))
37
+ - **yukigo:** fix Visitor and LazyRuntime to use new correct methods from context ([0eb9168](https://github.com/miyukiproject/yukigo/commit/0eb9168))
38
+ - **yukigo:** arreglos en logicengine ([0604555](https://github.com/miyukiproject/yukigo/commit/0604555))
39
+ - **yukigo:** fix mini error in oop test ([b9fd07e](https://github.com/miyukiproject/yukigo/commit/b9fd07e))
40
+ - **yukigo:** removed unwanted error handling ([0d1ff15](https://github.com/miyukiproject/yukigo/commit/0d1ff15))
41
+ - **yukigo:** replace instanceof with .is method in analyzer ([d953413](https://github.com/miyukiproject/yukigo/commit/d953413))
42
+ - **yukigo:** add InterpreterConfig as export ([280146c](https://github.com/miyukiproject/yukigo/commit/280146c))
46
43
 
47
44
  ### 🧱 Updated Dependencies
48
45
 
49
- - Updated yukigo-ast to 0.2.0
46
+ - Updated yukigo-ast to 0.3.0
50
47
 
51
48
  ### ❤️ Thank You
52
49
 
53
50
  - noiseArch
54
51
 
55
- ## 0.1.0 (2025-12-09)
56
-
57
- ### 🧱 Updated Dependencies
58
-
59
- - Updated yukigo-prolog-parser to 0.1.0
52
+ ## 0.2.3 (2026-05-02)
53
+
54
+ ### 🩹 Fixes
55
+
56
+ - **yukigo:** fix bugs on MulangAdapter ([7fc193d](https://github.com/miyukiproject/yukigo/commit/7fc193d))
57
+
58
+ ### ❤️ Thank You
59
+
60
+ - noiseArch
61
+
62
+ ## 0.2.2 (2026-05-01)
63
+
64
+ ### 🩹 Fixes
65
+
66
+ - **yukigo:** MulangAdapter handle v1 and v2 inspections ([872558f](https://github.com/miyukiproject/yukigo/commit/872558f))
67
+
68
+ ### 🧱 Updated Dependencies
69
+
70
+ - Updated yukigo-ast to 0.2.1
71
+
72
+ ### ❤️ Thank You
73
+
74
+ - noiseArch
75
+
76
+ ## 0.2.1 (2026-05-01)
77
+
78
+ ### 🩹 Fixes
79
+
80
+ - **yukigo:** MulangAdapter handle v1 and v2 inspections ([872558f](https://github.com/miyukiproject/yukigo/commit/872558f))
81
+
82
+ ### 🧱 Updated Dependencies
83
+
84
+ - Updated yukigo-ast to 0.2.0
85
+
86
+ ### ❤️ Thank You
87
+
88
+ - noiseArch
89
+
90
+ ## 0.2.0 (2026-04-11)
91
+
92
+ ### 🚀 Features
93
+
94
+ - **yukigo:** agrego `clone` a `RuntimeContext` para clonar el entorno ([ee8e0af](https://github.com/miyukiproject/yukigo/commit/ee8e0af))
95
+
96
+ ### 🩹 Fixes
97
+
98
+ - **yukigo:** permitir a las inspections tener args undefined ([4f36ebe](https://github.com/miyukiproject/yukigo/commit/4f36ebe))
99
+ - **yukigo:** Evaluar `Equal` y `NotEqual` fuera de `processBinary` ([31eca15](https://github.com/miyukiproject/yukigo/commit/31eca15))
100
+ - **yukigo:** delegue logica de deepEqual a LazyRuntime ([8496113](https://github.com/miyukiproject/yukigo/commit/8496113))
101
+ - **yukigo:** evaluateConcatLazy permite eager y lazy evaluation ([3faf646](https://github.com/miyukiproject/yukigo/commit/3faf646))
102
+ - **yukigo:** corrijo `isEqual` para que compare strings con listas ([d6225c9](https://github.com/miyukiproject/yukigo/commit/d6225c9))
103
+ - **yukigo:** corrijo manejo de entorno en `applyArguments` y `visitApplication` ([5c7ab1f](https://github.com/miyukiproject/yukigo/commit/5c7ab1f))
104
+ - **yukigo:** capturar correctamente el entorno en `evaluateCons` ([a1bc7a4](https://github.com/miyukiproject/yukigo/commit/a1bc7a4))
105
+ - **yukigo:** `popEnv` no tiene que esperar el `env` por parametro ([575bacf](https://github.com/miyukiproject/yukigo/commit/575bacf))
106
+ - **yukigo:** agrego metodo visitTypeCast faltante ([61c9984](https://github.com/miyukiproject/yukigo/commit/61c9984))
107
+
108
+ ### 🧱 Updated Dependencies
109
+
110
+ - Updated yukigo-ast to 0.2.0
111
+
112
+ ### ❤️ Thank You
113
+
114
+ - noiseArch
115
+
116
+ ## 0.1.0 (2025-12-09)
117
+
118
+ ### 🧱 Updated Dependencies
119
+
120
+ - Updated yukigo-prolog-parser to 0.1.0
60
121
  - Updated yukigo-ast to 0.1.0
package/README.md CHANGED
@@ -1,193 +1,193 @@
1
- # ❄️ Yukigo
2
- A universal, multi-language, multi-paradigm code analyzer highly inspired in [mulang](https://github.com/mumuki/mulang)
3
-
4
- ## Components
5
-
6
- ### **Abstract Semantic Tree:**
7
-
8
- This is the intermediate representation of any language. Allows us to analyse the semantics of the code independently of the paradigm or the language.
9
-
10
- ### **Analyzer:**
11
-
12
- The Analyzer is the component that traverses the AST and runs the specified inspections.
13
-
14
- ### **Interpreter:**
15
-
16
- The Interpreter is the component that evaluates provided Expression nodes and returns the resultant PrimitiveValue
17
-
18
- # Usage
19
-
20
- ## Installation
21
-
22
- We will be using Haskell as the target language in this example.
23
-
24
- ```
25
- npm install yukigo yukigo-haskell-parser
26
- ```
27
-
28
- or
29
-
30
- ```
31
- yarn add yukigo yukigo-haskell-parser
32
- ```
33
-
34
- ## Example
35
-
36
- ```ts
37
- import { Analyzer } from "yukigo";
38
- import { YukigoHaskellParser } from "yukigo-haskell-parser";
39
-
40
- const code = "doble num = num * 2";
41
- const expectations = [
42
- {
43
- inspection: "HasBinding",
44
- args: { name: "minimoEntre" },
45
- expected: false,
46
- },
47
- {
48
- inspection: "HasBinding",
49
- args: { name: "doble" },
50
- expected: true,
51
- },
52
- ];
53
-
54
- const parser = new YukigoHaskellParser();
55
- const ast = parser.parse(code);
56
-
57
- const analyzer = new ASTAnalyzer(ast);
58
- const result = analyzer.analyse(expectations);
59
-
60
- console.log(results);
61
- // [
62
- // {
63
- // rule: {
64
- // inspection: "HasBinding",
65
- // args: { name: "minimoEntre" },
66
- // expected: false,
67
- // },
68
- // passed: true,
69
- // actual: false,
70
- // },
71
- // {
72
- // rule: {
73
- // inspection: "HasBinding",
74
- // args: { name: "doble" },
75
- // expected: true,
76
- // },
77
- // passed: true,
78
- // actual: true,
79
- // },
80
- // ];
81
- ```
82
-
83
- ## Example with Mulang's Inspections (in a YAML file)
84
-
85
- ```ts
86
- import { Analyzer, translateMulangToInspectionRules } from "yukigo";
87
- import { YukigoHaskellParser } from "yukigo-haskell-parser";
88
-
89
- const code = `
90
- squareList :: [Int] -> [Int]
91
- squareList xs = map (\n -> n * n) xs
92
-
93
- square :: Int -> Int
94
- square n = n * n
95
-
96
- squareList2 :: [Int] -> [Int]
97
- squareList2 = map square
98
- `;
99
-
100
- // Assuming the expectations are in a yaml file. Implement a way to load the actual file.
101
- const mulangInspections = `
102
- expectations:
103
- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
104
- binding: squareList
105
- inspection: HasBinding
106
- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
107
- binding: squareList
108
- inspection: HasLambdaExpression
109
- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
110
- binding: square
111
- inspection: HasArithmetic
112
- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
113
- binding: doble
114
- inspection: Not:HasBinding
115
- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
116
- binding: square
117
- inspection: Uses:n
118
- - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
119
- binding: squareList2
120
- inspection: Uses:map
121
- `;
122
-
123
- const expectations = translateMulangToInspectionRules(mulangInspections);
124
-
125
- const parser = new YukigoHaskellParser();
126
- const ast = parser.parse(code);
127
-
128
- const analyzer = new Analyzer(ast);
129
- const result = analyzer.analyse(expectations);
130
-
131
- console.log(results);
132
- // [
133
- // {
134
- // rule: { inspection: "HasBinding", args: [Object], expected: true },
135
- // passed: true,
136
- // actual: true,
137
- // },
138
- // {
139
- // rule: {
140
- // inspection: "HasLambdaExpression",
141
- // args: [Object],
142
- // expected: true,
143
- // },
144
- // passed: true,
145
- // actual: true,
146
- // },
147
- // {
148
- // rule: { inspection: "HasArithmetic", args: [Object], expected: true },
149
- // passed: true,
150
- // actual: true,
151
- // },
152
- // {
153
- // rule: { inspection: "HasBinding", args: [Object], expected: false },
154
- // passed: true,
155
- // actual: false,
156
- // },
157
- // {
158
- // rule: { inspection: "Uses", args: [Object], expected: true },
159
- // passed: true,
160
- // actual: true,
161
- // },
162
- // {
163
- // rule: { inspection: "Uses", args: [Object], expected: true },
164
- // passed: true,
165
- // actual: true,
166
- // },
167
- // ];
168
- ```
169
-
170
- # Relevant tools
171
- - yukigo-ast: A library of AST node definitions and utilities for making yukigo parsers
172
-
173
- ## Tools
174
- - [CLI](https://github.com/noiseArch/yukigo-cli)
175
- - create-yukigo-parser: A scaffolding tool to quickstart a yukigo parser with recommended configuration
176
-
177
- ## Parsers
178
- - Haskell
179
- - Prolog
180
- - Wollok
181
-
182
- # How to make a parser
183
-
184
- A yukigo's parser is a class that implements the interface `YukigoParser` which exposes a public method called `parse` and an `errors` array like this:
185
- ```ts
186
- errors: string[];
187
- parse: (code: string) => AST;
188
- ```
189
-
190
- The package `yukigo-ast` has all the current supported AST nodes.
191
- For the grammar, you can use a tool like Jison or Nearley.
192
-
193
- Here's a [tutorial](https://miyukiproject.github.io/yukigo/guides/making-a-parser.html) for implementing a small custom language.
1
+ # ❄️ Yukigo
2
+ A universal, multi-language, multi-paradigm code analyzer highly inspired in [mulang](https://github.com/mumuki/mulang)
3
+
4
+ ## Components
5
+
6
+ ### **Abstract Semantic Tree:**
7
+
8
+ This is the intermediate representation of any language. Allows us to analyse the semantics of the code independently of the paradigm or the language.
9
+
10
+ ### **Analyzer:**
11
+
12
+ The Analyzer is the component that traverses the AST and runs the specified inspections.
13
+
14
+ ### **Interpreter:**
15
+
16
+ The Interpreter is the component that evaluates provided Expression nodes and returns the resultant PrimitiveValue
17
+
18
+ # Usage
19
+
20
+ ## Installation
21
+
22
+ We will be using Haskell as the target language in this example.
23
+
24
+ ```
25
+ npm install yukigo yukigo-haskell-parser
26
+ ```
27
+
28
+ or
29
+
30
+ ```
31
+ yarn add yukigo yukigo-haskell-parser
32
+ ```
33
+
34
+ ## Example
35
+
36
+ ```ts
37
+ import { Analyzer } from "yukigo";
38
+ import { YukigoHaskellParser } from "yukigo-haskell-parser";
39
+
40
+ const code = "doble num = num * 2";
41
+ const expectations = [
42
+ {
43
+ inspection: "HasBinding",
44
+ args: { name: "minimoEntre" },
45
+ expected: false,
46
+ },
47
+ {
48
+ inspection: "HasBinding",
49
+ args: { name: "doble" },
50
+ expected: true,
51
+ },
52
+ ];
53
+
54
+ const parser = new YukigoHaskellParser();
55
+ const ast = parser.parse(code);
56
+
57
+ const analyzer = new ASTAnalyzer(ast);
58
+ const result = analyzer.analyse(expectations);
59
+
60
+ console.log(results);
61
+ // [
62
+ // {
63
+ // rule: {
64
+ // inspection: "HasBinding",
65
+ // args: { name: "minimoEntre" },
66
+ // expected: false,
67
+ // },
68
+ // passed: true,
69
+ // actual: false,
70
+ // },
71
+ // {
72
+ // rule: {
73
+ // inspection: "HasBinding",
74
+ // args: { name: "doble" },
75
+ // expected: true,
76
+ // },
77
+ // passed: true,
78
+ // actual: true,
79
+ // },
80
+ // ];
81
+ ```
82
+
83
+ ## Example with Mulang's Inspections (in a YAML file)
84
+
85
+ ```ts
86
+ import { Analyzer, translateMulangToInspectionRules } from "yukigo";
87
+ import { YukigoHaskellParser } from "yukigo-haskell-parser";
88
+
89
+ const code = `
90
+ squareList :: [Int] -> [Int]
91
+ squareList xs = map (\n -> n * n) xs
92
+
93
+ square :: Int -> Int
94
+ square n = n * n
95
+
96
+ squareList2 :: [Int] -> [Int]
97
+ squareList2 = map square
98
+ `;
99
+
100
+ // Assuming the expectations are in a yaml file. Implement a way to load the actual file.
101
+ const mulangInspections = `
102
+ expectations:
103
+ - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
104
+ binding: squareList
105
+ inspection: HasBinding
106
+ - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
107
+ binding: squareList
108
+ inspection: HasLambdaExpression
109
+ - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
110
+ binding: square
111
+ inspection: HasArithmetic
112
+ - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
113
+ binding: doble
114
+ inspection: Not:HasBinding
115
+ - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
116
+ binding: square
117
+ inspection: Uses:n
118
+ - !ruby/hash:ActiveSupport::HashWithIndifferentAccess
119
+ binding: squareList2
120
+ inspection: Uses:map
121
+ `;
122
+
123
+ const expectations = translateMulangToInspectionRules(mulangInspections);
124
+
125
+ const parser = new YukigoHaskellParser();
126
+ const ast = parser.parse(code);
127
+
128
+ const analyzer = new Analyzer(ast);
129
+ const result = analyzer.analyse(expectations);
130
+
131
+ console.log(results);
132
+ // [
133
+ // {
134
+ // rule: { inspection: "HasBinding", args: [Object], expected: true },
135
+ // passed: true,
136
+ // actual: true,
137
+ // },
138
+ // {
139
+ // rule: {
140
+ // inspection: "HasLambdaExpression",
141
+ // args: [Object],
142
+ // expected: true,
143
+ // },
144
+ // passed: true,
145
+ // actual: true,
146
+ // },
147
+ // {
148
+ // rule: { inspection: "HasArithmetic", args: [Object], expected: true },
149
+ // passed: true,
150
+ // actual: true,
151
+ // },
152
+ // {
153
+ // rule: { inspection: "HasBinding", args: [Object], expected: false },
154
+ // passed: true,
155
+ // actual: false,
156
+ // },
157
+ // {
158
+ // rule: { inspection: "Uses", args: [Object], expected: true },
159
+ // passed: true,
160
+ // actual: true,
161
+ // },
162
+ // {
163
+ // rule: { inspection: "Uses", args: [Object], expected: true },
164
+ // passed: true,
165
+ // actual: true,
166
+ // },
167
+ // ];
168
+ ```
169
+
170
+ # Relevant tools
171
+ - yukigo-ast: A library of AST node definitions and utilities for making yukigo parsers
172
+
173
+ ## Tools
174
+ - [CLI](https://github.com/noiseArch/yukigo-cli)
175
+ - create-yukigo-parser: A scaffolding tool to quickstart a yukigo parser with recommended configuration
176
+
177
+ ## Parsers
178
+ - Haskell
179
+ - Prolog
180
+ - Wollok
181
+
182
+ # How to make a parser
183
+
184
+ A yukigo's parser is a class that implements the interface `YukigoParser` which exposes a public method called `parse` and an `errors` array like this:
185
+ ```ts
186
+ errors: string[];
187
+ parse: (code: string) => AST;
188
+ ```
189
+
190
+ The package `yukigo-ast` has all the current supported AST nodes.
191
+ For the grammar, you can use a tool like Jison or Nearley.
192
+
193
+ Here's a [tutorial](https://miyukiproject.github.io/yukigo/guides/making-a-parser.html) for implementing a small custom language.
@@ -25,5 +25,6 @@ export declare class GraphBuilder extends TraverseVisitor {
25
25
  visitApplication(node: Application): void;
26
26
  visitNew(node: New): void;
27
27
  visitExist(node: Exist): void;
28
+ fallback(node: ASTNode): void;
28
29
  }
29
30
  export {};
@@ -79,7 +79,7 @@ export class GraphBuilder extends TraverseVisitor {
79
79
  if (!this.scope)
80
80
  return;
81
81
  const arr = this.calls.get(this.scope) || [];
82
- if (node.functionExpr instanceof SymbolPrimitive)
82
+ if (node.functionExpr.is(SymbolPrimitive))
83
83
  this.calls.set(this.scope, [node.functionExpr.value, ...arr]);
84
84
  else
85
85
  node.functionExpr.accept(this);
@@ -96,4 +96,5 @@ export class GraphBuilder extends TraverseVisitor {
96
96
  const arr = this.calls.get(this.scope) || [];
97
97
  this.calls.set(this.scope, [node.identifier.value, ...arr]);
98
98
  }
99
+ fallback(node) { }
99
100
  }
@@ -6,18 +6,11 @@ export type AnalysisResult = {
6
6
  actual: boolean;
7
7
  error?: string;
8
8
  };
9
- export type TargetSuffix = "named" | "like" | "except";
10
- export type InspectionMatcher = {
11
- type: string;
12
- value?: string;
13
- };
14
9
  export type InspectionRule = {
15
10
  inspection: string;
16
11
  binding?: string;
17
12
  args?: string[];
18
13
  expected: boolean;
19
- targetSuffix?: TargetSuffix;
20
- matcher?: InspectionMatcher;
21
14
  };
22
15
  export declare const DefaultInspectionSet: InspectionMap;
23
16
  export declare const DefaultSmellsSet: InspectionMap;
@@ -104,7 +104,7 @@ export class Analyzer {
104
104
  const visited = new Set();
105
105
  while (workList.length > 0) {
106
106
  const currentBinding = workList.shift();
107
- if (visited.has(currentBinding))
107
+ if (!currentBinding || visited.has(currentBinding))
108
108
  continue;
109
109
  visited.add(currentBinding);
110
110
  const node = defs.get(currentBinding);
@@ -117,7 +117,7 @@ export class Analyzer {
117
117
  }
118
118
  }
119
119
  let actual = false;
120
- let error;
120
+ let error = undefined;
121
121
  // Execution Loop
122
122
  const isGlobalVisitor = !rule.binding || rule.binding === "*";
123
123
  const normalizedBinding = isGlobalVisitor ? undefined : rule.binding;
@@ -125,7 +125,7 @@ export class Analyzer {
125
125
  const visitor = new InspectionClass(...args, normalizedBinding);
126
126
  for (const { node, binding } of targets) {
127
127
  try {
128
- if (!isGlobalVisitor && visitor.setBinding) {
128
+ if (!isGlobalVisitor && visitor.setBinding && binding) {
129
129
  visitor.setBinding(binding);
130
130
  }
131
131
  node.accept(visitor);
@@ -14,7 +14,7 @@ export declare class UsesComprehension extends ScopedVisitor {
14
14
  }
15
15
  export declare class UsesGuards extends ScopedVisitor {
16
16
  constructor(scope?: string);
17
- visitGuardedBody(node: Yu.GuardedBody): void;
17
+ visitGuardedExpression(node: Yu.GuardedExpression): void;
18
18
  }
19
19
  export declare class UsesOtherwise extends ScopedVisitor {
20
20
  constructor(scope?: string);
@@ -46,7 +46,7 @@ let UsesGuards = class UsesGuards extends ScopedVisitor {
46
46
  constructor(scope) {
47
47
  super(scope);
48
48
  }
49
- visitGuardedBody(node) {
49
+ visitGuardedExpression(node) {
50
50
  throw new Yu.StopTraversalException();
51
51
  }
52
52
  };