kumi 0.0.23 → 0.0.25
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +2 -2
- data/golden/array_element/expected/schema_ruby.rb +1 -1
- data/golden/array_index/expected/schema_ruby.rb +1 -1
- data/golden/array_operations/expected/schema_ruby.rb +1 -1
- data/golden/cascade_logic/expected/lir_02_inlined.txt +8 -8
- data/golden/cascade_logic/expected/schema_ruby.rb +1 -1
- data/golden/chained_fusion/expected/lir_02_inlined.txt +36 -36
- data/golden/chained_fusion/expected/lir_03_cse.txt +23 -23
- data/golden/chained_fusion/expected/lir_04_1_loop_fusion.txt +25 -25
- data/golden/chained_fusion/expected/lir_04_loop_invcm.txt +23 -23
- data/golden/chained_fusion/expected/lir_06_const_prop.txt +23 -23
- data/golden/chained_fusion/expected/schema_javascript.mjs +23 -23
- data/golden/chained_fusion/expected/schema_ruby.rb +28 -28
- data/golden/element_arrays/expected/schema_ruby.rb +1 -1
- data/golden/empty_and_null_inputs/expected/lir_02_inlined.txt +18 -18
- data/golden/empty_and_null_inputs/expected/lir_03_cse.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_04_1_loop_fusion.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_04_loop_invcm.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_06_const_prop.txt +17 -17
- data/golden/empty_and_null_inputs/expected/schema_javascript.mjs +13 -13
- data/golden/empty_and_null_inputs/expected/schema_ruby.rb +18 -18
- data/golden/game_of_life/expected/lir_00_unoptimized.txt +33 -33
- data/golden/game_of_life/expected/lir_01_hoist_scalar_references.txt +33 -33
- data/golden/game_of_life/expected/lir_02_inlined.txt +1370 -1370
- data/golden/game_of_life/expected/lir_03_cse.txt +448 -448
- data/golden/game_of_life/expected/lir_04_1_loop_fusion.txt +448 -448
- data/golden/game_of_life/expected/lir_04_loop_invcm.txt +448 -448
- data/golden/game_of_life/expected/lir_06_const_prop.txt +448 -448
- data/golden/game_of_life/expected/schema_javascript.mjs +85 -85
- data/golden/game_of_life/expected/schema_ruby.rb +86 -86
- data/golden/hash_keys/expected/schema_ruby.rb +1 -1
- data/golden/hash_keys/schema.kumi +4 -5
- data/golden/hash_value/expected/schema_ruby.rb +1 -1
- data/golden/hierarchical_complex/expected/lir_02_inlined.txt +15 -15
- data/golden/hierarchical_complex/expected/lir_03_cse.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_04_1_loop_fusion.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_04_loop_invcm.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +1 -1
- data/golden/hierarchical_complex/expected/schema_javascript.mjs +1 -1
- data/golden/hierarchical_complex/expected/schema_ruby.rb +2 -2
- data/golden/inline_rename_scope_leak/expected/ast.txt +48 -0
- data/golden/inline_rename_scope_leak/expected/input_plan.txt +10 -0
- data/golden/inline_rename_scope_leak/expected/lir_00_unoptimized.txt +35 -0
- data/golden/inline_rename_scope_leak/expected/lir_01_hoist_scalar_references.txt +35 -0
- data/golden/inline_rename_scope_leak/expected/lir_02_inlined.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_03_cse.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_04_1_loop_fusion.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_04_loop_invcm.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_06_const_prop.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/nast.txt +31 -0
- data/golden/inline_rename_scope_leak/expected/schema_javascript.mjs +51 -0
- data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +82 -0
- data/golden/inline_rename_scope_leak/expected/snast.txt +31 -0
- data/golden/inline_rename_scope_leak/expected.json +7 -0
- data/golden/inline_rename_scope_leak/input.json +4 -0
- data/golden/inline_rename_scope_leak/schema.kumi +24 -0
- data/golden/input_reference/expected/schema_ruby.rb +1 -1
- data/golden/interleaved_fusion/expected/lir_02_inlined.txt +35 -35
- data/golden/interleaved_fusion/expected/lir_03_cse.txt +26 -26
- data/golden/interleaved_fusion/expected/lir_04_1_loop_fusion.txt +27 -26
- data/golden/interleaved_fusion/expected/lir_04_loop_invcm.txt +26 -26
- data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +26 -26
- data/golden/interleaved_fusion/expected/schema_javascript.mjs +23 -23
- data/golden/interleaved_fusion/expected/schema_ruby.rb +29 -29
- data/golden/let_inline/expected/schema_ruby.rb +1 -1
- data/golden/loop_fusion/expected/lir_02_inlined.txt +17 -17
- data/golden/loop_fusion/expected/lir_03_cse.txt +14 -14
- data/golden/loop_fusion/expected/lir_04_1_loop_fusion.txt +14 -14
- data/golden/loop_fusion/expected/lir_04_loop_invcm.txt +14 -14
- data/golden/loop_fusion/expected/lir_06_const_prop.txt +14 -14
- data/golden/loop_fusion/expected/schema_javascript.mjs +12 -12
- data/golden/loop_fusion/expected/schema_ruby.rb +16 -16
- data/golden/min_reduce_scope/expected/schema_ruby.rb +1 -1
- data/golden/mixed_dimensions/expected/lir_02_inlined.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_03_cse.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_04_1_loop_fusion.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_04_loop_invcm.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_06_const_prop.txt +5 -5
- data/golden/mixed_dimensions/expected/schema_javascript.mjs +3 -3
- data/golden/mixed_dimensions/expected/schema_ruby.rb +6 -6
- data/golden/multirank_hoisting/expected/lir_02_inlined.txt +48 -48
- data/golden/multirank_hoisting/expected/lir_03_cse.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_04_1_loop_fusion.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_04_loop_invcm.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +35 -35
- data/golden/multirank_hoisting/expected/schema_javascript.mjs +34 -34
- data/golden/multirank_hoisting/expected/schema_ruby.rb +36 -36
- data/golden/nested_hash/expected/schema_ruby.rb +1 -1
- data/golden/reduction_broadcast/expected/lir_02_inlined.txt +30 -30
- data/golden/reduction_broadcast/expected/lir_03_cse.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_04_1_loop_fusion.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_04_loop_invcm.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_06_const_prop.txt +22 -22
- data/golden/reduction_broadcast/expected/schema_javascript.mjs +18 -18
- data/golden/reduction_broadcast/expected/schema_ruby.rb +23 -23
- data/golden/roll/expected/lir_00_unoptimized.txt +8 -8
- data/golden/roll/expected/lir_01_hoist_scalar_references.txt +8 -8
- data/golden/roll/expected/lir_02_inlined.txt +8 -8
- data/golden/roll/expected/lir_03_cse.txt +8 -8
- data/golden/roll/expected/lir_04_1_loop_fusion.txt +8 -8
- data/golden/roll/expected/lir_04_loop_invcm.txt +8 -8
- data/golden/roll/expected/lir_06_const_prop.txt +8 -8
- data/golden/roll/expected/schema_ruby.rb +1 -1
- data/golden/shift/expected/lir_00_unoptimized.txt +12 -12
- data/golden/shift/expected/lir_01_hoist_scalar_references.txt +12 -12
- data/golden/shift/expected/lir_02_inlined.txt +12 -12
- data/golden/shift/expected/lir_03_cse.txt +12 -12
- data/golden/shift/expected/lir_04_1_loop_fusion.txt +12 -12
- data/golden/shift/expected/lir_04_loop_invcm.txt +12 -12
- data/golden/shift/expected/lir_06_const_prop.txt +12 -12
- data/golden/shift/expected/schema_ruby.rb +1 -1
- data/golden/shift_2d/expected/lir_00_unoptimized.txt +48 -48
- data/golden/shift_2d/expected/lir_01_hoist_scalar_references.txt +48 -48
- data/golden/shift_2d/expected/lir_02_inlined.txt +48 -48
- data/golden/shift_2d/expected/lir_03_cse.txt +48 -48
- data/golden/shift_2d/expected/lir_04_1_loop_fusion.txt +48 -48
- data/golden/shift_2d/expected/lir_04_loop_invcm.txt +48 -48
- data/golden/shift_2d/expected/lir_06_const_prop.txt +48 -48
- data/golden/shift_2d/expected/schema_ruby.rb +1 -1
- data/golden/simple_math/expected/schema_ruby.rb +1 -1
- data/golden/streaming_basics/expected/lir_02_inlined.txt +25 -25
- data/golden/streaming_basics/expected/lir_03_cse.txt +13 -13
- data/golden/streaming_basics/expected/lir_04_1_loop_fusion.txt +13 -13
- data/golden/streaming_basics/expected/lir_04_loop_invcm.txt +13 -13
- data/golden/streaming_basics/expected/lir_06_const_prop.txt +13 -13
- data/golden/streaming_basics/expected/schema_javascript.mjs +13 -13
- data/golden/streaming_basics/expected/schema_ruby.rb +14 -14
- data/golden/tuples/expected/lir_00_unoptimized.txt +4 -4
- data/golden/tuples/expected/lir_01_hoist_scalar_references.txt +4 -4
- data/golden/tuples/expected/lir_02_inlined.txt +4 -4
- data/golden/tuples/expected/lir_03_cse.txt +4 -4
- data/golden/tuples/expected/lir_04_1_loop_fusion.txt +4 -4
- data/golden/tuples/expected/lir_04_loop_invcm.txt +4 -4
- data/golden/tuples/expected/lir_06_const_prop.txt +4 -4
- data/golden/tuples/expected/schema_ruby.rb +1 -1
- data/golden/tuples_and_arrays/expected/lir_00_unoptimized.txt +1 -1
- data/golden/tuples_and_arrays/expected/lir_01_hoist_scalar_references.txt +1 -1
- data/golden/tuples_and_arrays/expected/lir_02_inlined.txt +17 -17
- data/golden/tuples_and_arrays/expected/lir_03_cse.txt +14 -14
- data/golden/tuples_and_arrays/expected/lir_04_1_loop_fusion.txt +14 -14
- data/golden/tuples_and_arrays/expected/lir_04_loop_invcm.txt +14 -14
- data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +14 -14
- data/golden/tuples_and_arrays/expected/schema_javascript.mjs +13 -13
- data/golden/tuples_and_arrays/expected/schema_ruby.rb +14 -14
- data/golden/us_tax_2024/expected/ast.txt +865 -0
- data/golden/us_tax_2024/expected/input_plan.txt +61 -0
- data/golden/us_tax_2024/expected/lir_00_unoptimized.txt +901 -0
- data/golden/us_tax_2024/expected/lir_01_hoist_scalar_references.txt +901 -0
- data/golden/us_tax_2024/expected/lir_02_inlined.txt +5178 -0
- data/golden/us_tax_2024/expected/lir_03_cse.txt +2499 -0
- data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +2519 -0
- data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +2499 -0
- data/golden/us_tax_2024/expected/lir_06_const_prop.txt +2499 -0
- data/golden/us_tax_2024/expected/nast.txt +976 -0
- data/golden/us_tax_2024/expected/schema_javascript.mjs +584 -0
- data/golden/us_tax_2024/expected/schema_ruby.rb +639 -0
- data/golden/us_tax_2024/expected/snast.txt +976 -0
- data/golden/us_tax_2024/expected.json +1 -0
- data/golden/us_tax_2024/input.json +168 -0
- data/golden/us_tax_2024/schema.kumi +203 -0
- data/golden/with_constants/expected/schema_ruby.rb +1 -1
- data/lib/kumi/core/analyzer/passes/lir/inline_declarations_pass.rb +227 -107
- data/lib/kumi/version.rb +1 -1
- metadata +33 -1
@@ -41,11 +41,11 @@
|
|
41
41
|
%t55 = call core.mul(%t53, %t54) :: float
|
42
42
|
%t26 = const 0.9 :: float
|
43
43
|
%t27 = call core.mul(%t55, %t26) :: float
|
44
|
-
%
|
45
|
-
%
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%t29 = select %t51, %t27, %
|
44
|
+
%t56 = load_input "items" :: array
|
45
|
+
%t57 = load_field items_el_22["price"] :: float
|
46
|
+
%t58 = load_field items_el_22["qty"] :: integer
|
47
|
+
%t59 = call core.mul(%t57, %t58) :: float
|
48
|
+
%t29 = select %t51, %t27, %t59 :: float
|
49
49
|
yield %t29
|
50
50
|
end_loop
|
51
51
|
)
|
@@ -63,11 +63,11 @@
|
|
63
63
|
%acc_36 = decl_acc :: float
|
64
64
|
%t37 = load_input "items" :: array
|
65
65
|
loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
|
66
|
-
%
|
67
|
-
%
|
68
|
-
%
|
69
|
-
%
|
70
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
66
|
+
%t60 = load_input "items" :: array
|
67
|
+
%t61 = load_field items_el_38["price"] :: float
|
68
|
+
%t62 = load_field items_el_38["qty"] :: integer
|
69
|
+
%t63 = call core.mul(%t61, %t62) :: float
|
70
|
+
%acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
|
71
71
|
end_loop
|
72
72
|
%t41 = acc_load %acc_36 :: float
|
73
73
|
yield %t41
|
@@ -76,23 +76,23 @@
|
|
76
76
|
%acc_42 = decl_acc :: float
|
77
77
|
%t43 = load_input "items" :: array
|
78
78
|
loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
|
79
|
-
%
|
80
|
-
%t67 = load_input "items" :: array
|
81
|
-
%t68 = load_field items_el_44["price"] :: float
|
82
|
-
%t69 = const 100.0 :: float
|
83
|
-
%t70 = call core.gt(%t68, %t69) :: boolean
|
84
|
-
%t71 = load_input "items" :: array
|
85
|
-
%t72 = load_field items_el_44["price"] :: float
|
86
|
-
%t73 = load_field items_el_44["qty"] :: integer
|
87
|
-
%t74 = call core.mul(%t72, %t73) :: float
|
88
|
-
%t63 = const 0.9 :: float
|
89
|
-
%t64 = call core.mul(%t74, %t63) :: float
|
79
|
+
%t64 = load_input "items" :: array
|
90
80
|
%t71 = load_input "items" :: array
|
91
81
|
%t72 = load_field items_el_44["price"] :: float
|
92
|
-
%t73 =
|
93
|
-
%t74 = call core.
|
94
|
-
%
|
95
|
-
%
|
82
|
+
%t73 = const 100.0 :: float
|
83
|
+
%t74 = call core.gt(%t72, %t73) :: boolean
|
84
|
+
%t75 = load_input "items" :: array
|
85
|
+
%t76 = load_field items_el_44["price"] :: float
|
86
|
+
%t77 = load_field items_el_44["qty"] :: integer
|
87
|
+
%t78 = call core.mul(%t76, %t77) :: float
|
88
|
+
%t67 = const 0.9 :: float
|
89
|
+
%t68 = call core.mul(%t78, %t67) :: float
|
90
|
+
%t79 = load_input "items" :: array
|
91
|
+
%t80 = load_field items_el_44["price"] :: float
|
92
|
+
%t81 = load_field items_el_44["qty"] :: integer
|
93
|
+
%t82 = call core.mul(%t80, %t81) :: float
|
94
|
+
%t70 = select %t74, %t68, %t82 :: float
|
95
|
+
%acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
|
96
96
|
end_loop
|
97
97
|
%t47 = acc_load %acc_42 :: float
|
98
98
|
yield %t47
|
@@ -56,10 +56,10 @@
|
|
56
56
|
%acc_36 = decl_acc :: float
|
57
57
|
%t37 = load_input "items" :: array
|
58
58
|
loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
|
59
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
59
|
+
%t61 = load_field items_el_38["price"] :: float
|
60
|
+
%t62 = load_field items_el_38["qty"] :: integer
|
61
|
+
%t63 = call core.mul(%t61, %t62) :: float
|
62
|
+
%acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
|
63
63
|
end_loop
|
64
64
|
%t41 = acc_load %acc_36 :: float
|
65
65
|
yield %t41
|
@@ -68,15 +68,15 @@
|
|
68
68
|
%acc_42 = decl_acc :: float
|
69
69
|
%t43 = load_input "items" :: array
|
70
70
|
loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%acc_42 = acc_add agg.sum(%acc_42, %
|
71
|
+
%t72 = load_field items_el_44["price"] :: float
|
72
|
+
%t73 = const 100.0 :: float
|
73
|
+
%t77 = load_field items_el_44["qty"] :: integer
|
74
|
+
%t67 = const 0.9 :: float
|
75
|
+
%t74 = call core.gt(%t72, %t73) :: boolean
|
76
|
+
%t78 = call core.mul(%t72, %t77) :: float
|
77
|
+
%t68 = call core.mul(%t78, %t67) :: float
|
78
|
+
%t70 = select %t74, %t68, %t78 :: float
|
79
|
+
%acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
|
80
80
|
end_loop
|
81
81
|
%t47 = acc_load %acc_42 :: float
|
82
82
|
yield %t47
|
@@ -56,10 +56,10 @@
|
|
56
56
|
%acc_36 = decl_acc :: float
|
57
57
|
%t37 = load_input "items" :: array
|
58
58
|
loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
|
59
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
59
|
+
%t61 = load_field items_el_38["price"] :: float
|
60
|
+
%t62 = load_field items_el_38["qty"] :: integer
|
61
|
+
%t63 = call core.mul(%t61, %t62) :: float
|
62
|
+
%acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
|
63
63
|
end_loop
|
64
64
|
%t41 = acc_load %acc_36 :: float
|
65
65
|
yield %t41
|
@@ -68,15 +68,15 @@
|
|
68
68
|
%acc_42 = decl_acc :: float
|
69
69
|
%t43 = load_input "items" :: array
|
70
70
|
loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%acc_42 = acc_add agg.sum(%acc_42, %
|
71
|
+
%t72 = load_field items_el_44["price"] :: float
|
72
|
+
%t73 = const 100.0 :: float
|
73
|
+
%t77 = load_field items_el_44["qty"] :: integer
|
74
|
+
%t67 = const 0.9 :: float
|
75
|
+
%t74 = call core.gt(%t72, %t73) :: boolean
|
76
|
+
%t78 = call core.mul(%t72, %t77) :: float
|
77
|
+
%t68 = call core.mul(%t78, %t67) :: float
|
78
|
+
%t70 = select %t74, %t68, %t78 :: float
|
79
|
+
%acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
|
80
80
|
end_loop
|
81
81
|
%t47 = acc_load %acc_42 :: float
|
82
82
|
yield %t47
|
@@ -56,10 +56,10 @@
|
|
56
56
|
%acc_36 = decl_acc :: float
|
57
57
|
%t37 = load_input "items" :: array
|
58
58
|
loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
|
59
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
59
|
+
%t61 = load_field items_el_38["price"] :: float
|
60
|
+
%t62 = load_field items_el_38["qty"] :: integer
|
61
|
+
%t63 = call core.mul(%t61, %t62) :: float
|
62
|
+
%acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
|
63
63
|
end_loop
|
64
64
|
%t41 = acc_load %acc_36 :: float
|
65
65
|
yield %t41
|
@@ -67,16 +67,16 @@
|
|
67
67
|
(Declaration cart_total_effective
|
68
68
|
%acc_42 = decl_acc :: float
|
69
69
|
%t43 = load_input "items" :: array
|
70
|
-
%
|
71
|
-
%
|
70
|
+
%t73 = const 100.0 :: float
|
71
|
+
%t67 = const 0.9 :: float
|
72
72
|
loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
|
73
|
-
%
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%acc_42 = acc_add agg.sum(%acc_42, %
|
73
|
+
%t72 = load_field items_el_44["price"] :: float
|
74
|
+
%t77 = load_field items_el_44["qty"] :: integer
|
75
|
+
%t74 = call core.gt(%t72, %t73) :: boolean
|
76
|
+
%t78 = call core.mul(%t72, %t77) :: float
|
77
|
+
%t68 = call core.mul(%t78, %t67) :: float
|
78
|
+
%t70 = select %t74, %t68, %t78 :: float
|
79
|
+
%acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
|
80
80
|
end_loop
|
81
81
|
%t47 = acc_load %acc_42 :: float
|
82
82
|
yield %t47
|
@@ -56,10 +56,10 @@
|
|
56
56
|
%acc_36 = decl_acc :: float
|
57
57
|
%t37 = load_input "items" :: array
|
58
58
|
loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
|
59
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
59
|
+
%t61 = load_field items_el_38["price"] :: float
|
60
|
+
%t62 = load_field items_el_38["qty"] :: integer
|
61
|
+
%t63 = call core.mul(%t61, %t62) :: float
|
62
|
+
%acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
|
63
63
|
end_loop
|
64
64
|
%t41 = acc_load %acc_36 :: float
|
65
65
|
yield %t41
|
@@ -67,16 +67,16 @@
|
|
67
67
|
(Declaration cart_total_effective
|
68
68
|
%acc_42 = decl_acc :: float
|
69
69
|
%t43 = load_input "items" :: array
|
70
|
-
%
|
71
|
-
%
|
70
|
+
%t73 = const 100.0 :: float
|
71
|
+
%t67 = const 0.9 :: float
|
72
72
|
loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
|
73
|
-
%
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%acc_42 = acc_add agg.sum(%acc_42, %
|
73
|
+
%t72 = load_field items_el_44["price"] :: float
|
74
|
+
%t77 = load_field items_el_44["qty"] :: integer
|
75
|
+
%t74 = call core.gt(%t72, %t73) :: boolean
|
76
|
+
%t78 = call core.mul(%t72, %t77) :: float
|
77
|
+
%t68 = call core.mul(%t78, %t67) :: float
|
78
|
+
%t70 = select %t74, %t68, %t78 :: float
|
79
|
+
%acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
|
80
80
|
end_loop
|
81
81
|
%t47 = acc_load %acc_42 :: float
|
82
82
|
yield %t47
|
@@ -67,10 +67,10 @@ export function _cart_total(input) {
|
|
67
67
|
let acc_36 = 0.0;
|
68
68
|
let t37 = input["items"];
|
69
69
|
t37.forEach((items_el_38, items_i_39) => {
|
70
|
-
let
|
71
|
-
let
|
72
|
-
let
|
73
|
-
acc_36 +=
|
70
|
+
let t61 = items_el_38["price"];
|
71
|
+
let t62 = items_el_38["qty"];
|
72
|
+
let t63 = t61 * t62;
|
73
|
+
acc_36 += t63;
|
74
74
|
});
|
75
75
|
return acc_36;
|
76
76
|
}
|
@@ -78,16 +78,16 @@ export function _cart_total(input) {
|
|
78
78
|
export function _cart_total_effective(input) {
|
79
79
|
let acc_42 = 0.0;
|
80
80
|
let t43 = input["items"];
|
81
|
-
const
|
82
|
-
const
|
81
|
+
const t73 = 100.0;
|
82
|
+
const t67 = 0.9;
|
83
83
|
t43.forEach((items_el_44, items_i_45) => {
|
84
|
-
let
|
85
|
-
let
|
86
|
-
let
|
87
|
-
let
|
88
|
-
let
|
89
|
-
let
|
90
|
-
acc_42 +=
|
84
|
+
let t72 = items_el_44["price"];
|
85
|
+
let t77 = items_el_44["qty"];
|
86
|
+
let t74 = t72 > t73;
|
87
|
+
let t78 = t72 * t77;
|
88
|
+
let t68 = t78 * t67;
|
89
|
+
let t70 = t74 ? t68 : t78;
|
90
|
+
acc_42 += t70;
|
91
91
|
});
|
92
92
|
return acc_42;
|
93
93
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_e64045903bee1b6a265ef34019b7aa91333ec110e041bb47e8350de13c0fa435
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -100,10 +100,10 @@ module Kumi::Compiled::KUMI_87a945469ff3b51d9ccc0f72444a2b64bd4b4c6abe1edfd45bfd
|
|
100
100
|
acc_36 = 0.0
|
101
101
|
t37 = input["items"] || input[:items]
|
102
102
|
t37.each_with_index do |items_el_38, items_i_39|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
acc_36 +=
|
103
|
+
t61 = items_el_38["price"] || items_el_38[:price]
|
104
|
+
t62 = items_el_38["qty"] || items_el_38[:qty]
|
105
|
+
t63 = t61 * t62
|
106
|
+
acc_36 += t63
|
107
107
|
end
|
108
108
|
acc_36
|
109
109
|
end
|
@@ -111,16 +111,16 @@ module Kumi::Compiled::KUMI_87a945469ff3b51d9ccc0f72444a2b64bd4b4c6abe1edfd45bfd
|
|
111
111
|
def _cart_total_effective(input = @input)
|
112
112
|
acc_42 = 0.0
|
113
113
|
t43 = input["items"] || input[:items]
|
114
|
-
|
115
|
-
|
114
|
+
t73 = 100.0
|
115
|
+
t67 = 0.9
|
116
116
|
t43.each_with_index do |items_el_44, items_i_45|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
acc_42 +=
|
117
|
+
t72 = items_el_44["price"] || items_el_44[:price]
|
118
|
+
t77 = items_el_44["qty"] || items_el_44[:qty]
|
119
|
+
t74 = t72 > t73
|
120
|
+
t78 = t72 * t77
|
121
|
+
t68 = t78 * t67
|
122
|
+
t70 = t74 ? t68 : t78
|
123
|
+
acc_42 += t70
|
124
124
|
end
|
125
125
|
acc_42
|
126
126
|
end
|
@@ -9,7 +9,7 @@
|
|
9
9
|
)
|
10
10
|
(Declaration max_1
|
11
11
|
%t6 = load_decl tuple :: tuple<integer>
|
12
|
-
%t7 =
|
12
|
+
%t7 = fold %t6 fn="agg.max" :: integer
|
13
13
|
yield %t7
|
14
14
|
)
|
15
15
|
(Declaration max_2
|
@@ -19,12 +19,12 @@
|
|
19
19
|
%t11 = load_input "x" :: integer
|
20
20
|
%t12 = const 1000 :: integer
|
21
21
|
%t13 = make_tuple(%t8, %t9, %t10, %t11, %t12) :: tuple<integer>
|
22
|
-
%t14 =
|
22
|
+
%t14 = fold %t13 fn="agg.max" :: integer
|
23
23
|
yield %t14
|
24
24
|
)
|
25
25
|
(Declaration min_1
|
26
26
|
%t15 = load_decl tuple :: tuple<integer>
|
27
|
-
%t16 =
|
27
|
+
%t16 = fold %t15 fn="agg.min" :: integer
|
28
28
|
yield %t16
|
29
29
|
)
|
30
30
|
(Declaration min_2
|
@@ -34,7 +34,7 @@
|
|
34
34
|
%t20 = load_input "x" :: integer
|
35
35
|
%t21 = const -100 :: integer
|
36
36
|
%t22 = make_tuple(%t17, %t18, %t19, %t20, %t21) :: tuple<integer>
|
37
|
-
%t23 =
|
37
|
+
%t23 = fold %t22 fn="agg.min" :: integer
|
38
38
|
yield %t23
|
39
39
|
)
|
40
40
|
)
|
@@ -9,7 +9,7 @@
|
|
9
9
|
)
|
10
10
|
(Declaration max_1
|
11
11
|
%t6 = load_decl tuple :: tuple<integer>
|
12
|
-
%t7 =
|
12
|
+
%t7 = fold %t6 fn="agg.max" :: integer
|
13
13
|
yield %t7
|
14
14
|
)
|
15
15
|
(Declaration max_2
|
@@ -19,12 +19,12 @@
|
|
19
19
|
%t11 = load_input "x" :: integer
|
20
20
|
%t12 = const 1000 :: integer
|
21
21
|
%t13 = make_tuple(%t8, %t9, %t10, %t11, %t12) :: tuple<integer>
|
22
|
-
%t14 =
|
22
|
+
%t14 = fold %t13 fn="agg.max" :: integer
|
23
23
|
yield %t14
|
24
24
|
)
|
25
25
|
(Declaration min_1
|
26
26
|
%t15 = load_decl tuple :: tuple<integer>
|
27
|
-
%t16 =
|
27
|
+
%t16 = fold %t15 fn="agg.min" :: integer
|
28
28
|
yield %t16
|
29
29
|
)
|
30
30
|
(Declaration min_2
|
@@ -34,7 +34,7 @@
|
|
34
34
|
%t20 = load_input "x" :: integer
|
35
35
|
%t21 = const -100 :: integer
|
36
36
|
%t22 = make_tuple(%t17, %t18, %t19, %t20, %t21) :: tuple<integer>
|
37
|
-
%t23 =
|
37
|
+
%t23 = fold %t22 fn="agg.min" :: integer
|
38
38
|
yield %t23
|
39
39
|
)
|
40
40
|
)
|
@@ -13,7 +13,7 @@
|
|
13
13
|
%t26 = const 3 :: integer
|
14
14
|
%t27 = load_input "x" :: integer
|
15
15
|
%t28 = make_tuple(%t24, %t25, %t26, %t27) :: tuple<integer>
|
16
|
-
%t7 =
|
16
|
+
%t7 = fold %t28 fn="agg.max" :: integer
|
17
17
|
yield %t7
|
18
18
|
)
|
19
19
|
(Declaration max_2
|
@@ -23,7 +23,7 @@
|
|
23
23
|
%t11 = load_input "x" :: integer
|
24
24
|
%t12 = const 1000 :: integer
|
25
25
|
%t13 = make_tuple(%t8, %t9, %t10, %t11, %t12) :: tuple<integer>
|
26
|
-
%t14 =
|
26
|
+
%t14 = fold %t13 fn="agg.max" :: integer
|
27
27
|
yield %t14
|
28
28
|
)
|
29
29
|
(Declaration min_1
|
@@ -32,7 +32,7 @@
|
|
32
32
|
%t31 = const 3 :: integer
|
33
33
|
%t32 = load_input "x" :: integer
|
34
34
|
%t33 = make_tuple(%t29, %t30, %t31, %t32) :: tuple<integer>
|
35
|
-
%t16 =
|
35
|
+
%t16 = fold %t33 fn="agg.min" :: integer
|
36
36
|
yield %t16
|
37
37
|
)
|
38
38
|
(Declaration min_2
|
@@ -42,7 +42,7 @@
|
|
42
42
|
%t20 = load_input "x" :: integer
|
43
43
|
%t21 = const -100 :: integer
|
44
44
|
%t22 = make_tuple(%t17, %t18, %t19, %t20, %t21) :: tuple<integer>
|
45
|
-
%t23 =
|
45
|
+
%t23 = fold %t22 fn="agg.min" :: integer
|
46
46
|
yield %t23
|
47
47
|
)
|
48
48
|
)
|
@@ -13,7 +13,7 @@
|
|
13
13
|
%t26 = const 3 :: integer
|
14
14
|
%t27 = load_input "x" :: integer
|
15
15
|
%t28 = make_tuple(%t24, %t25, %t26, %t27) :: tuple<integer>
|
16
|
-
%t7 =
|
16
|
+
%t7 = fold %t28 fn="agg.max" :: integer
|
17
17
|
yield %t7
|
18
18
|
)
|
19
19
|
(Declaration max_2
|
@@ -23,7 +23,7 @@
|
|
23
23
|
%t11 = load_input "x" :: integer
|
24
24
|
%t12 = const 1000 :: integer
|
25
25
|
%t13 = make_tuple(%t8, %t9, %t10, %t11, %t12) :: tuple<integer>
|
26
|
-
%t14 =
|
26
|
+
%t14 = fold %t13 fn="agg.max" :: integer
|
27
27
|
yield %t14
|
28
28
|
)
|
29
29
|
(Declaration min_1
|
@@ -32,7 +32,7 @@
|
|
32
32
|
%t31 = const 3 :: integer
|
33
33
|
%t32 = load_input "x" :: integer
|
34
34
|
%t33 = make_tuple(%t29, %t30, %t31, %t32) :: tuple<integer>
|
35
|
-
%t16 =
|
35
|
+
%t16 = fold %t33 fn="agg.min" :: integer
|
36
36
|
yield %t16
|
37
37
|
)
|
38
38
|
(Declaration min_2
|
@@ -42,7 +42,7 @@
|
|
42
42
|
%t20 = load_input "x" :: integer
|
43
43
|
%t21 = const -100 :: integer
|
44
44
|
%t22 = make_tuple(%t17, %t18, %t19, %t20, %t21) :: tuple<integer>
|
45
|
-
%t23 =
|
45
|
+
%t23 = fold %t22 fn="agg.min" :: integer
|
46
46
|
yield %t23
|
47
47
|
)
|
48
48
|
)
|
@@ -13,7 +13,7 @@
|
|
13
13
|
%t26 = const 3 :: integer
|
14
14
|
%t27 = load_input "x" :: integer
|
15
15
|
%t28 = make_tuple(%t24, %t25, %t26, %t27) :: tuple<integer>
|
16
|
-
%t7 =
|
16
|
+
%t7 = fold %t28 fn="agg.max" :: integer
|
17
17
|
yield %t7
|
18
18
|
)
|
19
19
|
(Declaration max_2
|
@@ -23,7 +23,7 @@
|
|
23
23
|
%t11 = load_input "x" :: integer
|
24
24
|
%t12 = const 1000 :: integer
|
25
25
|
%t13 = make_tuple(%t8, %t9, %t10, %t11, %t12) :: tuple<integer>
|
26
|
-
%t14 =
|
26
|
+
%t14 = fold %t13 fn="agg.max" :: integer
|
27
27
|
yield %t14
|
28
28
|
)
|
29
29
|
(Declaration min_1
|
@@ -32,7 +32,7 @@
|
|
32
32
|
%t31 = const 3 :: integer
|
33
33
|
%t32 = load_input "x" :: integer
|
34
34
|
%t33 = make_tuple(%t29, %t30, %t31, %t32) :: tuple<integer>
|
35
|
-
%t16 =
|
35
|
+
%t16 = fold %t33 fn="agg.min" :: integer
|
36
36
|
yield %t16
|
37
37
|
)
|
38
38
|
(Declaration min_2
|
@@ -42,7 +42,7 @@
|
|
42
42
|
%t20 = load_input "x" :: integer
|
43
43
|
%t21 = const -100 :: integer
|
44
44
|
%t22 = make_tuple(%t17, %t18, %t19, %t20, %t21) :: tuple<integer>
|
45
|
-
%t23 =
|
45
|
+
%t23 = fold %t22 fn="agg.min" :: integer
|
46
46
|
yield %t23
|
47
47
|
)
|
48
48
|
)
|
@@ -13,7 +13,7 @@
|
|
13
13
|
%t26 = const 3 :: integer
|
14
14
|
%t27 = load_input "x" :: integer
|
15
15
|
%t28 = make_tuple(%t24, %t25, %t26, %t27) :: tuple<integer>
|
16
|
-
%t7 =
|
16
|
+
%t7 = fold %t28 fn="agg.max" :: integer
|
17
17
|
yield %t7
|
18
18
|
)
|
19
19
|
(Declaration max_2
|
@@ -23,7 +23,7 @@
|
|
23
23
|
%t11 = load_input "x" :: integer
|
24
24
|
%t12 = const 1000 :: integer
|
25
25
|
%t13 = make_tuple(%t8, %t9, %t10, %t11, %t12) :: tuple<integer>
|
26
|
-
%t14 =
|
26
|
+
%t14 = fold %t13 fn="agg.max" :: integer
|
27
27
|
yield %t14
|
28
28
|
)
|
29
29
|
(Declaration min_1
|
@@ -32,7 +32,7 @@
|
|
32
32
|
%t31 = const 3 :: integer
|
33
33
|
%t32 = load_input "x" :: integer
|
34
34
|
%t33 = make_tuple(%t29, %t30, %t31, %t32) :: tuple<integer>
|
35
|
-
%t16 =
|
35
|
+
%t16 = fold %t33 fn="agg.min" :: integer
|
36
36
|
yield %t16
|
37
37
|
)
|
38
38
|
(Declaration min_2
|
@@ -42,7 +42,7 @@
|
|
42
42
|
%t20 = load_input "x" :: integer
|
43
43
|
%t21 = const -100 :: integer
|
44
44
|
%t22 = make_tuple(%t17, %t18, %t19, %t20, %t21) :: tuple<integer>
|
45
|
-
%t23 =
|
45
|
+
%t23 = fold %t22 fn="agg.min" :: integer
|
46
46
|
yield %t23
|
47
47
|
)
|
48
48
|
)
|
@@ -13,7 +13,7 @@
|
|
13
13
|
%t26 = const 3 :: integer
|
14
14
|
%t27 = load_input "x" :: integer
|
15
15
|
%t28 = make_tuple(%t24, %t25, %t26, %t27) :: tuple<integer>
|
16
|
-
%t7 =
|
16
|
+
%t7 = fold %t28 fn="agg.max" :: integer
|
17
17
|
yield %t7
|
18
18
|
)
|
19
19
|
(Declaration max_2
|
@@ -23,7 +23,7 @@
|
|
23
23
|
%t11 = load_input "x" :: integer
|
24
24
|
%t12 = const 1000 :: integer
|
25
25
|
%t13 = make_tuple(%t8, %t9, %t10, %t11, %t12) :: tuple<integer>
|
26
|
-
%t14 =
|
26
|
+
%t14 = fold %t13 fn="agg.max" :: integer
|
27
27
|
yield %t14
|
28
28
|
)
|
29
29
|
(Declaration min_1
|
@@ -32,7 +32,7 @@
|
|
32
32
|
%t31 = const 3 :: integer
|
33
33
|
%t32 = load_input "x" :: integer
|
34
34
|
%t33 = make_tuple(%t29, %t30, %t31, %t32) :: tuple<integer>
|
35
|
-
%t16 =
|
35
|
+
%t16 = fold %t33 fn="agg.min" :: integer
|
36
36
|
yield %t16
|
37
37
|
)
|
38
38
|
(Declaration min_2
|
@@ -42,7 +42,7 @@
|
|
42
42
|
%t20 = load_input "x" :: integer
|
43
43
|
%t21 = const -100 :: integer
|
44
44
|
%t22 = make_tuple(%t17, %t18, %t19, %t20, %t21) :: tuple<integer>
|
45
|
-
%t23 =
|
45
|
+
%t23 = fold %t22 fn="agg.min" :: integer
|
46
46
|
yield %t23
|
47
47
|
)
|
48
48
|
)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_ea94769e386dc74203e07fe5a857c0465ed724f1d4e8aa6db6aa39e801a8fcd9
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -24,7 +24,7 @@
|
|
24
24
|
%t17 = load_decl selected_value axes=[points] :: integer
|
25
25
|
%t18 = load_field points_el_15["x"] :: integer
|
26
26
|
%t19 = make_tuple(%t17, %t18) :: tuple<integer>
|
27
|
-
%t20 =
|
27
|
+
%t20 = fold %t19 fn="agg.max" :: integer
|
28
28
|
yield %t20
|
29
29
|
end_loop
|
30
30
|
)
|
@@ -24,7 +24,7 @@
|
|
24
24
|
%t17 = load_decl selected_value axes=[points] :: integer
|
25
25
|
%t18 = load_field points_el_15["x"] :: integer
|
26
26
|
%t19 = make_tuple(%t17, %t18) :: tuple<integer>
|
27
|
-
%t20 =
|
27
|
+
%t20 = fold %t19 fn="agg.max" :: integer
|
28
28
|
yield %t20
|
29
29
|
end_loop
|
30
30
|
)
|
@@ -25,16 +25,16 @@
|
|
25
25
|
%t14 = load_input "points" :: array
|
26
26
|
loop points id=L3 in %t14 as el=%points_el_15, idx=%points_i_16
|
27
27
|
%t31 = load_input "points" :: array
|
28
|
-
%
|
29
|
-
%
|
30
|
-
%
|
31
|
-
%
|
28
|
+
%t36 = load_input "points" :: array
|
29
|
+
%t37 = load_field points_el_15["x"] :: integer
|
30
|
+
%t38 = const 100 :: integer
|
31
|
+
%t39 = call core.gt(%t37, %t38) :: boolean
|
32
32
|
%t33 = load_field points_el_15["x"] :: integer
|
33
33
|
%t34 = load_field points_el_15["y"] :: integer
|
34
|
-
%t35 = select %
|
34
|
+
%t35 = select %t39, %t33, %t34 :: integer
|
35
35
|
%t18 = load_field points_el_15["x"] :: integer
|
36
36
|
%t19 = make_tuple(%t35, %t18) :: tuple<integer>
|
37
|
-
%t20 =
|
37
|
+
%t20 = fold %t19 fn="agg.max" :: integer
|
38
38
|
yield %t20
|
39
39
|
end_loop
|
40
40
|
)
|
@@ -42,19 +42,19 @@
|
|
42
42
|
%acc_21 = decl_acc :: integer
|
43
43
|
%t22 = load_input "points" :: array
|
44
44
|
loop points id=L4 in %t22 as el=%points_el_23, idx=%points_i_24
|
45
|
-
%
|
45
|
+
%t40 = load_input "points" :: array
|
46
46
|
%t45 = load_input "points" :: array
|
47
|
-
%
|
47
|
+
%t50 = load_input "points" :: array
|
48
|
+
%t51 = load_field points_el_23["x"] :: integer
|
49
|
+
%t52 = const 100 :: integer
|
50
|
+
%t53 = call core.gt(%t51, %t52) :: boolean
|
48
51
|
%t47 = load_field points_el_23["x"] :: integer
|
49
|
-
%t48 =
|
50
|
-
%t49 =
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%t39 = make_tuple(%t52, %t38) :: tuple<integer>
|
56
|
-
%t40 = Fold %t39 fn="agg.max" :: integer
|
57
|
-
%acc_21 = acc_add agg.sum(%acc_21, %t40) :: integer
|
52
|
+
%t48 = load_field points_el_23["y"] :: integer
|
53
|
+
%t49 = select %t53, %t47, %t48 :: integer
|
54
|
+
%t42 = load_field points_el_23["x"] :: integer
|
55
|
+
%t43 = make_tuple(%t49, %t42) :: tuple<integer>
|
56
|
+
%t44 = fold %t43 fn="agg.max" :: integer
|
57
|
+
%acc_21 = acc_add agg.sum(%acc_21, %t44) :: integer
|
58
58
|
end_loop
|
59
59
|
%t26 = acc_load %acc_21 :: integer
|
60
60
|
yield %t26
|