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
@@ -18,12 +18,12 @@
|
|
18
18
|
%acc40 = decl_acc :: integer
|
19
19
|
%t41 = load_field departments_el_11["employees"] :: any
|
20
20
|
%t14 = const 0.15 :: float
|
21
|
-
loop employees id=L7 in %t41 as el=%
|
22
|
-
%
|
23
|
-
%acc40 = acc_add agg.sum(%acc40, %
|
21
|
+
loop employees id=L7 in %t41 as el=%t42, idx=%t43
|
22
|
+
%t44 = load_field t42["salary"] :: integer
|
23
|
+
%acc40 = acc_add agg.sum(%acc40, %t44) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%t15 = call core.mul(%
|
25
|
+
%t45 = acc_load %acc40 :: integer
|
26
|
+
%t15 = call core.mul(%t45, %t14) :: float
|
27
27
|
yield %t15
|
28
28
|
end_loop
|
29
29
|
)
|
@@ -49,28 +49,28 @@
|
|
49
49
|
%t30 = load_input "departments" :: array
|
50
50
|
loop departments id=L6 in %t30 as el=%departments_el_31, idx=%departments_i_32
|
51
51
|
%t33 = load_field departments_el_31["name"] :: string
|
52
|
-
%
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
56
|
-
%
|
57
|
-
loop employees id=L8 in %
|
58
|
-
%
|
59
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%
|
63
|
-
%
|
64
|
-
%
|
65
|
-
%
|
66
|
-
%
|
67
|
-
%
|
52
|
+
%acc48 = decl_acc :: integer
|
53
|
+
%t49 = load_field departments_el_31["employees"] :: any
|
54
|
+
%acc60 = decl_acc :: integer
|
55
|
+
%t56 = const 0.15 :: float
|
56
|
+
%acc68 = decl_acc :: integer
|
57
|
+
loop employees id=L8 in %t49 as el=%t50, idx=%t51
|
58
|
+
%t52 = load_field t50["salary"] :: integer
|
59
|
+
%acc48 = acc_add agg.sum(%acc48, %t52) :: integer
|
60
|
+
%acc60 = acc_add agg.sum(%acc60, %t52) :: integer
|
61
|
+
%t72 = load_field t50["role"] :: string
|
62
|
+
%t73 = const "manager" :: string
|
63
|
+
%t74 = call core.eq(%t72, %t73) :: boolean
|
64
|
+
%t75 = const 1 :: integer
|
65
|
+
%t76 = const 0 :: integer
|
66
|
+
%t77 = select %t74, %t75, %t76 :: integer
|
67
|
+
%acc68 = acc_add agg.sum(%acc68, %t77) :: integer
|
68
68
|
end_loop
|
69
|
-
%
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%t37 = make_object{name: %t33, payroll: %
|
69
|
+
%t53 = acc_load %acc48 :: integer
|
70
|
+
%t65 = acc_load %acc60 :: integer
|
71
|
+
%t78 = acc_load %acc68 :: integer
|
72
|
+
%t57 = call core.mul(%t65, %t56) :: float
|
73
|
+
%t37 = make_object{name: %t33, payroll: %t53, tax: %t57, managers: %t78} :: object
|
74
74
|
yield %t37
|
75
75
|
end_loop
|
76
76
|
)
|
@@ -18,12 +18,12 @@
|
|
18
18
|
%acc40 = decl_acc :: integer
|
19
19
|
%t41 = load_field departments_el_11["employees"] :: any
|
20
20
|
%t14 = const 0.15 :: float
|
21
|
-
loop employees id=L7 in %t41 as el=%
|
22
|
-
%
|
23
|
-
%acc40 = acc_add agg.sum(%acc40, %
|
21
|
+
loop employees id=L7 in %t41 as el=%t42, idx=%t43
|
22
|
+
%t44 = load_field t42["salary"] :: integer
|
23
|
+
%acc40 = acc_add agg.sum(%acc40, %t44) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%t15 = call core.mul(%
|
25
|
+
%t45 = acc_load %acc40 :: integer
|
26
|
+
%t15 = call core.mul(%t45, %t14) :: float
|
27
27
|
yield %t15
|
28
28
|
end_loop
|
29
29
|
)
|
@@ -49,28 +49,29 @@
|
|
49
49
|
%t30 = load_input "departments" :: array
|
50
50
|
loop departments id=L6 in %t30 as el=%departments_el_31, idx=%departments_i_32
|
51
51
|
%t33 = load_field departments_el_31["name"] :: string
|
52
|
-
%
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
56
|
-
%
|
57
|
-
loop employees id=L8 in %
|
58
|
-
%
|
59
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%
|
63
|
-
%
|
64
|
-
%
|
65
|
-
%
|
66
|
-
%
|
67
|
-
%
|
52
|
+
%acc48 = decl_acc :: integer
|
53
|
+
%t49 = load_field departments_el_31["employees"] :: any
|
54
|
+
%acc60 = decl_acc :: integer
|
55
|
+
%t56 = const 0.15 :: float
|
56
|
+
%acc68 = decl_acc :: integer
|
57
|
+
loop employees id=L8 in %t49 as el=%t50, idx=%t51
|
58
|
+
%t52 = load_field t50["salary"] :: integer
|
59
|
+
%acc48 = acc_add agg.sum(%acc48, %t52) :: integer
|
60
|
+
%t64 = load_field t50["salary"] :: integer
|
61
|
+
%acc60 = acc_add agg.sum(%acc60, %t64) :: integer
|
62
|
+
%t72 = load_field t50["role"] :: string
|
63
|
+
%t73 = const "manager" :: string
|
64
|
+
%t74 = call core.eq(%t72, %t73) :: boolean
|
65
|
+
%t75 = const 1 :: integer
|
66
|
+
%t76 = const 0 :: integer
|
67
|
+
%t77 = select %t74, %t75, %t76 :: integer
|
68
|
+
%acc68 = acc_add agg.sum(%acc68, %t77) :: integer
|
68
69
|
end_loop
|
69
|
-
%
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%t37 = make_object{name: %t33, payroll: %
|
70
|
+
%t53 = acc_load %acc48 :: integer
|
71
|
+
%t65 = acc_load %acc60 :: integer
|
72
|
+
%t78 = acc_load %acc68 :: integer
|
73
|
+
%t57 = call core.mul(%t65, %t56) :: float
|
74
|
+
%t37 = make_object{name: %t33, payroll: %t53, tax: %t57, managers: %t78} :: object
|
74
75
|
yield %t37
|
75
76
|
end_loop
|
76
77
|
)
|
@@ -18,12 +18,12 @@
|
|
18
18
|
loop departments id=L3 in %t10 as el=%departments_el_11, idx=%departments_i_12
|
19
19
|
%acc40 = decl_acc :: integer
|
20
20
|
%t41 = load_field departments_el_11["employees"] :: any
|
21
|
-
loop employees id=L7 in %t41 as el=%
|
22
|
-
%
|
23
|
-
%acc40 = acc_add agg.sum(%acc40, %
|
21
|
+
loop employees id=L7 in %t41 as el=%t42, idx=%t43
|
22
|
+
%t44 = load_field t42["salary"] :: integer
|
23
|
+
%acc40 = acc_add agg.sum(%acc40, %t44) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%t15 = call core.mul(%
|
25
|
+
%t45 = acc_load %acc40 :: integer
|
26
|
+
%t15 = call core.mul(%t45, %t14) :: float
|
27
27
|
yield %t15
|
28
28
|
end_loop
|
29
29
|
)
|
@@ -47,30 +47,30 @@
|
|
47
47
|
)
|
48
48
|
(Declaration department_summary
|
49
49
|
%t30 = load_input "departments" :: array
|
50
|
-
%
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%
|
50
|
+
%t56 = const 0.15 :: float
|
51
|
+
%t73 = const "manager" :: string
|
52
|
+
%t75 = const 1 :: integer
|
53
|
+
%t76 = const 0 :: integer
|
54
54
|
loop departments id=L6 in %t30 as el=%departments_el_31, idx=%departments_i_32
|
55
55
|
%t33 = load_field departments_el_31["name"] :: string
|
56
|
-
%
|
57
|
-
%
|
58
|
-
%
|
59
|
-
%
|
60
|
-
loop employees id=L8 in %
|
61
|
-
%
|
62
|
-
%
|
63
|
-
%
|
64
|
-
%
|
65
|
-
%
|
66
|
-
%
|
67
|
-
%
|
56
|
+
%acc48 = decl_acc :: integer
|
57
|
+
%t49 = load_field departments_el_31["employees"] :: any
|
58
|
+
%acc60 = decl_acc :: integer
|
59
|
+
%acc68 = decl_acc :: integer
|
60
|
+
loop employees id=L8 in %t49 as el=%t50, idx=%t51
|
61
|
+
%t52 = load_field t50["salary"] :: integer
|
62
|
+
%acc48 = acc_add agg.sum(%acc48, %t52) :: integer
|
63
|
+
%acc60 = acc_add agg.sum(%acc60, %t52) :: integer
|
64
|
+
%t72 = load_field t50["role"] :: string
|
65
|
+
%t74 = call core.eq(%t72, %t73) :: boolean
|
66
|
+
%t77 = select %t74, %t75, %t76 :: integer
|
67
|
+
%acc68 = acc_add agg.sum(%acc68, %t77) :: integer
|
68
68
|
end_loop
|
69
|
-
%
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%t37 = make_object{name: %t33, payroll: %
|
69
|
+
%t53 = acc_load %acc48 :: integer
|
70
|
+
%t65 = acc_load %acc60 :: integer
|
71
|
+
%t78 = acc_load %acc68 :: integer
|
72
|
+
%t57 = call core.mul(%t65, %t56) :: float
|
73
|
+
%t37 = make_object{name: %t33, payroll: %t53, tax: %t57, managers: %t78} :: object
|
74
74
|
yield %t37
|
75
75
|
end_loop
|
76
76
|
)
|
@@ -18,12 +18,12 @@
|
|
18
18
|
loop departments id=L3 in %t10 as el=%departments_el_11, idx=%departments_i_12
|
19
19
|
%acc40 = decl_acc :: integer
|
20
20
|
%t41 = load_field departments_el_11["employees"] :: any
|
21
|
-
loop employees id=L7 in %t41 as el=%
|
22
|
-
%
|
23
|
-
%acc40 = acc_add agg.sum(%acc40, %
|
21
|
+
loop employees id=L7 in %t41 as el=%t42, idx=%t43
|
22
|
+
%t44 = load_field t42["salary"] :: integer
|
23
|
+
%acc40 = acc_add agg.sum(%acc40, %t44) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%t15 = call core.mul(%
|
25
|
+
%t45 = acc_load %acc40 :: integer
|
26
|
+
%t15 = call core.mul(%t45, %t14) :: float
|
27
27
|
yield %t15
|
28
28
|
end_loop
|
29
29
|
)
|
@@ -47,30 +47,30 @@
|
|
47
47
|
)
|
48
48
|
(Declaration department_summary
|
49
49
|
%t30 = load_input "departments" :: array
|
50
|
-
%
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%
|
50
|
+
%t56 = const 0.15 :: float
|
51
|
+
%t73 = const "manager" :: string
|
52
|
+
%t75 = const 1 :: integer
|
53
|
+
%t76 = const 0 :: integer
|
54
54
|
loop departments id=L6 in %t30 as el=%departments_el_31, idx=%departments_i_32
|
55
55
|
%t33 = load_field departments_el_31["name"] :: string
|
56
|
-
%
|
57
|
-
%
|
58
|
-
%
|
59
|
-
%
|
60
|
-
loop employees id=L8 in %
|
61
|
-
%
|
62
|
-
%
|
63
|
-
%
|
64
|
-
%
|
65
|
-
%
|
66
|
-
%
|
67
|
-
%
|
56
|
+
%acc48 = decl_acc :: integer
|
57
|
+
%t49 = load_field departments_el_31["employees"] :: any
|
58
|
+
%acc60 = decl_acc :: integer
|
59
|
+
%acc68 = decl_acc :: integer
|
60
|
+
loop employees id=L8 in %t49 as el=%t50, idx=%t51
|
61
|
+
%t52 = load_field t50["salary"] :: integer
|
62
|
+
%acc48 = acc_add agg.sum(%acc48, %t52) :: integer
|
63
|
+
%acc60 = acc_add agg.sum(%acc60, %t52) :: integer
|
64
|
+
%t72 = load_field t50["role"] :: string
|
65
|
+
%t74 = call core.eq(%t72, %t73) :: boolean
|
66
|
+
%t77 = select %t74, %t75, %t76 :: integer
|
67
|
+
%acc68 = acc_add agg.sum(%acc68, %t77) :: integer
|
68
68
|
end_loop
|
69
|
-
%
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%t37 = make_object{name: %t33, payroll: %
|
69
|
+
%t53 = acc_load %acc48 :: integer
|
70
|
+
%t65 = acc_load %acc60 :: integer
|
71
|
+
%t78 = acc_load %acc68 :: integer
|
72
|
+
%t57 = call core.mul(%t65, %t56) :: float
|
73
|
+
%t37 = make_object{name: %t33, payroll: %t53, tax: %t57, managers: %t78} :: object
|
74
74
|
yield %t37
|
75
75
|
end_loop
|
76
76
|
)
|
@@ -20,9 +20,9 @@ export function _payroll_tax(input) {
|
|
20
20
|
t10.forEach((departments_el_11, departments_i_12) => {
|
21
21
|
let acc40 = 0;
|
22
22
|
let t41 = departments_el_11["employees"];
|
23
|
-
t41.forEach((
|
24
|
-
let
|
25
|
-
acc40 +=
|
23
|
+
t41.forEach((t42, t43) => {
|
24
|
+
let t44 = t42["salary"];
|
25
|
+
acc40 += t44;
|
26
26
|
});
|
27
27
|
let t15 = acc40 * t14;
|
28
28
|
out.push(t15);
|
@@ -53,31 +53,31 @@ export function _manager_count(input) {
|
|
53
53
|
export function _department_summary(input) {
|
54
54
|
let out = [];
|
55
55
|
let t30 = input["departments"];
|
56
|
-
const
|
57
|
-
const
|
58
|
-
const
|
59
|
-
const
|
56
|
+
const t56 = 0.15;
|
57
|
+
const t73 = "manager";
|
58
|
+
const t75 = 1;
|
59
|
+
const t76 = 0;
|
60
60
|
t30.forEach((departments_el_31, departments_i_32) => {
|
61
61
|
let t33 = departments_el_31["name"];
|
62
|
-
let
|
63
|
-
let
|
64
|
-
let
|
65
|
-
let
|
66
|
-
|
67
|
-
let
|
68
|
-
|
69
|
-
|
70
|
-
let
|
71
|
-
let
|
72
|
-
|
73
|
-
|
62
|
+
let acc48 = 0;
|
63
|
+
let t49 = departments_el_31["employees"];
|
64
|
+
let acc60 = 0;
|
65
|
+
let acc68 = 0;
|
66
|
+
t49.forEach((t50, t51) => {
|
67
|
+
let t52 = t50["salary"];
|
68
|
+
acc48 += t52;
|
69
|
+
acc60 += t52;
|
70
|
+
let t72 = t50["role"];
|
71
|
+
let t74 = t72 == t73;
|
72
|
+
let t77 = t74 ? t75 : t76;
|
73
|
+
acc68 += t77;
|
74
74
|
});
|
75
|
-
let
|
75
|
+
let t57 = acc60 * t56;
|
76
76
|
let t37 = {
|
77
77
|
"name": t33,
|
78
|
-
"payroll":
|
79
|
-
"tax":
|
80
|
-
"managers":
|
78
|
+
"payroll": acc48,
|
79
|
+
"tax": t57,
|
80
|
+
"managers": acc68
|
81
81
|
};
|
82
82
|
out.push(t37);
|
83
83
|
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_002f34f6230fcd86b09e6081a7690404057fdb4e88a69309791cc98faf743c5b
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -51,12 +51,12 @@ module Kumi::Compiled::KUMI_1523dc98fbf6f178f956575880c9b428b21c19aa91a7822a35e2
|
|
51
51
|
t10.each_with_index do |departments_el_11, departments_i_12|
|
52
52
|
acc40 = 0
|
53
53
|
t41 = departments_el_11["employees"] || departments_el_11[:employees]
|
54
|
-
t41.each_with_index do |
|
55
|
-
|
56
|
-
acc40 +=
|
54
|
+
t41.each_with_index do |t42, t43|
|
55
|
+
t44 = t42["salary"] || t42[:salary]
|
56
|
+
acc40 += t44
|
57
57
|
end
|
58
|
-
|
59
|
-
t15 =
|
58
|
+
t45 = acc40
|
59
|
+
t15 = t45 * t14
|
60
60
|
out << t15
|
61
61
|
end
|
62
62
|
out
|
@@ -86,34 +86,34 @@ module Kumi::Compiled::KUMI_1523dc98fbf6f178f956575880c9b428b21c19aa91a7822a35e2
|
|
86
86
|
def _department_summary(input = @input)
|
87
87
|
out = []
|
88
88
|
t30 = input["departments"] || input[:departments]
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
89
|
+
t56 = 0.15
|
90
|
+
t73 = "manager"
|
91
|
+
t75 = 1
|
92
|
+
t76 = 0
|
93
93
|
t30.each_with_index do |departments_el_31, departments_i_32|
|
94
94
|
t33 = departments_el_31["name"] || departments_el_31[:name]
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
95
|
+
acc48 = 0
|
96
|
+
t49 = departments_el_31["employees"] || departments_el_31[:employees]
|
97
|
+
acc60 = 0
|
98
|
+
acc68 = 0
|
99
|
+
t49.each_with_index do |t50, t51|
|
100
|
+
t52 = t50["salary"] || t50[:salary]
|
101
|
+
acc48 += t52
|
102
|
+
acc60 += t52
|
103
|
+
t72 = t50["role"] || t50[:role]
|
104
|
+
t74 = t72 == t73
|
105
|
+
t77 = t74 ? t75 : t76
|
106
|
+
acc68 += t77
|
107
107
|
end
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
108
|
+
t53 = acc48
|
109
|
+
t65 = acc60
|
110
|
+
t78 = acc68
|
111
|
+
t57 = t65 * t56
|
112
112
|
t37 = {
|
113
113
|
"name" => t33,
|
114
|
-
"payroll" =>
|
115
|
-
"tax" =>
|
116
|
-
"managers" =>
|
114
|
+
"payroll" => t53,
|
115
|
+
"tax" => t57,
|
116
|
+
"managers" => t78
|
117
117
|
}
|
118
118
|
out << t37
|
119
119
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_4c8723995ed228ad59aa4387c47f793b36b9ab146166d75c9288837c7d368c1b
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -37,25 +37,25 @@
|
|
37
37
|
%t31 = load_input "departments" :: array
|
38
38
|
%acc33 = decl_acc :: integer
|
39
39
|
%t34 = load_field departments_el_25["employees"] :: any
|
40
|
-
loop employees id=L6 in %t34 as el=%
|
41
|
-
%
|
42
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
40
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
41
|
+
%t37 = load_field t35["salary"] :: integer
|
42
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
43
43
|
end_loop
|
44
|
-
%
|
45
|
-
%
|
46
|
-
%
|
47
|
-
%
|
48
|
-
loop employees id=L7 in %
|
49
|
-
%
|
50
|
-
%
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
44
|
+
%t38 = acc_load %acc33 :: integer
|
45
|
+
%t39 = load_input "departments" :: array
|
46
|
+
%acc41 = decl_acc :: integer
|
47
|
+
%t42 = load_field departments_el_25["employees"] :: any
|
48
|
+
loop employees id=L7 in %t42 as el=%t43, idx=%t44
|
49
|
+
%t45 = load_field t43["role"] :: string
|
50
|
+
%t46 = const "manager" :: string
|
51
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
52
|
+
%t48 = const 1 :: integer
|
53
|
+
%t49 = const 0 :: integer
|
54
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
55
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
56
56
|
end_loop
|
57
|
-
%
|
58
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
57
|
+
%t51 = acc_load %acc41 :: integer
|
58
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
59
59
|
yield %t30
|
60
60
|
end_loop
|
61
61
|
)
|
@@ -36,21 +36,21 @@
|
|
36
36
|
%t27 = load_field departments_el_25["name"] :: string
|
37
37
|
%acc33 = decl_acc :: integer
|
38
38
|
%t34 = load_field departments_el_25["employees"] :: any
|
39
|
-
%
|
40
|
-
loop employees id=L6 in %t34 as el=%
|
41
|
-
%
|
42
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
43
|
-
%
|
44
|
-
%
|
45
|
-
%
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%
|
49
|
-
%
|
39
|
+
%acc41 = decl_acc :: integer
|
40
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
41
|
+
%t37 = load_field t35["salary"] :: integer
|
42
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
43
|
+
%t45 = load_field t35["role"] :: string
|
44
|
+
%t46 = const "manager" :: string
|
45
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
46
|
+
%t48 = const 1 :: integer
|
47
|
+
%t49 = const 0 :: integer
|
48
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
49
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
50
50
|
end_loop
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
51
|
+
%t38 = acc_load %acc33 :: integer
|
52
|
+
%t51 = acc_load %acc41 :: integer
|
53
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
54
54
|
yield %t30
|
55
55
|
end_loop
|
56
56
|
)
|
@@ -36,21 +36,21 @@
|
|
36
36
|
%t27 = load_field departments_el_25["name"] :: string
|
37
37
|
%acc33 = decl_acc :: integer
|
38
38
|
%t34 = load_field departments_el_25["employees"] :: any
|
39
|
-
%
|
40
|
-
loop employees id=L6 in %t34 as el=%
|
41
|
-
%
|
42
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
43
|
-
%
|
44
|
-
%
|
45
|
-
%
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%
|
49
|
-
%
|
39
|
+
%acc41 = decl_acc :: integer
|
40
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
41
|
+
%t37 = load_field t35["salary"] :: integer
|
42
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
43
|
+
%t45 = load_field t35["role"] :: string
|
44
|
+
%t46 = const "manager" :: string
|
45
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
46
|
+
%t48 = const 1 :: integer
|
47
|
+
%t49 = const 0 :: integer
|
48
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
49
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
50
50
|
end_loop
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
51
|
+
%t38 = acc_load %acc33 :: integer
|
52
|
+
%t51 = acc_load %acc41 :: integer
|
53
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
54
54
|
yield %t30
|
55
55
|
end_loop
|
56
56
|
)
|
@@ -32,25 +32,25 @@
|
|
32
32
|
)
|
33
33
|
(Declaration department_summary
|
34
34
|
%t24 = load_input "departments" :: array
|
35
|
-
%
|
36
|
-
%
|
37
|
-
%
|
35
|
+
%t46 = const "manager" :: string
|
36
|
+
%t48 = const 1 :: integer
|
37
|
+
%t49 = const 0 :: integer
|
38
38
|
loop departments id=L5 in %t24 as el=%departments_el_25, idx=%departments_i_26
|
39
39
|
%t27 = load_field departments_el_25["name"] :: string
|
40
40
|
%acc33 = decl_acc :: integer
|
41
41
|
%t34 = load_field departments_el_25["employees"] :: any
|
42
|
-
%
|
43
|
-
loop employees id=L6 in %t34 as el=%
|
44
|
-
%
|
45
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%
|
49
|
-
%
|
42
|
+
%acc41 = decl_acc :: integer
|
43
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
44
|
+
%t37 = load_field t35["salary"] :: integer
|
45
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
46
|
+
%t45 = load_field t35["role"] :: string
|
47
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
48
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
49
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
50
50
|
end_loop
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
51
|
+
%t38 = acc_load %acc33 :: integer
|
52
|
+
%t51 = acc_load %acc41 :: integer
|
53
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
54
54
|
yield %t30
|
55
55
|
end_loop
|
56
56
|
)
|