kumi 0.0.26 → 0.0.28

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 (177) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/CLAUDE.md +4 -0
  4. data/README.md +36 -12
  5. data/data/functions/core/arithmetic.yaml +28 -8
  6. data/data/functions/core/boolean.yaml +8 -3
  7. data/data/functions/core/comparison.yaml +12 -4
  8. data/data/functions/core/conversion.yaml +32 -0
  9. data/data/kernels/javascript/core/arithmetic.yaml +6 -2
  10. data/data/kernels/javascript/core/coercion.yaml +20 -0
  11. data/data/kernels/ruby/core/arithmetic.yaml +7 -2
  12. data/data/kernels/ruby/core/coercion.yaml +20 -0
  13. data/docs/ARCHITECTURE.md +277 -0
  14. data/docs/DEVELOPMENT.md +62 -0
  15. data/docs/FUNCTIONS.md +955 -0
  16. data/docs/SYNTAX.md +8 -0
  17. data/docs/VSCODE_EXTENSION.md +114 -0
  18. data/docs/functions-reference.json +1821 -0
  19. data/golden/array_element/expected/schema_ruby.rb +1 -1
  20. data/golden/array_index/expected/lir_00_unoptimized.txt +2 -2
  21. data/golden/array_index/expected/lir_01_hoist_scalar_references.txt +2 -2
  22. data/golden/array_index/expected/lir_02_inlined.txt +2 -2
  23. data/golden/array_index/expected/lir_03_cse.txt +2 -2
  24. data/golden/array_index/expected/lir_04_1_loop_fusion.txt +2 -2
  25. data/golden/array_index/expected/lir_04_loop_invcm.txt +2 -2
  26. data/golden/array_index/expected/lir_06_const_prop.txt +2 -2
  27. data/golden/array_index/expected/schema_ruby.rb +1 -1
  28. data/golden/array_index/expected/snast.txt +2 -2
  29. data/golden/array_operations/expected/lir_00_unoptimized.txt +2 -2
  30. data/golden/array_operations/expected/lir_01_hoist_scalar_references.txt +2 -2
  31. data/golden/array_operations/expected/lir_02_inlined.txt +2 -2
  32. data/golden/array_operations/expected/lir_03_cse.txt +2 -2
  33. data/golden/array_operations/expected/lir_04_1_loop_fusion.txt +2 -2
  34. data/golden/array_operations/expected/lir_04_loop_invcm.txt +2 -2
  35. data/golden/array_operations/expected/lir_06_const_prop.txt +2 -2
  36. data/golden/array_operations/expected/schema_ruby.rb +1 -1
  37. data/golden/array_operations/expected/snast.txt +2 -2
  38. data/golden/cascade_logic/expected/schema_ruby.rb +1 -1
  39. data/golden/chained_fusion/expected/schema_ruby.rb +1 -1
  40. data/golden/decimal_explicit/expected/ast.txt +38 -0
  41. data/golden/decimal_explicit/expected/input_plan.txt +3 -0
  42. data/golden/decimal_explicit/expected/lir_00_unoptimized.txt +30 -0
  43. data/golden/decimal_explicit/expected/lir_01_hoist_scalar_references.txt +30 -0
  44. data/golden/decimal_explicit/expected/lir_02_inlined.txt +44 -0
  45. data/golden/decimal_explicit/expected/lir_03_cse.txt +40 -0
  46. data/golden/decimal_explicit/expected/lir_04_1_loop_fusion.txt +40 -0
  47. data/golden/decimal_explicit/expected/lir_04_loop_invcm.txt +40 -0
  48. data/golden/decimal_explicit/expected/lir_06_const_prop.txt +40 -0
  49. data/golden/decimal_explicit/expected/nast.txt +30 -0
  50. data/golden/decimal_explicit/expected/schema_javascript.mjs +31 -0
  51. data/golden/decimal_explicit/expected/schema_ruby.rb +57 -0
  52. data/golden/decimal_explicit/expected/snast.txt +30 -0
  53. data/golden/decimal_explicit/expected.json +1 -0
  54. data/golden/decimal_explicit/input.json +5 -0
  55. data/golden/decimal_explicit/schema.kumi +14 -0
  56. data/golden/element_arrays/expected/schema_ruby.rb +1 -1
  57. data/golden/empty_and_null_inputs/expected/schema_ruby.rb +1 -1
  58. data/golden/function_overload/expected/schema_ruby.rb +1 -1
  59. data/golden/game_of_life/expected/schema_ruby.rb +1 -1
  60. data/golden/hash_keys/expected/schema_ruby.rb +1 -1
  61. data/golden/hash_value/expected/schema_ruby.rb +1 -1
  62. data/golden/hierarchical_complex/expected/lir_00_unoptimized.txt +3 -3
  63. data/golden/hierarchical_complex/expected/lir_01_hoist_scalar_references.txt +3 -3
  64. data/golden/hierarchical_complex/expected/lir_02_inlined.txt +3 -3
  65. data/golden/hierarchical_complex/expected/lir_03_cse.txt +3 -3
  66. data/golden/hierarchical_complex/expected/lir_04_1_loop_fusion.txt +3 -3
  67. data/golden/hierarchical_complex/expected/lir_04_loop_invcm.txt +3 -3
  68. data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +3 -3
  69. data/golden/hierarchical_complex/expected/schema_ruby.rb +1 -1
  70. data/golden/hierarchical_complex/expected/snast.txt +3 -3
  71. data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +1 -1
  72. data/golden/input_reference/expected/schema_ruby.rb +1 -1
  73. data/golden/interleaved_fusion/expected/lir_00_unoptimized.txt +1 -1
  74. data/golden/interleaved_fusion/expected/lir_01_hoist_scalar_references.txt +1 -1
  75. data/golden/interleaved_fusion/expected/lir_02_inlined.txt +2 -2
  76. data/golden/interleaved_fusion/expected/lir_03_cse.txt +2 -2
  77. data/golden/interleaved_fusion/expected/lir_04_1_loop_fusion.txt +2 -2
  78. data/golden/interleaved_fusion/expected/lir_04_loop_invcm.txt +2 -2
  79. data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +2 -2
  80. data/golden/interleaved_fusion/expected/schema_ruby.rb +1 -1
  81. data/golden/interleaved_fusion/expected/snast.txt +1 -1
  82. data/golden/let_inline/expected/lir_00_unoptimized.txt +2 -2
  83. data/golden/let_inline/expected/lir_01_hoist_scalar_references.txt +2 -2
  84. data/golden/let_inline/expected/lir_02_inlined.txt +6 -6
  85. data/golden/let_inline/expected/lir_03_cse.txt +6 -6
  86. data/golden/let_inline/expected/lir_04_1_loop_fusion.txt +6 -6
  87. data/golden/let_inline/expected/lir_04_loop_invcm.txt +6 -6
  88. data/golden/let_inline/expected/lir_06_const_prop.txt +6 -6
  89. data/golden/let_inline/expected/schema_ruby.rb +1 -1
  90. data/golden/let_inline/expected/snast.txt +2 -2
  91. data/golden/loop_fusion/expected/schema_ruby.rb +1 -1
  92. data/golden/min_reduce_scope/expected/schema_ruby.rb +1 -1
  93. data/golden/mixed_dimensions/expected/schema_ruby.rb +1 -1
  94. data/golden/multirank_hoisting/expected/lir_00_unoptimized.txt +2 -2
  95. data/golden/multirank_hoisting/expected/lir_01_hoist_scalar_references.txt +2 -2
  96. data/golden/multirank_hoisting/expected/lir_02_inlined.txt +7 -7
  97. data/golden/multirank_hoisting/expected/lir_03_cse.txt +7 -7
  98. data/golden/multirank_hoisting/expected/lir_04_1_loop_fusion.txt +7 -7
  99. data/golden/multirank_hoisting/expected/lir_04_loop_invcm.txt +7 -7
  100. data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +7 -7
  101. data/golden/multirank_hoisting/expected/schema_ruby.rb +1 -1
  102. data/golden/multirank_hoisting/expected/snast.txt +2 -2
  103. data/golden/nested_hash/expected/lir_00_unoptimized.txt +1 -1
  104. data/golden/nested_hash/expected/lir_01_hoist_scalar_references.txt +1 -1
  105. data/golden/nested_hash/expected/lir_02_inlined.txt +1 -1
  106. data/golden/nested_hash/expected/lir_03_cse.txt +1 -1
  107. data/golden/nested_hash/expected/lir_04_1_loop_fusion.txt +1 -1
  108. data/golden/nested_hash/expected/lir_04_loop_invcm.txt +1 -1
  109. data/golden/nested_hash/expected/lir_06_const_prop.txt +1 -1
  110. data/golden/nested_hash/expected/schema_ruby.rb +1 -1
  111. data/golden/nested_hash/expected/snast.txt +1 -1
  112. data/golden/reduction_broadcast/expected/schema_ruby.rb +1 -1
  113. data/golden/roll/expected/schema_ruby.rb +1 -1
  114. data/golden/shift/expected/schema_ruby.rb +1 -1
  115. data/golden/shift_2d/expected/schema_ruby.rb +1 -1
  116. data/golden/simple_math/expected/lir_00_unoptimized.txt +2 -2
  117. data/golden/simple_math/expected/lir_01_hoist_scalar_references.txt +2 -2
  118. data/golden/simple_math/expected/lir_02_inlined.txt +2 -2
  119. data/golden/simple_math/expected/lir_03_cse.txt +2 -2
  120. data/golden/simple_math/expected/lir_04_1_loop_fusion.txt +2 -2
  121. data/golden/simple_math/expected/lir_04_loop_invcm.txt +2 -2
  122. data/golden/simple_math/expected/lir_06_const_prop.txt +2 -2
  123. data/golden/simple_math/expected/schema_ruby.rb +1 -1
  124. data/golden/simple_math/expected/snast.txt +2 -2
  125. data/golden/streaming_basics/expected/lir_00_unoptimized.txt +3 -3
  126. data/golden/streaming_basics/expected/lir_01_hoist_scalar_references.txt +3 -3
  127. data/golden/streaming_basics/expected/lir_02_inlined.txt +9 -9
  128. data/golden/streaming_basics/expected/lir_03_cse.txt +7 -7
  129. data/golden/streaming_basics/expected/lir_04_1_loop_fusion.txt +7 -7
  130. data/golden/streaming_basics/expected/lir_04_loop_invcm.txt +7 -7
  131. data/golden/streaming_basics/expected/lir_06_const_prop.txt +7 -7
  132. data/golden/streaming_basics/expected/schema_ruby.rb +1 -1
  133. data/golden/streaming_basics/expected/snast.txt +3 -3
  134. data/golden/tuples/expected/schema_ruby.rb +1 -1
  135. data/golden/tuples_and_arrays/expected/schema_ruby.rb +1 -1
  136. data/golden/us_tax_2024/expected/lir_00_unoptimized.txt +6 -6
  137. data/golden/us_tax_2024/expected/lir_01_hoist_scalar_references.txt +6 -6
  138. data/golden/us_tax_2024/expected/lir_02_inlined.txt +71 -71
  139. data/golden/us_tax_2024/expected/lir_03_cse.txt +43 -43
  140. data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +48 -48
  141. data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +43 -43
  142. data/golden/us_tax_2024/expected/lir_06_const_prop.txt +43 -43
  143. data/golden/us_tax_2024/expected/schema_ruby.rb +1 -1
  144. data/golden/us_tax_2024/expected/snast.txt +6 -6
  145. data/golden/with_constants/expected/schema_ruby.rb +1 -1
  146. data/lib/kumi/configuration.rb +6 -0
  147. data/lib/kumi/core/analyzer/passes/nast_dimensional_analyzer_pass.rb +1 -1
  148. data/lib/kumi/core/error_reporter.rb +1 -1
  149. data/lib/kumi/core/errors.rb +1 -1
  150. data/lib/kumi/core/functions/overload_resolver.rb +57 -11
  151. data/lib/kumi/core/functions/type_categories.rb +44 -0
  152. data/lib/kumi/core/input/type_matcher.rb +8 -1
  153. data/lib/kumi/core/ruby_parser/input_builder.rb +2 -2
  154. data/lib/kumi/core/types/normalizer.rb +1 -0
  155. data/lib/kumi/core/types/validator.rb +2 -2
  156. data/lib/kumi/core/types.rb +2 -2
  157. data/lib/kumi/dev/golden/reporter.rb +9 -0
  158. data/lib/kumi/dev/golden/result.rb +3 -1
  159. data/lib/kumi/dev/golden/runtime_test.rb +25 -0
  160. data/lib/kumi/dev/golden/suite.rb +4 -4
  161. data/lib/kumi/dev/golden/value_normalizer.rb +80 -0
  162. data/lib/kumi/dev/golden.rb +21 -12
  163. data/lib/kumi/doc_generator/formatters/json.rb +39 -0
  164. data/lib/kumi/doc_generator/formatters/markdown.rb +175 -0
  165. data/lib/kumi/doc_generator/loader.rb +37 -0
  166. data/lib/kumi/doc_generator/merger.rb +54 -0
  167. data/lib/kumi/doc_generator.rb +4 -0
  168. data/lib/kumi/frontends/text.rb +33 -5
  169. data/lib/kumi/syntax/location.rb +5 -1
  170. data/lib/kumi/version.rb +1 -1
  171. data/vscode-extension/.gitignore +4 -0
  172. data/vscode-extension/README.md +59 -0
  173. data/vscode-extension/TESTING.md +151 -0
  174. data/vscode-extension/package.json +51 -0
  175. data/vscode-extension/src/extension.ts +295 -0
  176. data/vscode-extension/tsconfig.json +15 -0
  177. metadata +38 -1
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_1cd98cf56c50f763cab5055e1275d07ac58aaee708cbd081d7773ac43c8d9d33
2
+ module Kumi::Compiled::KUMI_c471bb50d63caec69c74f4f90a802a61121c5d8df77d991ce58327c31c003c54
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -11,7 +11,7 @@
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
13
13
  %t10 = load_decl W axes=[x] :: integer
