kumi 0.0.24 → 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 +5 -0
- 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_02_inlined.txt +1291 -1291
- data/golden/game_of_life/expected/lir_03_cse.txt +396 -396
- data/golden/game_of_life/expected/lir_04_1_loop_fusion.txt +396 -396
- data/golden/game_of_life/expected/lir_04_loop_invcm.txt +396 -396
- data/golden/game_of_life/expected/lir_06_const_prop.txt +396 -396
- 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_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/schema_ruby.rb +1 -1
- 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/schema_ruby.rb +1 -1
- data/golden/shift/expected/schema_ruby.rb +1 -1
- 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/schema_ruby.rb +1 -1
- data/golden/tuples_and_arrays/expected/lir_02_inlined.txt +16 -16
- data/golden/tuples_and_arrays/expected/lir_03_cse.txt +13 -13
- data/golden/tuples_and_arrays/expected/lir_04_1_loop_fusion.txt +13 -13
- data/golden/tuples_and_arrays/expected/lir_04_loop_invcm.txt +13 -13
- data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +13 -13
- 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/lir_02_inlined.txt +524 -524
- data/golden/us_tax_2024/expected/lir_03_cse.txt +283 -283
- data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +283 -283
- data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +320 -260
- data/golden/us_tax_2024/expected/lir_06_const_prop.txt +320 -260
- data/golden/us_tax_2024/expected/schema_javascript.mjs +24 -24
- data/golden/us_tax_2024/expected/schema_ruby.rb +25 -25
- data/golden/with_constants/expected/schema_ruby.rb +1 -1
- data/lib/kumi/core/analyzer/passes/lir/inline_declarations_pass.rb +118 -74
- data/lib/kumi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d0a680258ba7c40a2f00d9af8d4abf116344071ddc61d8b587a9a5a49eed6c9
|
4
|
+
data.tar.gz: e16a0a52944cfa45d0a2f15c82fbbaac07392d4a1060f490b4c2fa67cb11208b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6002d0e6a6b86c345226d630f09279b8e24c5ab581c1d6dba1c3f76b70f91e5ce0a9e2200ee402d12e0b43b593d326cf314ce19b5dafdd7249c36d467ce99a4e
|
7
|
+
data.tar.gz: d58b16b88031e3c9ed75598f71e999657f3e6f23b8f0b9e2fe211c74f8f43d1aa43ff5125f6faef7c713cdb1fac5edd7e59e0aaf29405aafe7123708d352ee36
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_9728a32b2ef1c73739b44f006d54b23230821bda76275eb804cd9ec4c91c3089
|
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::
|
2
|
+
module Kumi::Compiled::KUMI_b0b7f061a7a0eedb52d282a806e7e102921f6ab3042667bd6fc6fc7f3a1018e2
|
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::
|
2
|
+
module Kumi::Compiled::KUMI_f6e8984aaae6be8cee0041865907ace29c189473e461ccf9db4a6bec97465dab
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -20,17 +20,17 @@
|
|
20
20
|
%t24 = call core.gt(%t22, %t23) :: boolean
|
21
21
|
%t9 = call core.and(%t21, %t24) :: boolean
|
22
22
|
%t10 = const "both positive" :: string
|
23
|
-
%
|
24
|
-
%
|
25
|
-
%
|
23
|
+
%t25 = load_input "x" :: integer
|
24
|
+
%t26 = const 0 :: integer
|
25
|
+
%t27 = call core.gt(%t25, %t26) :: boolean
|
26
26
|
%t12 = const "x positive" :: string
|
27
|
-
%
|
28
|
-
%
|
29
|
-
%
|
27
|
+
%t28 = load_input "y" :: integer
|
28
|
+
%t29 = const 0 :: integer
|
29
|
+
%t30 = call core.gt(%t28, %t29) :: boolean
|
30
30
|
%t14 = const "y positive" :: string
|
31
31
|
%t15 = const "neither positive" :: string
|
32
|
-
%t16 = select %
|
33
|
-
%t17 = select %
|
32
|
+
%t16 = select %t30, %t14, %t15 :: string
|
33
|
+
%t17 = select %t27, %t12, %t16 :: string
|
34
34
|
%t18 = select %t9, %t10, %t17 :: string
|
35
35
|
yield %t18
|
36
36
|
)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_68bc018c477a94cdfe07ac690bfacdebc9208a590b464f22d499aee7aafafd19
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -68,46 +68,46 @@
|
|
68
68
|
%t56 = load_input "departments" :: array
|
69
69
|
%acc58 = decl_acc :: integer
|
70
70
|
%t59 = load_field departments_el_48["employees"] :: any
|
71
|
-
loop employees id=L10 in %t59 as el=%
|
72
|
-
%
|
73
|
-
%acc58 = acc_add agg.sum(%acc58, %
|
71
|
+
loop employees id=L10 in %t59 as el=%t60, idx=%t61
|
72
|
+
%t62 = load_field t60["salary"] :: integer
|
73
|
+
%acc58 = acc_add agg.sum(%acc58, %t62) :: integer
|
74
74
|
end_loop
|
75
|
-
%
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
loop employees id=L11 in %
|
80
|
-
%
|
81
|
-
%
|
82
|
-
%
|
83
|
-
%
|
84
|
-
%
|
85
|
-
%
|
86
|
-
%
|
75
|
+
%t63 = acc_load %acc58 :: integer
|
76
|
+
%t64 = load_input "departments" :: array
|
77
|
+
%acc66 = decl_acc :: integer
|
78
|
+
%t67 = load_field departments_el_48["employees"] :: any
|
79
|
+
loop employees id=L11 in %t67 as el=%t68, idx=%t69
|
80
|
+
%t70 = load_field t68["role"] :: string
|
81
|
+
%t71 = const "manager" :: string
|
82
|
+
%t72 = call core.eq(%t70, %t71) :: boolean
|
83
|
+
%t73 = const 1 :: integer
|
84
|
+
%t74 = const 0 :: integer
|
85
|
+
%t75 = select %t72, %t73, %t74 :: integer
|
86
|
+
%acc66 = acc_add agg.sum(%acc66, %t75) :: integer
|
87
87
|
end_loop
|
88
|
-
%
|
89
|
-
%
|
90
|
-
%
|
91
|
-
%
|
92
|
-
loop employees id=L12 in %
|
93
|
-
%
|
94
|
-
%
|
95
|
-
%
|
96
|
-
%
|
97
|
-
%
|
98
|
-
%
|
99
|
-
%
|
88
|
+
%t76 = acc_load %acc66 :: integer
|
89
|
+
%t77 = load_input "departments" :: array
|
90
|
+
%acc79 = decl_acc :: integer
|
91
|
+
%t80 = load_field departments_el_48["employees"] :: any
|
92
|
+
loop employees id=L12 in %t80 as el=%t81, idx=%t82
|
93
|
+
%t83 = load_field t81["role"] :: string
|
94
|
+
%t84 = const "senior" :: string
|
95
|
+
%t85 = call core.eq(%t83, %t84) :: boolean
|
96
|
+
%t86 = const 1 :: integer
|
97
|
+
%t87 = const 0 :: integer
|
98
|
+
%t88 = select %t85, %t86, %t87 :: integer
|
99
|
+
%acc79 = acc_add agg.sum(%acc79, %t88) :: integer
|
100
100
|
end_loop
|
101
|
-
%
|
102
|
-
%
|
103
|
-
%
|
104
|
-
%
|
105
|
-
loop employees id=L13 in %
|
106
|
-
%
|
107
|
-
%
|
101
|
+
%t89 = acc_load %acc79 :: integer
|
102
|
+
%t90 = load_input "departments" :: array
|
103
|
+
%acc92 = decl_acc :: integer
|
104
|
+
%t93 = load_field departments_el_48["employees"] :: any
|
105
|
+
loop employees id=L13 in %t93 as el=%t94, idx=%t95
|
106
|
+
%t96 = load_field t94["salary"] :: integer
|
107
|
+
%acc92 = acc_add agg.max(%acc92, %t96) :: integer
|
108
108
|
end_loop
|
109
|
-
%
|
110
|
-
%t55 = make_object{name: %t50, total_payroll: %
|
109
|
+
%t97 = acc_load %acc92 :: integer
|
110
|
+
%t55 = make_object{name: %t50, total_payroll: %t63, manager_count: %t76, senior_count: %t89, top_salary: %t97} :: object
|
111
111
|
yield %t55
|
112
112
|
end_loop
|
113
113
|
)
|
@@ -67,30 +67,30 @@
|
|
67
67
|
%t50 = load_field departments_el_48["name"] :: string
|
68
68
|
%acc58 = decl_acc :: integer
|
69
69
|
%t59 = load_field departments_el_48["employees"] :: any
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
loop employees id=L10 in %t59 as el=%
|
74
|
-
%
|
75
|
-
%acc58 = acc_add agg.sum(%acc58, %
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%
|
80
|
-
%
|
81
|
-
%
|
82
|
-
%
|
83
|
-
%
|
84
|
-
%
|
85
|
-
%
|
86
|
-
%
|
87
|
-
%
|
70
|
+
%acc66 = decl_acc :: integer
|
71
|
+
%acc79 = decl_acc :: integer
|
72
|
+
%acc92 = decl_acc :: integer
|
73
|
+
loop employees id=L10 in %t59 as el=%t60, idx=%t61
|
74
|
+
%t62 = load_field t60["salary"] :: integer
|
75
|
+
%acc58 = acc_add agg.sum(%acc58, %t62) :: integer
|
76
|
+
%t70 = load_field t60["role"] :: string
|
77
|
+
%t71 = const "manager" :: string
|
78
|
+
%t72 = call core.eq(%t70, %t71) :: boolean
|
79
|
+
%t73 = const 1 :: integer
|
80
|
+
%t74 = const 0 :: integer
|
81
|
+
%t75 = select %t72, %t73, %t74 :: integer
|
82
|
+
%acc66 = acc_add agg.sum(%acc66, %t75) :: integer
|
83
|
+
%acc92 = acc_add agg.max(%acc92, %t62) :: integer
|
84
|
+
%t84 = const "senior" :: string
|
85
|
+
%t85 = call core.eq(%t70, %t84) :: boolean
|
86
|
+
%t88 = select %t85, %t73, %t74 :: integer
|
87
|
+
%acc79 = acc_add agg.sum(%acc79, %t88) :: integer
|
88
88
|
end_loop
|
89
|
-
%
|
90
|
-
%
|
91
|
-
%
|
92
|
-
%
|
93
|
-
%t55 = make_object{name: %t50, total_payroll: %
|
89
|
+
%t63 = acc_load %acc58 :: integer
|
90
|
+
%t76 = acc_load %acc66 :: integer
|
91
|
+
%t97 = acc_load %acc92 :: integer
|
92
|
+
%t89 = acc_load %acc79 :: integer
|
93
|
+
%t55 = make_object{name: %t50, total_payroll: %t63, manager_count: %t76, senior_count: %t89, top_salary: %t97} :: object
|
94
94
|
yield %t55
|
95
95
|
end_loop
|
96
96
|
)
|
@@ -67,32 +67,32 @@
|
|
67
67
|
%t50 = load_field departments_el_48["name"] :: string
|
68
68
|
%acc58 = decl_acc :: integer
|
69
69
|
%t59 = load_field departments_el_48["employees"] :: any
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
loop employees id=L10 in %t59 as el=%
|
74
|
-
%
|
75
|
-
%acc58 = acc_add agg.sum(%acc58, %
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%
|
80
|
-
%
|
81
|
-
%
|
82
|
-
%
|
83
|
-
%
|
84
|
-
%
|
85
|
-
%
|
86
|
-
%
|
87
|
-
%
|
88
|
-
%
|
89
|
-
%
|
70
|
+
%acc66 = decl_acc :: integer
|
71
|
+
%acc79 = decl_acc :: integer
|
72
|
+
%acc92 = decl_acc :: integer
|
73
|
+
loop employees id=L10 in %t59 as el=%t60, idx=%t61
|
74
|
+
%t62 = load_field t60["salary"] :: integer
|
75
|
+
%acc58 = acc_add agg.sum(%acc58, %t62) :: integer
|
76
|
+
%t70 = load_field t60["role"] :: string
|
77
|
+
%t71 = const "manager" :: string
|
78
|
+
%t72 = call core.eq(%t70, %t71) :: boolean
|
79
|
+
%t73 = const 1 :: integer
|
80
|
+
%t74 = const 0 :: integer
|
81
|
+
%t75 = select %t72, %t73, %t74 :: integer
|
82
|
+
%acc66 = acc_add agg.sum(%acc66, %t75) :: integer
|
83
|
+
%t96 = load_field t60["salary"] :: integer
|
84
|
+
%acc92 = acc_add agg.max(%acc92, %t96) :: integer
|
85
|
+
%t83 = load_field t60["role"] :: string
|
86
|
+
%t84 = const "senior" :: string
|
87
|
+
%t85 = call core.eq(%t83, %t84) :: boolean
|
88
|
+
%t88 = select %t85, %t73, %t74 :: integer
|
89
|
+
%acc79 = acc_add agg.sum(%acc79, %t88) :: integer
|
90
90
|
end_loop
|
91
|
-
%
|
92
|
-
%
|
93
|
-
%
|
94
|
-
%
|
95
|
-
%t55 = make_object{name: %t50, total_payroll: %
|
91
|
+
%t63 = acc_load %acc58 :: integer
|
92
|
+
%t76 = acc_load %acc66 :: integer
|
93
|
+
%t97 = acc_load %acc92 :: integer
|
94
|
+
%t89 = acc_load %acc79 :: integer
|
95
|
+
%t55 = make_object{name: %t50, total_payroll: %t63, manager_count: %t76, senior_count: %t89, top_salary: %t97} :: object
|
96
96
|
yield %t55
|
97
97
|
end_loop
|
98
98
|
)
|
@@ -63,34 +63,34 @@
|
|
63
63
|
)
|
64
64
|
(Declaration department_summary
|
65
65
|
%t47 = load_input "departments" :: array
|
66
|
-
%
|
67
|
-
%
|
68
|
-
%
|
69
|
-
%
|
66
|
+
%t71 = const "manager" :: string
|
67
|
+
%t73 = const 1 :: integer
|
68
|
+
%t74 = const 0 :: integer
|
69
|
+
%t84 = const "senior" :: string
|
70
70
|
loop departments id=L9 in %t47 as el=%departments_el_48, idx=%departments_i_49
|
71
71
|
%t50 = load_field departments_el_48["name"] :: string
|
72
72
|
%acc58 = decl_acc :: integer
|
73
73
|
%t59 = load_field departments_el_48["employees"] :: any
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
loop employees id=L10 in %t59 as el=%
|
78
|
-
%
|
79
|
-
%acc58 = acc_add agg.sum(%acc58, %
|
80
|
-
%
|
81
|
-
%
|
82
|
-
%
|
83
|
-
%
|
84
|
-
%
|
85
|
-
%
|
86
|
-
%
|
87
|
-
%
|
74
|
+
%acc66 = decl_acc :: integer
|
75
|
+
%acc79 = decl_acc :: integer
|
76
|
+
%acc92 = decl_acc :: integer
|
77
|
+
loop employees id=L10 in %t59 as el=%t60, idx=%t61
|
78
|
+
%t62 = load_field t60["salary"] :: integer
|
79
|
+
%acc58 = acc_add agg.sum(%acc58, %t62) :: integer
|
80
|
+
%t70 = load_field t60["role"] :: string
|
81
|
+
%t72 = call core.eq(%t70, %t71) :: boolean
|
82
|
+
%t75 = select %t72, %t73, %t74 :: integer
|
83
|
+
%acc66 = acc_add agg.sum(%acc66, %t75) :: integer
|
84
|
+
%acc92 = acc_add agg.max(%acc92, %t62) :: integer
|
85
|
+
%t85 = call core.eq(%t70, %t84) :: boolean
|
86
|
+
%t88 = select %t85, %t73, %t74 :: integer
|
87
|
+
%acc79 = acc_add agg.sum(%acc79, %t88) :: integer
|
88
88
|
end_loop
|
89
|
-
%
|
90
|
-
%
|
91
|
-
%
|
92
|
-
%
|
93
|
-
%t55 = make_object{name: %t50, total_payroll: %
|
89
|
+
%t63 = acc_load %acc58 :: integer
|
90
|
+
%t76 = acc_load %acc66 :: integer
|
91
|
+
%t97 = acc_load %acc92 :: integer
|
92
|
+
%t89 = acc_load %acc79 :: integer
|
93
|
+
%t55 = make_object{name: %t50, total_payroll: %t63, manager_count: %t76, senior_count: %t89, top_salary: %t97} :: object
|
94
94
|
yield %t55
|
95
95
|
end_loop
|
96
96
|
)
|
@@ -63,34 +63,34 @@
|
|
63
63
|
)
|
64
64
|
(Declaration department_summary
|
65
65
|
%t47 = load_input "departments" :: array
|
66
|
-
%
|
67
|
-
%
|
68
|
-
%
|
69
|
-
%
|
66
|
+
%t71 = const "manager" :: string
|
67
|
+
%t73 = const 1 :: integer
|
68
|
+
%t74 = const 0 :: integer
|
69
|
+
%t84 = const "senior" :: string
|
70
70
|
loop departments id=L9 in %t47 as el=%departments_el_48, idx=%departments_i_49
|
71
71
|
%t50 = load_field departments_el_48["name"] :: string
|
72
72
|
%acc58 = decl_acc :: integer
|
73
73
|
%t59 = load_field departments_el_48["employees"] :: any
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
loop employees id=L10 in %t59 as el=%
|
78
|
-
%
|
79
|
-
%acc58 = acc_add agg.sum(%acc58, %
|
80
|
-
%
|
81
|
-
%
|
82
|
-
%
|
83
|
-
%
|
84
|
-
%
|
85
|
-
%
|
86
|
-
%
|
87
|
-
%
|
74
|
+
%acc66 = decl_acc :: integer
|
75
|
+
%acc79 = decl_acc :: integer
|
76
|
+
%acc92 = decl_acc :: integer
|
77
|
+
loop employees id=L10 in %t59 as el=%t60, idx=%t61
|
78
|
+
%t62 = load_field t60["salary"] :: integer
|
79
|
+
%acc58 = acc_add agg.sum(%acc58, %t62) :: integer
|
80
|
+
%t70 = load_field t60["role"] :: string
|
81
|
+
%t72 = call core.eq(%t70, %t71) :: boolean
|
82
|
+
%t75 = select %t72, %t73, %t74 :: integer
|
83
|
+
%acc66 = acc_add agg.sum(%acc66, %t75) :: integer
|
84
|
+
%acc92 = acc_add agg.max(%acc92, %t62) :: integer
|
85
|
+
%t85 = call core.eq(%t70, %t84) :: boolean
|
86
|
+
%t88 = select %t85, %t73, %t74 :: integer
|
87
|
+
%acc79 = acc_add agg.sum(%acc79, %t88) :: integer
|
88
88
|
end_loop
|
89
|
-
%
|
90
|
-
%
|
91
|
-
%
|
92
|
-
%
|
93
|
-
%t55 = make_object{name: %t50, total_payroll: %
|
89
|
+
%t63 = acc_load %acc58 :: integer
|
90
|
+
%t76 = acc_load %acc66 :: integer
|
91
|
+
%t97 = acc_load %acc92 :: integer
|
92
|
+
%t89 = acc_load %acc79 :: integer
|
93
|
+
%t55 = make_object{name: %t50, total_payroll: %t63, manager_count: %t76, senior_count: %t89, top_salary: %t97} :: object
|
94
94
|
yield %t55
|
95
95
|
end_loop
|
96
96
|
)
|
@@ -75,39 +75,39 @@ export function _max_salary(input) {
|
|
75
75
|
export function _department_summary(input) {
|
76
76
|
let out = [];
|
77
77
|
let t47 = input["departments"];
|
78
|
-
const
|
79
|
-
const
|
80
|
-
const
|
81
|
-
const
|
78
|
+
const t71 = "manager";
|
79
|
+
const t73 = 1;
|
80
|
+
const t74 = 0;
|
81
|
+
const t84 = "senior";
|
82
82
|
t47.forEach((departments_el_48, departments_i_49) => {
|
83
83
|
let t50 = departments_el_48["name"];
|
84
84
|
let acc58 = 0;
|
85
85
|
let t59 = departments_el_48["employees"];
|
86
|
-
let
|
87
|
-
let
|
88
|
-
let
|
89
|
-
t59.forEach((
|
90
|
-
let
|
91
|
-
acc58 +=
|
92
|
-
let
|
93
|
-
let
|
94
|
-
let
|
95
|
-
|
96
|
-
if (
|
97
|
-
|
86
|
+
let acc66 = 0;
|
87
|
+
let acc79 = 0;
|
88
|
+
let acc92 = null;
|
89
|
+
t59.forEach((t60, t61) => {
|
90
|
+
let t62 = t60["salary"];
|
91
|
+
acc58 += t62;
|
92
|
+
let t70 = t60["role"];
|
93
|
+
let t72 = t70 == t71;
|
94
|
+
let t75 = t72 ? t73 : t74;
|
95
|
+
acc66 += t75;
|
96
|
+
if (acc92 === null || acc92 === undefined) {
|
97
|
+
acc92 = t62;
|
98
98
|
} else {
|
99
|
-
|
99
|
+
acc92 = (acc92 === null || t62 > acc92) ? t62 : acc92;
|
100
100
|
}
|
101
|
-
let
|
102
|
-
let
|
103
|
-
|
101
|
+
let t85 = t70 == t84;
|
102
|
+
let t88 = t85 ? t73 : t74;
|
103
|
+
acc79 += t88;
|
104
104
|
});
|
105
105
|
let t55 = {
|
106
106
|
"name": t50,
|
107
107
|
"total_payroll": acc58,
|
108
|
-
"manager_count":
|
109
|
-
"senior_count":
|
110
|
-
"top_salary":
|
108
|
+
"manager_count": acc66,
|
109
|
+
"senior_count": acc79,
|
110
|
+
"top_salary": acc92
|
111
111
|
};
|
112
112
|
out.push(t55);
|
113
113
|
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_d345f8b5098b438aa322a7ee8d0a4d26f7c84aa9e453db79a0466b672d60fe36
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -107,40 +107,40 @@ module Kumi::Compiled::KUMI_b02df7846ba29e94c8a665ca8d8aa1e248aea9154904c851bc61
|
|
107
107
|
def _department_summary(input = @input)
|
108
108
|
out = []
|
109
109
|
t47 = input["departments"] || input[:departments]
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
110
|
+
t71 = "manager"
|
111
|
+
t73 = 1
|
112
|
+
t74 = 0
|
113
|
+
t84 = "senior"
|
114
114
|
t47.each_with_index do |departments_el_48, departments_i_49|
|
115
115
|
t50 = departments_el_48["name"] || departments_el_48[:name]
|
116
116
|
acc58 = 0
|
117
117
|
t59 = departments_el_48["employees"] || departments_el_48[:employees]
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
t59.each_with_index do |
|
122
|
-
|
123
|
-
acc58 +=
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
118
|
+
acc66 = 0
|
119
|
+
acc79 = 0
|
120
|
+
acc92 = nil
|
121
|
+
t59.each_with_index do |t60, t61|
|
122
|
+
t62 = t60["salary"] || t60[:salary]
|
123
|
+
acc58 += t62
|
124
|
+
t70 = t60["role"] || t60[:role]
|
125
|
+
t72 = t70 == t71
|
126
|
+
t75 = t72 ? t73 : t74
|
127
|
+
acc66 += t75
|
128
|
+
acc92 ||= t62
|
129
|
+
acc92 = t62 if t62 > acc92
|
130
|
+
t85 = t70 == t84
|
131
|
+
t88 = t85 ? t73 : t74
|
132
|
+
acc79 += t88
|
133
133
|
end
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
134
|
+
t63 = acc58
|
135
|
+
t76 = acc66
|
136
|
+
t97 = acc92
|
137
|
+
t89 = acc79
|
138
138
|
t55 = {
|
139
139
|
"name" => t50,
|
140
|
-
"total_payroll" =>
|
141
|
-
"manager_count" =>
|
142
|
-
"senior_count" =>
|
143
|
-
"top_salary" =>
|
140
|
+
"total_payroll" => t63,
|
141
|
+
"manager_count" => t76,
|
142
|
+
"senior_count" => t89,
|
143
|
+
"top_salary" => t97
|
144
144
|
}
|
145
145
|
out << t55
|
146
146
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_2861f5d1d1e2c819036f9450880c9c966a10cf904bae70971a4845415ebaacf9
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -19,33 +19,33 @@
|
|
19
19
|
%t19 = load_input "regions" :: array
|
20
20
|
%acc21 = decl_acc :: integer
|
21
21
|
%t22 = load_field regions_el_12["sales"] :: any
|
22
|
-
loop sales id=L4 in %t22 as el=%
|
23
|
-
%
|
24
|
-
%acc21 = acc_add agg.sum(%acc21, %
|
22
|
+
loop sales id=L4 in %t22 as el=%t23, idx=%t24
|
23
|
+
%t25 = load_field t23["amount"] :: integer
|
24
|
+
%acc21 = acc_add agg.sum(%acc21, %t25) :: integer
|
25
25
|
end_loop
|
26
|
-
%
|
27
|
-
%acc_10 = acc_add agg.sum(%acc_10, %
|
26
|
+
%t26 = acc_load %acc21 :: integer
|
27
|
+
%acc_10 = acc_add agg.sum(%acc_10, %t26) :: integer
|
28
28
|
end_loop
|
29
29
|
%t15 = acc_load %acc_10 :: integer
|
30
30
|
yield %t15
|
31
31
|
)
|
32
32
|
(Declaration adjusted_total
|
33
|
-
%
|
34
|
-
%
|
35
|
-
loop regions id=L5 in %
|
36
|
-
%
|
37
|
-
%
|
38
|
-
%
|
39
|
-
loop sales id=L6 in %
|
40
|
-
%
|
41
|
-
%
|
33
|
+
%acc28 = decl_acc :: integer
|
34
|
+
%t29 = load_input "regions" :: array
|
35
|
+
loop regions id=L5 in %t29 as el=%t30, idx=%t31
|
36
|
+
%t34 = load_input "regions" :: array
|
37
|
+
%acc36 = decl_acc :: integer
|
38
|
+
%t37 = load_field t30["sales"] :: any
|
39
|
+
loop sales id=L6 in %t37 as el=%t38, idx=%t39
|
40
|
+
%t40 = load_field t38["amount"] :: integer
|
41
|
+
%acc36 = acc_add agg.sum(%acc36, %t40) :: integer
|
42
42
|
end_loop
|
43
|
-
%
|
44
|
-
%
|
43
|
+
%t41 = acc_load %acc36 :: integer
|
44
|
+
%acc28 = acc_add agg.sum(%acc28, %t41) :: integer
|
45
45
|
end_loop
|
46
|
-
%
|
46
|
+
%t33 = acc_load %acc28 :: integer
|
47
47
|
%t17 = load_input "adjustment" :: integer
|
48
|
-
%t18 = call core.add(%
|
48
|
+
%t18 = call core.add(%t33, %t17) :: integer
|
49
49
|
yield %t18
|
50
50
|
)
|
51
51
|
)
|