kumi 0.0.30 → 0.0.33
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 +21 -1
- data/README.md +31 -99
- data/data/kernels/ruby/core/arithmetic.yaml +2 -2
- data/docs/COMPOSED_SCHEMAS.md +137 -0
- data/docs/SCHEMA_IMPORTS.md +275 -0
- data/docs/SYNTAX.md +48 -0
- data/golden/array_element/expected/schema_ruby.rb +2 -27
- data/golden/array_index/expected/nast.txt +6 -6
- data/golden/array_index/expected/schema_ruby.rb +4 -31
- data/golden/array_operations/expected/lir_06_const_prop.txt +4 -8
- data/golden/array_operations/expected/schema_javascript.mjs +4 -8
- data/golden/array_operations/expected/schema_ruby.rb +10 -43
- data/golden/cascade_logic/expected/lir_06_const_prop.txt +7 -14
- data/golden/cascade_logic/expected/schema_javascript.mjs +7 -14
- data/golden/cascade_logic/expected/schema_ruby.rb +11 -45
- data/golden/chained_fusion/expected/lir_06_const_prop.txt +8 -18
- data/golden/chained_fusion/expected/schema_javascript.mjs +8 -18
- data/golden/chained_fusion/expected/schema_ruby.rb +14 -53
- data/golden/decimal_explicit/expected/schema_ruby.rb +4 -31
- data/golden/element_arrays/expected/lir_06_const_prop.txt +5 -11
- data/golden/element_arrays/expected/schema_javascript.mjs +5 -11
- data/golden/element_arrays/expected/schema_ruby.rb +13 -50
- data/golden/empty_and_null_inputs/expected/schema_ruby.rb +4 -31
- data/golden/example_xpto/expected/ast.txt +23 -0
- data/golden/example_xpto/expected/input_plan.txt +1 -0
- data/golden/example_xpto/expected/lir_00_unoptimized.txt +16 -0
- data/golden/example_xpto/expected/lir_01_hoist_scalar_references.txt +16 -0
- data/golden/example_xpto/expected/lir_02_inlined.txt +16 -0
- data/golden/example_xpto/expected/lir_03_cse.txt +16 -0
- data/golden/example_xpto/expected/lir_04_1_loop_fusion.txt +16 -0
- data/golden/example_xpto/expected/lir_04_loop_invcm.txt +16 -0
- data/golden/example_xpto/expected/lir_06_const_prop.txt +13 -0
- data/golden/example_xpto/expected/nast.txt +17 -0
- data/golden/example_xpto/expected/schema_javascript.mjs +13 -0
- data/golden/example_xpto/expected/schema_ruby.rb +13 -0
- data/golden/example_xpto/expected/snast.txt +17 -0
- data/golden/example_xpto/expected.json +4 -0
- data/golden/example_xpto/input.json +3 -0
- data/golden/example_xpto/schema.kumi +8 -0
- data/golden/function_overload/expected/schema_ruby.rb +2 -27
- data/golden/game_of_life/expected/lir_06_const_prop.txt +236 -287
- data/golden/game_of_life/expected/schema_javascript.mjs +32 -39
- data/golden/game_of_life/expected/schema_ruby.rb +34 -66
- data/golden/hash_keys/expected/lir_06_const_prop.txt +4 -10
- data/golden/hash_keys/expected/schema_javascript.mjs +6 -12
- data/golden/hash_keys/expected/schema_ruby.rb +8 -39
- data/golden/hash_value/expected/lir_06_const_prop.txt +3 -6
- data/golden/hash_value/expected/schema_javascript.mjs +3 -6
- data/golden/hash_value/expected/schema_ruby.rb +7 -37
- data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +9 -18
- data/golden/hierarchical_complex/expected/schema_javascript.mjs +9 -18
- data/golden/hierarchical_complex/expected/schema_ruby.rb +14 -51
- data/golden/inline_rename_scope_leak/expected/lir_06_const_prop.txt +2 -6
- data/golden/inline_rename_scope_leak/expected/schema_javascript.mjs +2 -6
- data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +7 -39
- data/golden/input_reference/expected/schema_ruby.rb +6 -35
- data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +6 -14
- data/golden/interleaved_fusion/expected/schema_javascript.mjs +6 -14
- data/golden/interleaved_fusion/expected/schema_ruby.rb +11 -47
- data/golden/let_inline/expected/lir_06_const_prop.txt +1 -2
- data/golden/let_inline/expected/schema_javascript.mjs +1 -2
- data/golden/let_inline/expected/schema_ruby.rb +3 -29
- data/golden/loop_fusion/expected/lir_06_const_prop.txt +4 -10
- data/golden/loop_fusion/expected/schema_javascript.mjs +4 -10
- data/golden/loop_fusion/expected/schema_ruby.rb +8 -41
- data/golden/min_reduce_scope/expected/lir_06_const_prop.txt +3 -6
- data/golden/min_reduce_scope/expected/schema_javascript.mjs +3 -6
- data/golden/min_reduce_scope/expected/schema_ruby.rb +8 -39
- data/golden/mixed_dimensions/expected/lir_06_const_prop.txt +1 -2
- data/golden/mixed_dimensions/expected/schema_javascript.mjs +1 -2
- data/golden/mixed_dimensions/expected/schema_ruby.rb +5 -33
- data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +9 -18
- data/golden/multirank_hoisting/expected/schema_javascript.mjs +9 -18
- data/golden/multirank_hoisting/expected/schema_ruby.rb +16 -55
- data/golden/nested_hash/expected/lir_06_const_prop.txt +1 -2
- data/golden/nested_hash/expected/schema_javascript.mjs +1 -2
- data/golden/nested_hash/expected/schema_ruby.rb +3 -29
- data/golden/reduction_broadcast/expected/schema_ruby.rb +5 -33
- data/golden/roll/expected/lir_06_const_prop.txt +8 -15
- data/golden/roll/expected/schema_javascript.mjs +8 -15
- data/golden/roll/expected/schema_ruby.rb +13 -48
- data/golden/schema_imports_broadcasting_with_imports/expected/ast.txt +26 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/input_plan.txt +5 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_00_unoptimized.txt +20 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_01_hoist_scalar_references.txt +20 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_02_inlined.txt +22 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_03_cse.txt +21 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_04_1_loop_fusion.txt +21 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_04_loop_invcm.txt +21 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_06_const_prop.txt +21 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/nast.txt +12 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/schema_javascript.mjs +22 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/schema_ruby.rb +24 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/snast.txt +12 -0
- data/golden/schema_imports_broadcasting_with_imports/expected.json +4 -0
- data/golden/schema_imports_broadcasting_with_imports/input.json +7 -0
- data/golden/schema_imports_broadcasting_with_imports/schema.kumi +14 -0
- data/golden/schema_imports_complex_order_calc/expected/ast.txt +82 -0
- data/golden/schema_imports_complex_order_calc/expected/input_plan.txt +16 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_00_unoptimized.txt +94 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_01_hoist_scalar_references.txt +94 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_02_inlined.txt +187 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_03_cse.txt +131 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_04_1_loop_fusion.txt +131 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_04_loop_invcm.txt +131 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_06_const_prop.txt +131 -0
- data/golden/schema_imports_complex_order_calc/expected/nast.txt +56 -0
- data/golden/schema_imports_complex_order_calc/expected/schema_javascript.mjs +147 -0
- data/golden/schema_imports_complex_order_calc/expected/schema_ruby.rb +149 -0
- data/golden/schema_imports_complex_order_calc/expected/snast.txt +56 -0
- data/golden/schema_imports_complex_order_calc/expected.json +12 -0
- data/golden/schema_imports_complex_order_calc/input.json +20 -0
- data/golden/schema_imports_complex_order_calc/schema.kumi +33 -0
- data/golden/schema_imports_composed_order/expected/ast.txt +33 -0
- data/golden/schema_imports_composed_order/expected/input_plan.txt +3 -0
- data/golden/schema_imports_composed_order/expected/lir_00_unoptimized.txt +25 -0
- data/golden/schema_imports_composed_order/expected/lir_01_hoist_scalar_references.txt +25 -0
- data/golden/schema_imports_composed_order/expected/lir_02_inlined.txt +33 -0
- data/golden/schema_imports_composed_order/expected/lir_03_cse.txt +33 -0
- data/golden/schema_imports_composed_order/expected/lir_04_1_loop_fusion.txt +33 -0
- data/golden/schema_imports_composed_order/expected/lir_04_loop_invcm.txt +33 -0
- data/golden/schema_imports_composed_order/expected/lir_06_const_prop.txt +33 -0
- data/golden/schema_imports_composed_order/expected/nast.txt +25 -0
- data/golden/schema_imports_composed_order/expected/schema_javascript.mjs +35 -0
- data/golden/schema_imports_composed_order/expected/schema_ruby.rb +33 -0
- data/golden/schema_imports_composed_order/expected/snast.txt +25 -0
- data/golden/schema_imports_composed_order/expected.json +6 -0
- data/golden/schema_imports_composed_order/input.json +5 -0
- data/golden/schema_imports_composed_order/schema.kumi +15 -0
- data/golden/schema_imports_discount_with_tax/expected/ast.txt +37 -0
- data/golden/schema_imports_discount_with_tax/expected/input_plan.txt +2 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_00_unoptimized.txt +30 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_01_hoist_scalar_references.txt +30 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_02_inlined.txt +37 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_03_cse.txt +34 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_04_1_loop_fusion.txt +34 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_04_loop_invcm.txt +34 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_06_const_prop.txt +34 -0
- data/golden/schema_imports_discount_with_tax/expected/nast.txt +30 -0
- data/golden/schema_imports_discount_with_tax/expected/schema_javascript.mjs +37 -0
- data/golden/schema_imports_discount_with_tax/expected/schema_ruby.rb +34 -0
- data/golden/schema_imports_discount_with_tax/expected/snast.txt +30 -0
- data/golden/schema_imports_discount_with_tax/expected.json +7 -0
- data/golden/schema_imports_discount_with_tax/input.json +4 -0
- data/golden/schema_imports_discount_with_tax/schema.kumi +15 -0
- data/golden/schema_imports_line_items/expected/ast.txt +35 -0
- data/golden/schema_imports_line_items/expected/input_plan.txt +8 -0
- data/golden/schema_imports_line_items/expected/lir_00_unoptimized.txt +19 -0
- data/golden/schema_imports_line_items/expected/lir_01_hoist_scalar_references.txt +19 -0
- data/golden/schema_imports_line_items/expected/lir_02_inlined.txt +24 -0
- data/golden/schema_imports_line_items/expected/lir_03_cse.txt +22 -0
- data/golden/schema_imports_line_items/expected/lir_04_1_loop_fusion.txt +22 -0
- data/golden/schema_imports_line_items/expected/lir_04_loop_invcm.txt +22 -0
- data/golden/schema_imports_line_items/expected/lir_06_const_prop.txt +22 -0
- data/golden/schema_imports_line_items/expected/nast.txt +19 -0
- data/golden/schema_imports_line_items/expected/schema_javascript.mjs +23 -0
- data/golden/schema_imports_line_items/expected/schema_ruby.rb +22 -0
- data/golden/schema_imports_line_items/expected/snast.txt +19 -0
- data/golden/schema_imports_line_items/expected.json +5 -0
- data/golden/schema_imports_line_items/input.json +13 -0
- data/golden/schema_imports_line_items/schema.kumi +17 -0
- data/golden/schema_imports_multiple/expected/ast.txt +35 -0
- data/golden/schema_imports_multiple/expected/input_plan.txt +2 -0
- data/golden/schema_imports_multiple/expected/lir_00_unoptimized.txt +29 -0
- data/golden/schema_imports_multiple/expected/lir_01_hoist_scalar_references.txt +29 -0
- data/golden/schema_imports_multiple/expected/lir_02_inlined.txt +41 -0
- data/golden/schema_imports_multiple/expected/lir_03_cse.txt +37 -0
- data/golden/schema_imports_multiple/expected/lir_04_1_loop_fusion.txt +37 -0
- data/golden/schema_imports_multiple/expected/lir_04_loop_invcm.txt +37 -0
- data/golden/schema_imports_multiple/expected/lir_06_const_prop.txt +37 -0
- data/golden/schema_imports_multiple/expected/nast.txt +28 -0
- data/golden/schema_imports_multiple/expected/schema_javascript.mjs +40 -0
- data/golden/schema_imports_multiple/expected/schema_ruby.rb +37 -0
- data/golden/schema_imports_multiple/expected/snast.txt +28 -0
- data/golden/schema_imports_multiple/expected.json +7 -0
- data/golden/schema_imports_multiple/input.json +4 -0
- data/golden/schema_imports_multiple/schema.kumi +15 -0
- data/golden/schema_imports_nested_expressions/expected/ast.txt +31 -0
- data/golden/schema_imports_nested_expressions/expected/input_plan.txt +3 -0
- data/golden/schema_imports_nested_expressions/expected/lir_00_unoptimized.txt +22 -0
- data/golden/schema_imports_nested_expressions/expected/lir_01_hoist_scalar_references.txt +22 -0
- data/golden/schema_imports_nested_expressions/expected/lir_02_inlined.txt +32 -0
- data/golden/schema_imports_nested_expressions/expected/lir_03_cse.txt +32 -0
- data/golden/schema_imports_nested_expressions/expected/lir_04_1_loop_fusion.txt +32 -0
- data/golden/schema_imports_nested_expressions/expected/lir_04_loop_invcm.txt +32 -0
- data/golden/schema_imports_nested_expressions/expected/lir_06_const_prop.txt +28 -0
- data/golden/schema_imports_nested_expressions/expected/nast.txt +23 -0
- data/golden/schema_imports_nested_expressions/expected/schema_javascript.mjs +29 -0
- data/golden/schema_imports_nested_expressions/expected/schema_ruby.rb +28 -0
- data/golden/schema_imports_nested_expressions/expected/snast.txt +23 -0
- data/golden/schema_imports_nested_expressions/expected.json +5 -0
- data/golden/schema_imports_nested_expressions/input.json +5 -0
- data/golden/schema_imports_nested_expressions/schema.kumi +13 -0
- data/golden/schema_imports_nested_with_reductions/expected/ast.txt +47 -0
- data/golden/schema_imports_nested_with_reductions/expected/input_plan.txt +12 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_00_unoptimized.txt +31 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_01_hoist_scalar_references.txt +31 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_02_inlined.txt +58 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_03_cse.txt +49 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_04_1_loop_fusion.txt +51 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_04_loop_invcm.txt +49 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_06_const_prop.txt +49 -0
- data/golden/schema_imports_nested_with_reductions/expected/nast.txt +23 -0
- data/golden/schema_imports_nested_with_reductions/expected/schema_javascript.mjs +49 -0
- data/golden/schema_imports_nested_with_reductions/expected/schema_ruby.rb +52 -0
- data/golden/schema_imports_nested_with_reductions/expected/snast.txt +23 -0
- data/golden/schema_imports_nested_with_reductions/expected.json +6 -0
- data/golden/schema_imports_nested_with_reductions/input.json +16 -0
- data/golden/schema_imports_nested_with_reductions/schema.kumi +23 -0
- data/golden/schema_imports_with_imports/expected/ast.txt +19 -0
- data/golden/schema_imports_with_imports/expected/input_plan.txt +1 -0
- data/golden/schema_imports_with_imports/expected/lir_00_unoptimized.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_01_hoist_scalar_references.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_02_inlined.txt +14 -0
- data/golden/schema_imports_with_imports/expected/lir_03_cse.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_04_1_loop_fusion.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_04_loop_invcm.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_06_const_prop.txt +13 -0
- data/golden/schema_imports_with_imports/expected/nast.txt +13 -0
- data/golden/schema_imports_with_imports/expected/schema_javascript.mjs +13 -0
- data/golden/schema_imports_with_imports/expected/schema_ruby.rb +13 -0
- data/golden/schema_imports_with_imports/expected/snast.txt +13 -0
- data/golden/schema_imports_with_imports/expected.json +4 -0
- data/golden/schema_imports_with_imports/input.json +3 -0
- data/golden/schema_imports_with_imports/schema.kumi +10 -0
- data/golden/shift/expected/lir_06_const_prop.txt +18 -30
- data/golden/shift/expected/schema_javascript.mjs +18 -30
- data/golden/shift/expected/schema_ruby.rb +25 -67
- data/golden/shift_2d/expected/lir_06_const_prop.txt +36 -60
- data/golden/shift_2d/expected/schema_javascript.mjs +36 -60
- data/golden/shift_2d/expected/schema_ruby.rb +49 -109
- data/golden/simple_math/expected/lir_06_const_prop.txt +3 -6
- data/golden/simple_math/expected/schema_javascript.mjs +3 -6
- data/golden/simple_math/expected/schema_ruby.rb +8 -39
- data/golden/streaming_basics/expected/lir_06_const_prop.txt +6 -12
- data/golden/streaming_basics/expected/schema_javascript.mjs +6 -12
- data/golden/streaming_basics/expected/schema_ruby.rb +14 -51
- data/golden/tuples/expected/lir_06_const_prop.txt +5 -22
- data/golden/tuples/expected/schema_javascript.mjs +5 -22
- data/golden/tuples/expected/schema_ruby.rb +11 -57
- data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +4 -8
- data/golden/tuples_and_arrays/expected/schema_javascript.mjs +4 -8
- data/golden/tuples_and_arrays/expected/schema_ruby.rb +9 -41
- data/golden/us_tax_2024/expected/lir_06_const_prop.txt +94 -171
- data/golden/us_tax_2024/expected/schema_javascript.mjs +13 -21
- data/golden/us_tax_2024/expected/schema_ruby.rb +15 -48
- data/golden/with_constants/expected/lir_06_const_prop.txt +3 -8
- data/golden/with_constants/expected/schema_javascript.mjs +3 -8
- data/golden/with_constants/expected/schema_ruby.rb +5 -35
- data/lib/kumi/analyzer.rb +8 -7
- data/lib/kumi/configuration.rb +7 -6
- data/lib/kumi/core/analyzer/passes/attach_anchors_pass.rb +1 -1
- data/lib/kumi/core/analyzer/passes/attach_terminal_info_pass.rb +1 -1
- data/lib/kumi/core/analyzer/passes/codegen/js/declaration_emitter.rb +20 -0
- data/lib/kumi/core/analyzer/passes/codegen/ruby/declaration_emitter.rb +16 -7
- data/lib/kumi/core/analyzer/passes/codegen/ruby/output_buffer.rb +3 -35
- data/lib/kumi/core/analyzer/passes/dependency_resolver.rb +6 -0
- data/lib/kumi/core/analyzer/passes/import_analysis_pass.rb +90 -0
- data/lib/kumi/core/analyzer/passes/lir/constant_propagation_pass.rb +77 -36
- data/lib/kumi/core/analyzer/passes/lir/lower_pass.rb +26 -11
- data/lib/kumi/core/analyzer/passes/name_indexer.rb +20 -2
- data/lib/kumi/core/analyzer/passes/nast_dimensional_analyzer_pass.rb +44 -0
- data/lib/kumi/core/analyzer/passes/normalize_to_nast_pass.rb +30 -0
- data/lib/kumi/core/analyzer/passes/semantic_constraint_validator.rb +5 -1
- data/lib/kumi/core/analyzer/passes/snast_pass.rb +15 -0
- data/lib/kumi/core/lir/build.rb +27 -0
- data/lib/kumi/core/lir/peephole.rb +164 -0
- data/lib/kumi/core/nast.rb +16 -0
- data/lib/kumi/core/ruby_parser/build_context.rb +3 -1
- data/lib/kumi/core/ruby_parser/parser.rb +1 -1
- data/lib/kumi/core/ruby_parser/schema_builder.rb +33 -3
- data/lib/kumi/dev/golden/result.rb +9 -3
- data/lib/kumi/dev/golden/runtime_test.rb +16 -1
- data/lib/kumi/dev/golden.rb +18 -20
- data/lib/kumi/dev/golden_schema_modules.rb +8 -0
- data/lib/kumi/dev/golden_schema_wrapper.rb +116 -0
- data/lib/kumi/dev/support/kumi_runner.mjs +18 -0
- data/lib/kumi/schema.rb +44 -2
- data/lib/kumi/support/lir_printer.rb +21 -5
- data/lib/kumi/support/nast_printer.rb +11 -0
- data/lib/kumi/support/s_expression_printer.rb +9 -0
- data/lib/kumi/support/snast_printer.rb +6 -0
- data/lib/kumi/syntax/import_call.rb +11 -0
- data/lib/kumi/syntax/import_declaration.rb +11 -0
- data/lib/kumi/syntax/root.rb +2 -2
- data/lib/kumi/test_shared_schemas/compound.rb +21 -0
- data/lib/kumi/test_shared_schemas/discount.rb +19 -0
- data/lib/kumi/test_shared_schemas/price.rb +19 -0
- data/lib/kumi/test_shared_schemas/subtotal.rb +22 -0
- data/lib/kumi/test_shared_schemas/tax.rb +18 -0
- data/lib/kumi/version.rb +1 -1
- data/lib/kumi.rb +19 -4
- metadata +176 -3
|
@@ -2,8 +2,6 @@ export function _shift_cols_right_zero(input) {
|
|
|
2
2
|
let out = [];
|
|
3
3
|
let t1 = input["rows"];
|
|
4
4
|
let t6 = t1.length;
|
|
5
|
-
const t12 = 1;
|
|
6
|
-
const t14 = 0;
|
|
7
5
|
t1.forEach((rows_el_2, rows_i_3) => {
|
|
8
6
|
let out_1 = [];
|
|
9
7
|
let t7 = ((rows_i_3 % t6) + t6) % t6;
|
|
@@ -11,15 +9,15 @@ export function _shift_cols_right_zero(input) {
|
|
|
11
9
|
let t9 = ((t8 % t6) + t6) % t6;
|
|
12
10
|
let t10 = t1[t9];
|
|
13
11
|
let t11 = t10.length;
|
|
14
|
-
let t19 = t11 -
|
|
12
|
+
let t19 = t11 - 1;
|
|
15
13
|
rows_el_2.forEach((col_el_4, col_i_5) => {
|
|
16
|
-
let t13 = col_i_5 -
|
|
17
|
-
let t15 = t13 >=
|
|
14
|
+
let t13 = col_i_5 - 1;
|
|
15
|
+
let t15 = t13 >= 0;
|
|
18
16
|
let t16 = t13 < t11;
|
|
19
17
|
let t17 = t15 && t16;
|
|
20
|
-
let t21 = Math.min(Math.max(t13,
|
|
18
|
+
let t21 = Math.min(Math.max(t13, 0), t19);
|
|
21
19
|
let t22 = t10[t21];
|
|
22
|
-
let t24 = t17 ? t22 :
|
|
20
|
+
let t24 = t17 ? t22 : 0;
|
|
23
21
|
out_1.push(t24);
|
|
24
22
|
});
|
|
25
23
|
out.push(out_1);
|
|
@@ -31,8 +29,6 @@ export function _shift_cols_right_clamp(input) {
|
|
|
31
29
|
let out = [];
|
|
32
30
|
let t25 = input["rows"];
|
|
33
31
|
let t30 = t25.length;
|
|
34
|
-
const t36 = 1;
|
|
35
|
-
const t40 = 0;
|
|
36
32
|
t25.forEach((rows_el_26, rows_i_27) => {
|
|
37
33
|
let out_1 = [];
|
|
38
34
|
let t31 = ((rows_i_27 % t30) + t30) % t30;
|
|
@@ -40,10 +36,10 @@ export function _shift_cols_right_clamp(input) {
|
|
|
40
36
|
let t33 = ((t32 % t30) + t30) % t30;
|
|
41
37
|
let t34 = t25[t33];
|
|
42
38
|
let t35 = t34.length;
|
|
43
|
-
let t39 = t35 -
|
|
39
|
+
let t39 = t35 - 1;
|
|
44
40
|
rows_el_26.forEach((col_el_28, col_i_29) => {
|
|
45
|
-
let t37 = col_i_29 -
|
|
46
|
-
let t41 = Math.min(Math.max(t37,
|
|
41
|
+
let t37 = col_i_29 - 1;
|
|
42
|
+
let t41 = Math.min(Math.max(t37, 0), t39);
|
|
47
43
|
let t42 = t34[t41];
|
|
48
44
|
out_1.push(t42);
|
|
49
45
|
});
|
|
@@ -56,7 +52,6 @@ export function _shift_cols_right_wrap(input) {
|
|
|
56
52
|
let out = [];
|
|
57
53
|
let t43 = input["rows"];
|
|
58
54
|
let t48 = t43.length;
|
|
59
|
-
const t54 = 1;
|
|
60
55
|
t43.forEach((rows_el_44, rows_i_45) => {
|
|
61
56
|
let out_1 = [];
|
|
62
57
|
let t49 = ((rows_i_45 % t48) + t48) % t48;
|
|
@@ -65,7 +60,7 @@ export function _shift_cols_right_wrap(input) {
|
|
|
65
60
|
let t52 = t43[t51];
|
|
66
61
|
let t53 = t52.length;
|
|
67
62
|
rows_el_44.forEach((col_el_46, col_i_47) => {
|
|
68
|
-
let t55 = col_i_47 -
|
|
63
|
+
let t55 = col_i_47 - 1;
|
|
69
64
|
let t56 = ((t55 % t53) + t53) % t53;
|
|
70
65
|
let t57 = t56 + t53;
|
|
71
66
|
let t58 = ((t57 % t53) + t53) % t53;
|
|
@@ -81,9 +76,6 @@ export function _shift_cols_left_zero(input) {
|
|
|
81
76
|
let out = [];
|
|
82
77
|
let t60 = input["rows"];
|
|
83
78
|
let t65 = t60.length;
|
|
84
|
-
const t71 = -1;
|
|
85
|
-
const t73 = 0;
|
|
86
|
-
const t77 = 1;
|
|
87
79
|
t60.forEach((rows_el_61, rows_i_62) => {
|
|
88
80
|
let out_1 = [];
|
|
89
81
|
let t66 = ((rows_i_62 % t65) + t65) % t65;
|
|
@@ -91,15 +83,15 @@ export function _shift_cols_left_zero(input) {
|
|
|
91
83
|
let t68 = ((t67 % t65) + t65) % t65;
|
|
92
84
|
let t69 = t60[t68];
|
|
93
85
|
let t70 = t69.length;
|
|
94
|
-
let t78 = t70 -
|
|
86
|
+
let t78 = t70 - 1;
|
|
95
87
|
rows_el_61.forEach((col_el_63, col_i_64) => {
|
|
96
|
-
let t72 = col_i_64 -
|
|
97
|
-
let t74 = t72 >=
|
|
88
|
+
let t72 = col_i_64 - -1;
|
|
89
|
+
let t74 = t72 >= 0;
|
|
98
90
|
let t75 = t72 < t70;
|
|
99
91
|
let t76 = t74 && t75;
|
|
100
|
-
let t80 = Math.min(Math.max(t72,
|
|
92
|
+
let t80 = Math.min(Math.max(t72, 0), t78);
|
|
101
93
|
let t81 = t69[t80];
|
|
102
|
-
let t83 = t76 ? t81 :
|
|
94
|
+
let t83 = t76 ? t81 : 0;
|
|
103
95
|
out_1.push(t83);
|
|
104
96
|
});
|
|
105
97
|
out.push(out_1);
|
|
@@ -111,9 +103,6 @@ export function _shift_cols_left_clamp(input) {
|
|
|
111
103
|
let out = [];
|
|
112
104
|
let t84 = input["rows"];
|
|
113
105
|
let t89 = t84.length;
|
|
114
|
-
const t95 = -1;
|
|
115
|
-
const t97 = 1;
|
|
116
|
-
const t99 = 0;
|
|
117
106
|
t84.forEach((rows_el_85, rows_i_86) => {
|
|
118
107
|
let out_1 = [];
|
|
119
108
|
let t90 = ((rows_i_86 % t89) + t89) % t89;
|
|
@@ -121,10 +110,10 @@ export function _shift_cols_left_clamp(input) {
|
|
|
121
110
|
let t92 = ((t91 % t89) + t89) % t89;
|
|
122
111
|
let t93 = t84[t92];
|
|
123
112
|
let t94 = t93.length;
|
|
124
|
-
let t98 = t94 -
|
|
113
|
+
let t98 = t94 - 1;
|
|
125
114
|
rows_el_85.forEach((col_el_87, col_i_88) => {
|
|
126
|
-
let t96 = col_i_88 -
|
|
127
|
-
let t100 = Math.min(Math.max(t96,
|
|
115
|
+
let t96 = col_i_88 - -1;
|
|
116
|
+
let t100 = Math.min(Math.max(t96, 0), t98);
|
|
128
117
|
let t101 = t93[t100];
|
|
129
118
|
out_1.push(t101);
|
|
130
119
|
});
|
|
@@ -137,7 +126,6 @@ export function _shift_cols_left_wrap(input) {
|
|
|
137
126
|
let out = [];
|
|
138
127
|
let t102 = input["rows"];
|
|
139
128
|
let t107 = t102.length;
|
|
140
|
-
const t113 = -1;
|
|
141
129
|
t102.forEach((rows_el_103, rows_i_104) => {
|
|
142
130
|
let out_1 = [];
|
|
143
131
|
let t108 = ((rows_i_104 % t107) + t107) % t107;
|
|
@@ -146,7 +134,7 @@ export function _shift_cols_left_wrap(input) {
|
|
|
146
134
|
let t111 = t102[t110];
|
|
147
135
|
let t112 = t111.length;
|
|
148
136
|
rows_el_103.forEach((col_el_105, col_i_106) => {
|
|
149
|
-
let t114 = col_i_106 -
|
|
137
|
+
let t114 = col_i_106 - -1;
|
|
150
138
|
let t115 = ((t114 % t112) + t112) % t112;
|
|
151
139
|
let t116 = t115 + t112;
|
|
152
140
|
let t117 = ((t116 % t112) + t112) % t112;
|
|
@@ -162,15 +150,13 @@ export function _shift_rows_down_zero(input) {
|
|
|
162
150
|
let out = [];
|
|
163
151
|
let t119 = input["rows"];
|
|
164
152
|
let t124 = t119.length;
|
|
165
|
-
|
|
166
|
-
const t127 = 0;
|
|
167
|
-
let t132 = t124 - t125;
|
|
153
|
+
let t132 = t124 - 1;
|
|
168
154
|
t119.forEach((rows_el_120, rows_i_121) => {
|
|
169
155
|
let out_1 = [];
|
|
170
|
-
let t126 = rows_i_121 -
|
|
171
|
-
let t128 = t126 >=
|
|
156
|
+
let t126 = rows_i_121 - 1;
|
|
157
|
+
let t128 = t126 >= 0;
|
|
172
158
|
let t129 = t126 < t124;
|
|
173
|
-
let t134 = Math.min(Math.max(t126,
|
|
159
|
+
let t134 = Math.min(Math.max(t126, 0), t132);
|
|
174
160
|
let t130 = t128 && t129;
|
|
175
161
|
let t135 = t119[t134];
|
|
176
162
|
let t136 = t135.length;
|
|
@@ -179,7 +165,7 @@ export function _shift_rows_down_zero(input) {
|
|
|
179
165
|
let t138 = t137 + t136;
|
|
180
166
|
let t139 = ((t138 % t136) + t136) % t136;
|
|
181
167
|
let t140 = t135[t139];
|
|
182
|
-
let t142 = t130 ? t140 :
|
|
168
|
+
let t142 = t130 ? t140 : 0;
|
|
183
169
|
out_1.push(t142);
|
|
184
170
|
});
|
|
185
171
|
out.push(out_1);
|
|
@@ -191,13 +177,11 @@ export function _shift_rows_down_clamp(input) {
|
|
|
191
177
|
let out = [];
|
|
192
178
|
let t143 = input["rows"];
|
|
193
179
|
let t148 = t143.length;
|
|
194
|
-
|
|
195
|
-
const t153 = 0;
|
|
196
|
-
let t152 = t148 - t149;
|
|
180
|
+
let t152 = t148 - 1;
|
|
197
181
|
t143.forEach((rows_el_144, rows_i_145) => {
|
|
198
182
|
let out_1 = [];
|
|
199
|
-
let t150 = rows_i_145 -
|
|
200
|
-
let t154 = Math.min(Math.max(t150,
|
|
183
|
+
let t150 = rows_i_145 - 1;
|
|
184
|
+
let t154 = Math.min(Math.max(t150, 0), t152);
|
|
201
185
|
let t155 = t143[t154];
|
|
202
186
|
let t156 = t155.length;
|
|
203
187
|
rows_el_144.forEach((col_el_146, col_i_147) => {
|
|
@@ -216,10 +200,9 @@ export function _shift_rows_down_wrap(input) {
|
|
|
216
200
|
let out = [];
|
|
217
201
|
let t161 = input["rows"];
|
|
218
202
|
let t166 = t161.length;
|
|
219
|
-
const t167 = 1;
|
|
220
203
|
t161.forEach((rows_el_162, rows_i_163) => {
|
|
221
204
|
let out_1 = [];
|
|
222
|
-
let t168 = rows_i_163 -
|
|
205
|
+
let t168 = rows_i_163 - 1;
|
|
223
206
|
let t169 = ((t168 % t166) + t166) % t166;
|
|
224
207
|
let t170 = t169 + t166;
|
|
225
208
|
let t171 = ((t170 % t166) + t166) % t166;
|
|
@@ -241,16 +224,13 @@ export function _shift_rows_up_zero(input) {
|
|
|
241
224
|
let out = [];
|
|
242
225
|
let t178 = input["rows"];
|
|
243
226
|
let t183 = t178.length;
|
|
244
|
-
|
|
245
|
-
const t186 = 0;
|
|
246
|
-
const t190 = 1;
|
|
247
|
-
let t191 = t183 - t190;
|
|
227
|
+
let t191 = t183 - 1;
|
|
248
228
|
t178.forEach((rows_el_179, rows_i_180) => {
|
|
249
229
|
let out_1 = [];
|
|
250
|
-
let t185 = rows_i_180 -
|
|
251
|
-
let t187 = t185 >=
|
|
230
|
+
let t185 = rows_i_180 - -1;
|
|
231
|
+
let t187 = t185 >= 0;
|
|
252
232
|
let t188 = t185 < t183;
|
|
253
|
-
let t193 = Math.min(Math.max(t185,
|
|
233
|
+
let t193 = Math.min(Math.max(t185, 0), t191);
|
|
254
234
|
let t189 = t187 && t188;
|
|
255
235
|
let t194 = t178[t193];
|
|
256
236
|
let t195 = t194.length;
|
|
@@ -259,7 +239,7 @@ export function _shift_rows_up_zero(input) {
|
|
|
259
239
|
let t197 = t196 + t195;
|
|
260
240
|
let t198 = ((t197 % t195) + t195) % t195;
|
|
261
241
|
let t199 = t194[t198];
|
|
262
|
-
let t201 = t189 ? t199 :
|
|
242
|
+
let t201 = t189 ? t199 : 0;
|
|
263
243
|
out_1.push(t201);
|
|
264
244
|
});
|
|
265
245
|
out.push(out_1);
|
|
@@ -271,14 +251,11 @@ export function _shift_rows_up_clamp(input) {
|
|
|
271
251
|
let out = [];
|
|
272
252
|
let t202 = input["rows"];
|
|
273
253
|
let t207 = t202.length;
|
|
274
|
-
|
|
275
|
-
const t210 = 1;
|
|
276
|
-
const t212 = 0;
|
|
277
|
-
let t211 = t207 - t210;
|
|
254
|
+
let t211 = t207 - 1;
|
|
278
255
|
t202.forEach((rows_el_203, rows_i_204) => {
|
|
279
256
|
let out_1 = [];
|
|
280
|
-
let t209 = rows_i_204 -
|
|
281
|
-
let t213 = Math.min(Math.max(t209,
|
|
257
|
+
let t209 = rows_i_204 - -1;
|
|
258
|
+
let t213 = Math.min(Math.max(t209, 0), t211);
|
|
282
259
|
let t214 = t202[t213];
|
|
283
260
|
let t215 = t214.length;
|
|
284
261
|
rows_el_203.forEach((col_el_205, col_i_206) => {
|
|
@@ -297,10 +274,9 @@ export function _shift_rows_up_wrap(input) {
|
|
|
297
274
|
let out = [];
|
|
298
275
|
let t220 = input["rows"];
|
|
299
276
|
let t225 = t220.length;
|
|
300
|
-
const t226 = -1;
|
|
301
277
|
t220.forEach((rows_el_221, rows_i_222) => {
|
|
302
278
|
let out_1 = [];
|
|
303
|
-
let t227 = rows_i_222 -
|
|
279
|
+
let t227 = rows_i_222 - -1;
|
|
304
280
|
let t228 = ((t227 % t225) + t225) % t225;
|
|
305
281
|
let t229 = t228 + t225;
|
|
306
282
|
let t230 = ((t229 % t225) + t225) % t225;
|
|
@@ -1,47 +1,9 @@
|
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
|
2
|
-
module Kumi::Compiled::
|
|
3
|
-
def self.
|
|
4
|
-
instance = Object.new
|
|
5
|
-
instance.extend(self)
|
|
6
|
-
instance.instance_variable_set(:@input, input_data)
|
|
7
|
-
instance
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def self.__kumi_executable__
|
|
11
|
-
instance = Object.new
|
|
12
|
-
instance.extend(self)
|
|
13
|
-
instance
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def update(input_data)
|
|
17
|
-
@input = @input.merge(input_data)
|
|
18
|
-
self
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def [](name)
|
|
22
|
-
case name
|
|
23
|
-
when :shift_cols_right_zero then _shift_cols_right_zero
|
|
24
|
-
when :shift_cols_right_clamp then _shift_cols_right_clamp
|
|
25
|
-
when :shift_cols_right_wrap then _shift_cols_right_wrap
|
|
26
|
-
when :shift_cols_left_zero then _shift_cols_left_zero
|
|
27
|
-
when :shift_cols_left_clamp then _shift_cols_left_clamp
|
|
28
|
-
when :shift_cols_left_wrap then _shift_cols_left_wrap
|
|
29
|
-
when :shift_rows_down_zero then _shift_rows_down_zero
|
|
30
|
-
when :shift_rows_down_clamp then _shift_rows_down_clamp
|
|
31
|
-
when :shift_rows_down_wrap then _shift_rows_down_wrap
|
|
32
|
-
when :shift_rows_up_zero then _shift_rows_up_zero
|
|
33
|
-
when :shift_rows_up_clamp then _shift_rows_up_clamp
|
|
34
|
-
when :shift_rows_up_wrap then _shift_rows_up_wrap
|
|
35
|
-
else raise KeyError, "Unknown declaration"
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def _shift_cols_right_zero(input = @input)
|
|
2
|
+
module Kumi::Compiled::KUMI_39915a52a4abc0f2d10a8e072980da3dd31c749a858be2e47fe616306f0809ed
|
|
3
|
+
def self._shift_cols_right_zero(input)
|
|
40
4
|
out = []
|
|
41
5
|
t1 = input["rows"] || input[:rows]
|
|
42
6
|
t6 = t1.length
|
|
43
|
-
t12 = 1
|
|
44
|
-
t14 = 0
|
|
45
7
|
t1.each_with_index do |rows_el_2, rows_i_3|
|
|
46
8
|
out_1 = []
|
|
47
9
|
t7 = rows_i_3 % t6
|
|
@@ -49,15 +11,15 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
49
11
|
t9 = t8 % t6
|
|
50
12
|
t10 = t1[t9]
|
|
51
13
|
t11 = t10.length
|
|
52
|
-
t19 = t11 -
|
|
14
|
+
t19 = t11 - 1
|
|
53
15
|
rows_el_2.each_with_index do |col_el_4, col_i_5|
|
|
54
|
-
t13 = col_i_5 -
|
|
55
|
-
t15 = t13 >=
|
|
16
|
+
t13 = col_i_5 - 1
|
|
17
|
+
t15 = t13 >= 0
|
|
56
18
|
t16 = t13 < t11
|
|
57
19
|
t17 = t15 && t16
|
|
58
|
-
t21 =
|
|
20
|
+
t21 = t13.clamp(0, t19)
|
|
59
21
|
t22 = t10[t21]
|
|
60
|
-
t24 = t17 ? t22 :
|
|
22
|
+
t24 = t17 ? t22 : 0
|
|
61
23
|
out_1 << t24
|
|
62
24
|
end
|
|
63
25
|
out << out_1
|
|
@@ -65,12 +27,10 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
65
27
|
out
|
|
66
28
|
end
|
|
67
29
|
|
|
68
|
-
def _shift_cols_right_clamp(input
|
|
30
|
+
def self._shift_cols_right_clamp(input)
|
|
69
31
|
out = []
|
|
70
32
|
t25 = input["rows"] || input[:rows]
|
|
71
33
|
t30 = t25.length
|
|
72
|
-
t36 = 1
|
|
73
|
-
t40 = 0
|
|
74
34
|
t25.each_with_index do |rows_el_26, rows_i_27|
|
|
75
35
|
out_1 = []
|
|
76
36
|
t31 = rows_i_27 % t30
|
|
@@ -78,10 +38,10 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
78
38
|
t33 = t32 % t30
|
|
79
39
|
t34 = t25[t33]
|
|
80
40
|
t35 = t34.length
|
|
81
|
-
t39 = t35 -
|
|
41
|
+
t39 = t35 - 1
|
|
82
42
|
rows_el_26.each_with_index do |col_el_28, col_i_29|
|
|
83
|
-
t37 = col_i_29 -
|
|
84
|
-
t41 =
|
|
43
|
+
t37 = col_i_29 - 1
|
|
44
|
+
t41 = t37.clamp(0, t39)
|
|
85
45
|
t42 = t34[t41]
|
|
86
46
|
out_1 << t42
|
|
87
47
|
end
|
|
@@ -90,11 +50,10 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
90
50
|
out
|
|
91
51
|
end
|
|
92
52
|
|
|
93
|
-
def _shift_cols_right_wrap(input
|
|
53
|
+
def self._shift_cols_right_wrap(input)
|
|
94
54
|
out = []
|
|
95
55
|
t43 = input["rows"] || input[:rows]
|
|
96
56
|
t48 = t43.length
|
|
97
|
-
t54 = 1
|
|
98
57
|
t43.each_with_index do |rows_el_44, rows_i_45|
|
|
99
58
|
out_1 = []
|
|
100
59
|
t49 = rows_i_45 % t48
|
|
@@ -103,7 +62,7 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
103
62
|
t52 = t43[t51]
|
|
104
63
|
t53 = t52.length
|
|
105
64
|
rows_el_44.each_with_index do |col_el_46, col_i_47|
|
|
106
|
-
t55 = col_i_47 -
|
|
65
|
+
t55 = col_i_47 - 1
|
|
107
66
|
t56 = t55 % t53
|
|
108
67
|
t57 = t56 + t53
|
|
109
68
|
t58 = t57 % t53
|
|
@@ -115,13 +74,10 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
115
74
|
out
|
|
116
75
|
end
|
|
117
76
|
|
|
118
|
-
def _shift_cols_left_zero(input
|
|
77
|
+
def self._shift_cols_left_zero(input)
|
|
119
78
|
out = []
|
|
120
79
|
t60 = input["rows"] || input[:rows]
|
|
121
80
|
t65 = t60.length
|
|
122
|
-
t71 = -1
|
|
123
|
-
t73 = 0
|
|
124
|
-
t77 = 1
|
|
125
81
|
t60.each_with_index do |rows_el_61, rows_i_62|
|
|
126
82
|
out_1 = []
|
|
127
83
|
t66 = rows_i_62 % t65
|
|
@@ -129,15 +85,15 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
129
85
|
t68 = t67 % t65
|
|
130
86
|
t69 = t60[t68]
|
|
131
87
|
t70 = t69.length
|
|
132
|
-
t78 = t70 -
|
|
88
|
+
t78 = t70 - 1
|
|
133
89
|
rows_el_61.each_with_index do |col_el_63, col_i_64|
|
|
134
|
-
t72 = col_i_64 -
|
|
135
|
-
t74 = t72 >=
|
|
90
|
+
t72 = col_i_64 - -1
|
|
91
|
+
t74 = t72 >= 0
|
|
136
92
|
t75 = t72 < t70
|
|
137
93
|
t76 = t74 && t75
|
|
138
|
-
t80 =
|
|
94
|
+
t80 = t72.clamp(0, t78)
|
|
139
95
|
t81 = t69[t80]
|
|
140
|
-
t83 = t76 ? t81 :
|
|
96
|
+
t83 = t76 ? t81 : 0
|
|
141
97
|
out_1 << t83
|
|
142
98
|
end
|
|
143
99
|
out << out_1
|
|
@@ -145,13 +101,10 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
145
101
|
out
|
|
146
102
|
end
|
|
147
103
|
|
|
148
|
-
def _shift_cols_left_clamp(input
|
|
104
|
+
def self._shift_cols_left_clamp(input)
|
|
149
105
|
out = []
|
|
150
106
|
t84 = input["rows"] || input[:rows]
|
|
151
107
|
t89 = t84.length
|
|
152
|
-
t95 = -1
|
|
153
|
-
t97 = 1
|
|
154
|
-
t99 = 0
|
|
155
108
|
t84.each_with_index do |rows_el_85, rows_i_86|
|
|
156
109
|
out_1 = []
|
|
157
110
|
t90 = rows_i_86 % t89
|
|
@@ -159,10 +112,10 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
159
112
|
t92 = t91 % t89
|
|
160
113
|
t93 = t84[t92]
|
|
161
114
|
t94 = t93.length
|
|
162
|
-
t98 = t94 -
|
|
115
|
+
t98 = t94 - 1
|
|
163
116
|
rows_el_85.each_with_index do |col_el_87, col_i_88|
|
|
164
|
-
t96 = col_i_88 -
|
|
165
|
-
t100 =
|
|
117
|
+
t96 = col_i_88 - -1
|
|
118
|
+
t100 = t96.clamp(0, t98)
|
|
166
119
|
t101 = t93[t100]
|
|
167
120
|
out_1 << t101
|
|
168
121
|
end
|
|
@@ -171,11 +124,10 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
171
124
|
out
|
|
172
125
|
end
|
|
173
126
|
|
|
174
|
-
def _shift_cols_left_wrap(input
|
|
127
|
+
def self._shift_cols_left_wrap(input)
|
|
175
128
|
out = []
|
|
176
129
|
t102 = input["rows"] || input[:rows]
|
|
177
130
|
t107 = t102.length
|
|
178
|
-
t113 = -1
|
|
179
131
|
t102.each_with_index do |rows_el_103, rows_i_104|
|
|
180
132
|
out_1 = []
|
|
181
133
|
t108 = rows_i_104 % t107
|
|
@@ -184,7 +136,7 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
184
136
|
t111 = t102[t110]
|
|
185
137
|
t112 = t111.length
|
|
186
138
|
rows_el_103.each_with_index do |col_el_105, col_i_106|
|
|
187
|
-
t114 = col_i_106 -
|
|
139
|
+
t114 = col_i_106 - -1
|
|
188
140
|
t115 = t114 % t112
|
|
189
141
|
t116 = t115 + t112
|
|
190
142
|
t117 = t116 % t112
|
|
@@ -196,19 +148,17 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
196
148
|
out
|
|
197
149
|
end
|
|
198
150
|
|
|
199
|
-
def _shift_rows_down_zero(input
|
|
151
|
+
def self._shift_rows_down_zero(input)
|
|
200
152
|
out = []
|
|
201
153
|
t119 = input["rows"] || input[:rows]
|
|
202
154
|
t124 = t119.length
|
|
203
|
-
|
|
204
|
-
t127 = 0
|
|
205
|
-
t132 = t124 - t125
|
|
155
|
+
t132 = t124 - 1
|
|
206
156
|
t119.each_with_index do |rows_el_120, rows_i_121|
|
|
207
157
|
out_1 = []
|
|
208
|
-
t126 = rows_i_121 -
|
|
209
|
-
t128 = t126 >=
|
|
158
|
+
t126 = rows_i_121 - 1
|
|
159
|
+
t128 = t126 >= 0
|
|
210
160
|
t129 = t126 < t124
|
|
211
|
-
t134 =
|
|
161
|
+
t134 = t126.clamp(0, t132)
|
|
212
162
|
t130 = t128 && t129
|
|
213
163
|
t135 = t119[t134]
|
|
214
164
|
t136 = t135.length
|
|
@@ -217,7 +167,7 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
217
167
|
t138 = t137 + t136
|
|
218
168
|
t139 = t138 % t136
|
|
219
169
|
t140 = t135[t139]
|
|
220
|
-
t142 = t130 ? t140 :
|
|
170
|
+
t142 = t130 ? t140 : 0
|
|
221
171
|
out_1 << t142
|
|
222
172
|
end
|
|
223
173
|
out << out_1
|
|
@@ -225,17 +175,15 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
225
175
|
out
|
|
226
176
|
end
|
|
227
177
|
|
|
228
|
-
def _shift_rows_down_clamp(input
|
|
178
|
+
def self._shift_rows_down_clamp(input)
|
|
229
179
|
out = []
|
|
230
180
|
t143 = input["rows"] || input[:rows]
|
|
231
181
|
t148 = t143.length
|
|
232
|
-
|
|
233
|
-
t153 = 0
|
|
234
|
-
t152 = t148 - t149
|
|
182
|
+
t152 = t148 - 1
|
|
235
183
|
t143.each_with_index do |rows_el_144, rows_i_145|
|
|
236
184
|
out_1 = []
|
|
237
|
-
t150 = rows_i_145 -
|
|
238
|
-
t154 =
|
|
185
|
+
t150 = rows_i_145 - 1
|
|
186
|
+
t154 = t150.clamp(0, t152)
|
|
239
187
|
t155 = t143[t154]
|
|
240
188
|
t156 = t155.length
|
|
241
189
|
rows_el_144.each_with_index do |col_el_146, col_i_147|
|
|
@@ -250,14 +198,13 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
250
198
|
out
|
|
251
199
|
end
|
|
252
200
|
|
|
253
|
-
def _shift_rows_down_wrap(input
|
|
201
|
+
def self._shift_rows_down_wrap(input)
|
|
254
202
|
out = []
|
|
255
203
|
t161 = input["rows"] || input[:rows]
|
|
256
204
|
t166 = t161.length
|
|
257
|
-
t167 = 1
|
|
258
205
|
t161.each_with_index do |rows_el_162, rows_i_163|
|
|
259
206
|
out_1 = []
|
|
260
|
-
t168 = rows_i_163 -
|
|
207
|
+
t168 = rows_i_163 - 1
|
|
261
208
|
t169 = t168 % t166
|
|
262
209
|
t170 = t169 + t166
|
|
263
210
|
t171 = t170 % t166
|
|
@@ -275,20 +222,17 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
275
222
|
out
|
|
276
223
|
end
|
|
277
224
|
|
|
278
|
-
def _shift_rows_up_zero(input
|
|
225
|
+
def self._shift_rows_up_zero(input)
|
|
279
226
|
out = []
|
|
280
227
|
t178 = input["rows"] || input[:rows]
|
|
281
228
|
t183 = t178.length
|
|
282
|
-
|
|
283
|
-
t186 = 0
|
|
284
|
-
t190 = 1
|
|
285
|
-
t191 = t183 - t190
|
|
229
|
+
t191 = t183 - 1
|
|
286
230
|
t178.each_with_index do |rows_el_179, rows_i_180|
|
|
287
231
|
out_1 = []
|
|
288
|
-
t185 = rows_i_180 -
|
|
289
|
-
t187 = t185 >=
|
|
232
|
+
t185 = rows_i_180 - -1
|
|
233
|
+
t187 = t185 >= 0
|
|
290
234
|
t188 = t185 < t183
|
|
291
|
-
t193 =
|
|
235
|
+
t193 = t185.clamp(0, t191)
|
|
292
236
|
t189 = t187 && t188
|
|
293
237
|
t194 = t178[t193]
|
|
294
238
|
t195 = t194.length
|
|
@@ -297,7 +241,7 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
297
241
|
t197 = t196 + t195
|
|
298
242
|
t198 = t197 % t195
|
|
299
243
|
t199 = t194[t198]
|
|
300
|
-
t201 = t189 ? t199 :
|
|
244
|
+
t201 = t189 ? t199 : 0
|
|
301
245
|
out_1 << t201
|
|
302
246
|
end
|
|
303
247
|
out << out_1
|
|
@@ -305,18 +249,15 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
305
249
|
out
|
|
306
250
|
end
|
|
307
251
|
|
|
308
|
-
def _shift_rows_up_clamp(input
|
|
252
|
+
def self._shift_rows_up_clamp(input)
|
|
309
253
|
out = []
|
|
310
254
|
t202 = input["rows"] || input[:rows]
|
|
311
255
|
t207 = t202.length
|
|
312
|
-
|
|
313
|
-
t210 = 1
|
|
314
|
-
t212 = 0
|
|
315
|
-
t211 = t207 - t210
|
|
256
|
+
t211 = t207 - 1
|
|
316
257
|
t202.each_with_index do |rows_el_203, rows_i_204|
|
|
317
258
|
out_1 = []
|
|
318
|
-
t209 = rows_i_204 -
|
|
319
|
-
t213 =
|
|
259
|
+
t209 = rows_i_204 - -1
|
|
260
|
+
t213 = t209.clamp(0, t211)
|
|
320
261
|
t214 = t202[t213]
|
|
321
262
|
t215 = t214.length
|
|
322
263
|
rows_el_203.each_with_index do |col_el_205, col_i_206|
|
|
@@ -331,14 +272,13 @@ module Kumi::Compiled::KUMI_10a8c4eef85aad586921c958580baafbe11b5bd9ca21b75e678a
|
|
|
331
272
|
out
|
|
332
273
|
end
|
|
333
274
|
|
|
334
|
-
def _shift_rows_up_wrap(input
|
|
275
|
+
def self._shift_rows_up_wrap(input)
|
|
335
276
|
out = []
|
|
336
277
|
t220 = input["rows"] || input[:rows]
|
|
337
278
|
t225 = t220.length
|
|
338
|
-
t226 = -1
|
|
339
279
|
t220.each_with_index do |rows_el_221, rows_i_222|
|
|
340
280
|
out_1 = []
|
|
341
|
-
t227 = rows_i_222 -
|
|
281
|
+
t227 = rows_i_222 - -1
|
|
342
282
|
t228 = t227 % t225
|
|
343
283
|
t229 = t228 + t225
|
|
344
284
|
t230 = t229 % t225
|
|
@@ -18,14 +18,11 @@
|
|
|
18
18
|
yield %t9
|
|
19
19
|
)
|
|
20
20
|
(Declaration results_array
|
|
21
|
-
%t10 = const 1 :: integer
|
|
22
21
|
%t11 = load_input "x" :: integer
|
|
23
|
-
%
|
|
24
|
-
%t13 = call core.add(%t11, %t12) :: integer
|
|
22
|
+
%t13 = call core.add(%t11, 10) :: integer
|
|
25
23
|
%t14 = load_input "y" :: integer
|
|
26
|
-
%
|
|
27
|
-
%
|
|
28
|
-
%t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer, integer, integer>
|
|
24
|
+
%t16 = call core.mul:numeric(%t14, 2) :: integer
|
|
25
|
+
%t17 = make_tuple(%__immediate_placeholder__, %t13, %t16) :: tuple<integer, integer, integer>
|
|
29
26
|
yield %t17
|
|
30
27
|
)
|
|
31
28
|
)
|
|
@@ -20,14 +20,11 @@ export function _difference(input) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export function _results_array(input) {
|
|
23
|
-
const t10 = 1;
|
|
24
23
|
let t11 = input["x"];
|
|
25
|
-
|
|
26
|
-
let t13 = t11 + t12;
|
|
24
|
+
let t13 = t11 + 10;
|
|
27
25
|
let t14 = input["y"];
|
|
28
|
-
|
|
29
|
-
let
|
|
30
|
-
let t17 = [t10, t13, t16];
|
|
26
|
+
let t16 = t14 * 2;
|
|
27
|
+
let t17 = [1, t13, t16];
|
|
31
28
|
return t17;
|
|
32
29
|
}
|
|
33
30
|
|