14
- %t11 = call core.mul(%x_i_7, %t10) :: integer
14
+ %t11 = call core.mul:numeric(%x_i_7, %t10) :: integer
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
17
17
  end_loop
@@ -23,7 +23,7 @@
23
23
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
24
24
  %t18 = load_input "x" :: array
25
25
  %t19 = call core.array_size(%t18) :: integer
26
- %t20 = call core.mul(%y_i_17, %t19) :: integer
26
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
27
27
  %t21 = call core.add(%t20, %x_i_15) :: integer
28
28
  yield %t21
29
29
  end_loop
@@ -11,7 +11,7 @@
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
13
13
  %t10 = load_decl W axes=[x] :: integer
14
- %t11 = call core.mul(%x_i_7, %t10) :: integer
14
+ %t11 = call core.mul:numeric(%x_i_7, %t10) :: integer
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
17
17
  end_loop
@@ -23,7 +23,7 @@
23
23
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
24
24
  %t18 = load_input "x" :: array
25
25
  %t19 = call core.array_size(%t18) :: integer
26
- %t20 = call core.mul(%y_i_17, %t19) :: integer
26
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
27
27
  %t21 = call core.add(%t20, %x_i_15) :: integer
28
28
  yield %t21
29
29
  end_loop
@@ -12,7 +12,7 @@
12
12
  %t28 = load_input "x" :: array
13
13
  %t29 = call core.array_size(%x_el_6) :: integer
14
14
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
15
- %t11 = call core.mul(%x_i_7, %t29) :: integer
15
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
16
16
  %t12 = call core.add(%t11, %y_i_9) :: integer
17
17
  yield %t12
18
18
  end_loop
@@ -24,7 +24,7 @@
24
24
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
25
25
  %t18 = load_input "x" :: array
26
26
  %t19 = call core.array_size(%t18) :: integer
27
- %t20 = call core.mul(%y_i_17, %t19) :: integer
27
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
28
28
  %t21 = call core.add(%t20, %x_i_15) :: integer
29
29
  yield %t21
30
30
  end_loop
@@ -11,7 +11,7 @@
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  %t29 = call core.array_size(%x_el_6) :: integer
13
13
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
14
- %t11 = call core.mul(%x_i_7, %t29) :: integer
14
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
17
17
  end_loop
@@ -22,7 +22,7 @@
22
22
  loop x id=L4 in %t13 as el=%x_el_14, idx=%x_i_15
23
23
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
24
24
  %t19 = call core.array_size(%t13) :: integer
25
- %t20 = call core.mul(%y_i_17, %t19) :: integer
25
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
26
26
  %t21 = call core.add(%t20, %x_i_15) :: integer
27
27
  yield %t21
28
28
  end_loop
@@ -11,7 +11,7 @@
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  %t29 = call core.array_size(%x_el_6) :: integer
13
13
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
14
- %t11 = call core.mul(%x_i_7, %t29) :: integer
14
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
17
17
  end_loop
@@ -22,7 +22,7 @@
22
22
  loop x id=L4 in %t13 as el=%x_el_14, idx=%x_i_15
23
23
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
24
24
  %t19 = call core.array_size(%t13) :: integer
25
- %t20 = call core.mul(%y_i_17, %t19) :: integer
25
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
26
26
  %t21 = call core.add(%t20, %x_i_15) :: integer
27
27
  yield %t21
28
28
  end_loop
@@ -10,7 +10,7 @@
10
10
  %t5 = load_input "x" :: array
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  %t29 = call core.array_size(%x_el_6) :: integer
13
- %t11 = call core.mul(%x_i_7, %t29) :: integer
13
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
14
14
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
@@ -22,7 +22,7 @@
22
22
  %t19 = call core.array_size(%t13) :: integer
23
23
  loop x id=L4 in %t13 as el=%x_el_14, idx=%x_i_15
24
24
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
25
- %t20 = call core.mul(%y_i_17, %t19) :: integer
25
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
26
26
  %t21 = call core.add(%t20, %x_i_15) :: integer
27
27
  yield %t21
28
28
  end_loop
@@ -10,7 +10,7 @@
10
10
  %t5 = load_input "x" :: array
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  %t29 = call core.array_size(%x_el_6) :: integer
13
- %t11 = call core.mul(%x_i_7, %t29) :: integer
13
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
14
14
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
@@ -22,7 +22,7 @@
22
22
  %t19 = call core.array_size(%t13) :: integer
23
23
  loop x id=L4 in %t13 as el=%x_el_14, idx=%x_i_15
24
24
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
25
- %t20 = call core.mul(%y_i_17, %t19) :: integer
25
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
26
26
  %t21 = call core.add(%t20, %x_i_15) :: integer
27
27
  yield %t21
28
28
  end_loop
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_f0ed06608ce6a4d5050abd38d6642055bd22c10f7ed1ba5c5b32a1c61c78736d
2
+ module Kumi::Compiled::KUMI_874ab4afa8620b57bf0b29130c4beab47d4b6f3e93de001a63d88e7fe497a308
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -6,7 +6,7 @@
6
6
  ) :: [x] -> integer
7
7
  (VALUE box
8
8
  (Call :core.add
9
- (Call :core.mul
9
+ (Call :core.mul:numeric
10
10
  (IndexRef i input=x.__index(i)) :: [x] -> integer
11
11
  (Ref W) :: [x] -> integer
12
12
  ) :: [x] -> integer
@@ -15,7 +15,7 @@
15
15
  ) :: [x, y] -> integer
16
16
  (VALUE col_major
17
17
  (Call :core.add
18
- (Call :core.mul
18
+ (Call :core.mul:numeric
19
19
  (IndexRef j input=x.y.__index(j)) :: [x, y] -> integer
20
20
  (Call :core.array_size
21
21
  (InputRef x key_chain=[]) :: [] -> array
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  %t11 = const 0.9 :: float
14
14
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
15
15
  %t10 = load_field items_el_8["price"] :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  %t11 = const 0.9 :: float
14
14
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
15
15
  %t10 = load_field items_el_8["price"] :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_98624b0772f11031b22df384c3c7f33db6dd17485e3f9cf2f69c17ad1d79a9d9
2
+ module Kumi::Compiled::KUMI_b08d7f192e1ffb8868072e38be0c03320a56a08950f1fa98a5982614dd5d7a6d
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -1,12 +1,12 @@
1
1
  (SNAST
2
2
  (VALUE subtotals
3
- (Call :core.mul
3
+ (Call :core.mul:numeric
4
4
  (InputRef items.item.price key_chain=[]) :: [items] -> float
5
5
  (InputRef items.item.quantity key_chain=[]) :: [items] -> integer
6
6
  ) :: [items] -> float
7
7
  ) :: [items] -> float
8
8
  (VALUE discounted_price
9
- (Call :core.mul
9
+ (Call :core.mul:numeric
10
10
  (InputRef items.item.price key_chain=[]) :: [items] -> float
11
11
  (Const 0.9) :: [] -> float
12
12
  ) :: [items] -> float
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_a359b484890e040a5fdd419b92800fddad006edffc49f277f28525eef4e3d9bd
2
+ module Kumi::Compiled::KUMI_ea8e631bd824ece5423ddafc69362e81b847190a419fa644cf040bbe81b3c9f6
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_e5b30cb23c39d5d7959274f41cf2d6a7e4ec0016dc7e19c0bef5c08d67ee1933
2
+ module Kumi::Compiled::KUMI_6a70b58297ad4cc11ad823969c665f4a3b1fd2bfd9121ea025c8c5d197e491fe
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -0,0 +1,38 @@
1
+ (Root
2
+ inputs: [
3
+ (InputDeclaration :unit_price :string)
4
+ (InputDeclaration :quantity :integer)
5
+ (InputDeclaration :tax_rate :string)
6
+ ]
7
+ values: [
8
+ (ValueDeclaration :price
9
+ (CallExpression :to_decimal
10
+ (InputReference :unit_price)
11
+ )
12
+ )
13
+ (ValueDeclaration :rate
14
+ (CallExpression :to_decimal
15
+ (InputReference :tax_rate)
16
+ )
17
+ )
18
+ (ValueDeclaration :subtotal
19
+ (CallExpression :multiply
20
+ (DeclarationReference :price)
21
+ (InputReference :quantity)
22
+ )
23
+ )
24
+ (ValueDeclaration :tax_amount
25
+ (CallExpression :multiply
26
+ (DeclarationReference :subtotal)
27
+ (DeclarationReference :rate)
28
+ )
29
+ )
30
+ (ValueDeclaration :total
31
+ (CallExpression :add
32
+ (DeclarationReference :subtotal)
33
+ (DeclarationReference :tax_amount)
34
+ )
35
+ )
36
+ ]
37
+ traits: []
38
+ )
@@ -0,0 +1,3 @@
1
+ unit_price: string
2
+ quantity: integer
3
+ tax_rate: string
@@ -0,0 +1,30 @@
1
+ (LIR
2
+ (Declaration price
3
+ %t1 = load_input "unit_price" :: string
4
+ %t2 = call core.to_decimal(%t1) :: decimal
5
+ yield %t2
6
+ )
7
+ (Declaration rate
8
+ %t3 = load_input "tax_rate" :: string
9
+ %t4 = call core.to_decimal(%t3) :: decimal
10
+ yield %t4
11
+ )
12
+ (Declaration subtotal
13
+ %t5 = load_decl price :: decimal
14
+ %t6 = load_input "quantity" :: integer
15
+ %t7 = call core.mul:numeric(%t5, %t6) :: integer
16
+ yield %t7
17
+ )
18
+ (Declaration tax_amount
19
+ %t8 = load_decl subtotal :: integer
20
+ %t9 = load_decl rate :: decimal
21
+ %t10 = call core.mul:numeric(%t8, %t9) :: integer
22
+ yield %t10
23
+ )
24
+ (Declaration total
25
+ %t11 = load_decl subtotal :: integer
26
+ %t12 = load_decl tax_amount :: integer
27
+ %t13 = call core.add(%t11, %t12) :: integer
28
+ yield %t13
29
+ )
30
+ )
@@ -0,0 +1,30 @@
1
+ (LIR
2
+ (Declaration price
3
+ %t1 = load_input "unit_price" :: string
4
+ %t2 = call core.to_decimal(%t1) :: decimal
5
+ yield %t2
6
+ )
7
+ (Declaration rate
8
+ %t3 = load_input "tax_rate" :: string
9
+ %t4 = call core.to_decimal(%t3) :: decimal
10
+ yield %t4
11
+ )
12
+ (Declaration subtotal
13
+ %t5 = load_decl price :: decimal
14
+ %t6 = load_input "quantity" :: integer
15
+ %t7 = call core.mul:numeric(%t5, %t6) :: integer
16
+ yield %t7
17
+ )
18
+ (Declaration tax_amount
19
+ %t8 = load_decl subtotal :: integer
20
+ %t9 = load_decl rate :: decimal
21
+ %t10 = call core.mul:numeric(%t8, %t9) :: integer
22
+ yield %t10
23
+ )
24
+ (Declaration total
25
+ %t11 = load_decl subtotal :: integer
26
+ %t12 = load_decl tax_amount :: integer
27
+ %t13 = call core.add(%t11, %t12) :: integer
28
+ yield %t13
29
+ )
30
+ )
@@ -0,0 +1,44 @@
1
+ (LIR
2
+ (Declaration price
3
+ %t1 = load_input "unit_price" :: string
4
+ %t2 = call core.to_decimal(%t1) :: decimal
5
+ yield %t2
6
+ )
7
+ (Declaration rate
8
+ %t3 = load_input "tax_rate" :: string
9
+ %t4 = call core.to_decimal(%t3) :: decimal
10
+ yield %t4
11
+ )
12
+ (Declaration subtotal
13
+ %t14 = load_input "unit_price" :: string
14
+ %t15 = call core.to_decimal(%t14) :: decimal
15
+ %t6 = load_input "quantity" :: integer
16
+ %t7 = call core.mul:numeric(%t15, %t6) :: integer
17
+ yield %t7
18
+ )
19
+ (Declaration tax_amount
20
+ %t19 = load_input "unit_price" :: string
21
+ %t20 = call core.to_decimal(%t19) :: decimal
22
+ %t17 = load_input "quantity" :: integer
23
+ %t18 = call core.mul:numeric(%t20, %t17) :: integer
24
+ %t21 = load_input "tax_rate" :: string
25
+ %t22 = call core.to_decimal(%t21) :: decimal
26
+ %t10 = call core.mul:numeric(%t18, %t22) :: integer
27
+ yield %t10
28
+ )
29
+ (Declaration total
30
+ %t26 = load_input "unit_price" :: string
31
+ %t27 = call core.to_decimal(%t26) :: decimal
32
+ %t24 = load_input "quantity" :: integer
33
+ %t25 = call core.mul:numeric(%t27, %t24) :: integer
34
+ %t34 = load_input "unit_price" :: string
35
+ %t35 = call core.to_decimal(%t34) :: decimal
36
+ %t32 = load_input "quantity" :: integer
37
+ %t33 = call core.mul:numeric(%t35, %t32) :: integer
38
+ %t36 = load_input "tax_rate" :: string
39
+ %t37 = call core.to_decimal(%t36) :: decimal
40
+ %t30 = call core.mul:numeric(%t33, %t37) :: integer
41
+ %t13 = call core.add(%t25, %t30) :: integer
42
+ yield %t13
43
+ )
44
+ )
@@ -0,0 +1,40 @@
1
+ (LIR
2
+ (Declaration price
3
+ %t1 = load_input "unit_price" :: string
4
+ %t2 = call core.to_decimal(%t1) :: decimal
5
+ yield %t2
6
+ )
7
+ (Declaration rate
8
+ %t3 = load_input "tax_rate" :: string
9
+ %t4 = call core.to_decimal(%t3) :: decimal
10
+ yield %t4
11
+ )
12
+ (Declaration subtotal
13
+ %t14 = load_input "unit_price" :: string
14
+ %t15 = call core.to_decimal(%t14) :: decimal
15
+ %t6 = load_input "quantity" :: integer
16
+ %t7 = call core.mul:numeric(%t15, %t6) :: integer
17
+ yield %t7
18
+ )
19
+ (Declaration tax_amount
20
+ %t19 = load_input "unit_price" :: string
21
+ %t20 = call core.to_decimal(%t19) :: decimal
22
+ %t17 = load_input "quantity" :: integer
23
+ %t18 = call core.mul:numeric(%t20, %t17) :: integer
24
+ %t21 = load_input "tax_rate" :: string
25
+ %t22 = call core.to_decimal(%t21) :: decimal
26
+ %t10 = call core.mul:numeric(%t18, %t22) :: integer
27
+ yield %t10
28
+ )
29
+ (Declaration total
30
+ %t26 = load_input "unit_price" :: string
31
+ %t27 = call core.to_decimal(%t26) :: decimal
32
+ %t24 = load_input "quantity" :: integer
33
+ %t25 = call core.mul:numeric(%t27, %t24) :: integer
34
+ %t36 = load_input "tax_rate" :: string
35
+ %t37 = call core.to_decimal(%t36) :: decimal
36
+ %t30 = call core.mul:numeric(%t25, %t37) :: integer
37
+ %t13 = call core.add(%t25, %t30) :: integer
38
+ yield %t13
39
+ )
40
+ )
@@ -0,0 +1,40 @@
1
+ (LIR
2
+ (Declaration price
3
+ %t1 = load_input "unit_price" :: string
4
+ %t2 = call core.to_decimal(%t1) :: decimal
5
+ yield %t2
6
+ )
7
+ (Declaration rate
8
+ %t3 = load_input "tax_rate" :: string
9
+ %t4 = call core.to_decimal(%t3) :: decimal
10
+ yield %t4
11
+ )
12
+ (Declaration subtotal
13
+ %t14 = load_input "unit_price" :: string
14
+ %t15 = call core.to_decimal(%t14) :: decimal
15
+ %t6 = load_input "quantity" :: integer
16
+ %t7 = call core.mul:numeric(%t15, %t6) :: integer
17
+ yield %t7
18
+ )
19
+ (Declaration tax_amount
20
+ %t19 = load_input "unit_price" :: string
21
+ %t20 = call core.to_decimal(%t19) :: decimal
22
+ %t17 = load_input "quantity" :: integer
23
+ %t18 = call core.mul:numeric(%t20, %t17) :: integer
24
+ %t21 = load_input "tax_rate" :: string
25
+ %t22 = call core.to_decimal(%t21) :: decimal
26
+ %t10 = call core.mul:numeric(%t18, %t22) :: integer
27
+ yield %t10
28
+ )
29
+ (Declaration total
30
+ %t26 = load_input "unit_price" :: string
31
+ %t27 = call core.to_decimal(%t26) :: decimal
32
+ %t24 = load_input "quantity" :: integer
33
+ %t25 = call core.mul:numeric(%t27, %t24) :: integer
34
+ %t36 = load_input "tax_rate" :: string
35
+ %t37 = call core.to_decimal(%t36) :: decimal
36
+ %t30 = call core.mul:numeric(%t25, %t37) :: integer
37
+ %t13 = call core.add(%t25, %t30) :: integer
38
+ yield %t13
39
+ )
40
+ )
@@ -0,0 +1,40 @@
1
+ (LIR
2
+ (Declaration price
3
+ %t1 = load_input "unit_price" :: string
4
+ %t2 = call core.to_decimal(%t1) :: decimal
5
+ yield %t2
6
+ )
7
+ (Declaration rate
8
+ %t3 = load_input "tax_rate" :: string
9
+ %t4 = call core.to_decimal(%t3) :: decimal
10
+ yield %t4
11
+ )
12
+ (Declaration subtotal
13
+ %t14 = load_input "unit_price" :: string
14
+ %t15 = call core.to_decimal(%t14) :: decimal
15
+ %t6 = load_input "quantity" :: integer
16
+ %t7 = call core.mul:numeric(%t15, %t6) :: integer
17
+ yield %t7
18
+ )
19
+ (Declaration tax_amount
20
+ %t19 = load_input "unit_price" :: string
21
+ %t20 = call core.to_decimal(%t19) :: decimal
22
+ %t17 = load_input "quantity" :: integer
23
+ %t18 = call core.mul:numeric(%t20, %t17) :: integer
24
+ %t21 = load_input "tax_rate" :: string
25
+ %t22 = call core.to_decimal(%t21) :: decimal
26
+ %t10 = call core.mul:numeric(%t18, %t22) :: integer
27
+ yield %t10
28
+ )
29
+ (Declaration total
30
+ %t26 = load_input "unit_price" :: string
31
+ %t27 = call core.to_decimal(%t26) :: decimal
32
+ %t24 = load_input "quantity" :: integer
33
+ %t25 = call core.mul:numeric(%t27, %t24) :: integer
34
+ %t36 = load_input "tax_rate" :: string
35
+ %t37 = call core.to_decimal(%t36) :: decimal
36
+ %t30 = call core.mul:numeric(%t25, %t37) :: integer
37
+ %t13 = call core.add(%t25, %t30) :: integer
38
+ yield %t13
39
+ )
40
+ )
@@ -0,0 +1,40 @@
1
+ (LIR
2
+ (Declaration price
3
+ %t1 = load_input "unit_price" :: string
4
+ %t2 = call core.to_decimal(%t1) :: decimal
5
+ yield %t2
6
+ )
7
+ (Declaration rate
8
+ %t3 = load_input "tax_rate" :: string
9
+ %t4 = call core.to_decimal(%t3) :: decimal
10
+ yield %t4
11
+ )
12
+ (Declaration subtotal
13
+ %t14 = load_input "unit_price" :: string
14
+ %t15 = call core.to_decimal(%t14) :: decimal
15
+ %t6 = load_input "quantity" :: integer
16
+ %t7 = call core.mul:numeric(%t15, %t6) :: integer
17
+ yield %t7
18
+ )
19
+ (Declaration tax_amount
20
+ %t19 = load_input "unit_price" :: string
21
+ %t20 = call core.to_decimal(%t19) :: decimal
22
+ %t17 = load_input "quantity" :: integer
23
+ %t18 = call core.mul:numeric(%t20, %t17) :: integer
24
+ %t21 = load_input "tax_rate" :: string
25
+ %t22 = call core.to_decimal(%t21) :: decimal
26
+ %t10 = call core.mul:numeric(%t18, %t22) :: integer
27
+ yield %t10
28
+ )
29
+ (Declaration total
30
+ %t26 = load_input "unit_price" :: string
31
+ %t27 = call core.to_decimal(%t26) :: decimal
32
+ %t24 = load_input "quantity" :: integer
33
+ %t25 = call core.mul:numeric(%t27, %t24) :: integer
34
+ %t36 = load_input "tax_rate" :: string
35
+ %t37 = call core.to_decimal(%t36) :: decimal
36
+ %t30 = call core.mul:numeric(%t25, %t37) :: integer
37
+ %t13 = call core.add(%t25, %t30) :: integer
38
+ yield %t13
39
+ )
40
+ )