kumi 0.0.18 → 0.0.20
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/.rubocop.yml +4 -1
- data/.ruby-version +1 -0
- data/CHANGELOG.md +27 -0
- data/CLAUDE.md +26 -139
- data/README.md +143 -372
- data/data/functions/agg/boolean.yaml +14 -0
- data/data/functions/agg/numeric.yaml +80 -0
- data/data/functions/agg/string.yaml +8 -0
- data/data/functions/core/arithmetic.yaml +50 -0
- data/data/functions/core/boolean.yaml +18 -0
- data/data/functions/core/comparison.yaml +42 -0
- data/data/functions/core/constructor.yaml +32 -0
- data/data/functions/core/select.yaml +7 -0
- data/data/functions/core/stencil.yaml +21 -0
- data/data/functions/core/string.yaml +19 -0
- data/data/kernels/javascript/agg/boolean.yaml +12 -0
- data/data/kernels/javascript/agg/numeric.yaml +27 -0
- data/data/kernels/javascript/agg/string.yaml +5 -0
- data/data/kernels/javascript/core/arithmetic.yaml +32 -0
- data/data/kernels/javascript/core/boolean.yaml +12 -0
- data/data/kernels/javascript/core/comparison.yaml +24 -0
- data/data/kernels/javascript/core/constructor.yaml +15 -0
- data/data/kernels/javascript/core/select.yaml +7 -0
- data/data/kernels/javascript/core/string.yaml +12 -0
- data/data/kernels/ruby/agg/boolean.yaml +18 -0
- data/data/kernels/ruby/agg/numeric.yaml +29 -0
- data/data/kernels/ruby/agg/string.yaml +5 -0
- data/data/kernels/ruby/core/arithmetic.yaml +38 -0
- data/data/kernels/ruby/core/boolean.yaml +15 -0
- data/data/kernels/ruby/core/comparison.yaml +30 -0
- data/data/kernels/ruby/core/constructor.yaml +17 -0
- data/data/kernels/ruby/core/select.yaml +4 -0
- data/data/kernels/ruby/core/string.yaml +15 -0
- data/debug_ordering.rb +52 -0
- data/docs/FORM_SCHEMA.md +85 -0
- data/docs/OUTPUT_SCHEMA.md +69 -0
- data/docs/SYNTAX.md +626 -373
- data/golden/array_element/expected/ast.txt +21 -0
- data/golden/array_element/expected/input_plan.txt +5 -0
- data/golden/array_element/expected/lir_00_unoptimized.txt +13 -0
- data/golden/array_element/expected/lir_01_hoist_scalar_references.txt +13 -0
- data/golden/array_element/expected/lir_02_inlined.txt +13 -0
- data/golden/array_element/expected/lir_03_cse.txt +13 -0
- data/golden/array_element/expected/lir_04_1_loop_fusion.txt +13 -0
- data/golden/array_element/expected/lir_04_loop_invcm.txt +13 -0
- data/golden/array_element/expected/lir_06_const_prop.txt +13 -0
- data/golden/array_element/expected/nast.txt +7 -0
- data/golden/array_element/expected/schema_javascript.mjs +13 -0
- data/golden/array_element/expected/schema_ruby.rb +41 -0
- data/golden/array_element/expected/snast.txt +7 -0
- data/golden/array_element/expected.json +5 -0
- data/golden/array_element/input.json +9 -0
- data/golden/array_element/schema.kumi +11 -0
- data/golden/array_index/expected/ast.txt +59 -0
- data/golden/array_index/expected/input_plan.txt +5 -0
- data/golden/array_index/expected/lir_00_unoptimized.txt +41 -0
- data/golden/array_index/expected/lir_01_hoist_scalar_references.txt +41 -0
- data/golden/array_index/expected/lir_02_inlined.txt +42 -0
- data/golden/array_index/expected/lir_03_cse.txt +40 -0
- data/golden/array_index/expected/lir_04_1_loop_fusion.txt +40 -0
- data/golden/array_index/expected/lir_04_loop_invcm.txt +40 -0
- data/golden/array_index/expected/lir_06_const_prop.txt +40 -0
- data/golden/array_index/expected/nast.txt +33 -0
- data/golden/array_index/expected/schema_javascript.mjs +46 -0
- data/golden/array_index/expected/schema_ruby.rb +75 -0
- data/golden/array_index/expected/snast.txt +33 -0
- data/golden/array_index/expected.json +5 -0
- data/golden/array_index/input.json +1 -0
- data/golden/array_index/schema.kumi +19 -0
- data/golden/array_operations/expected/ast.txt +50 -0
- data/golden/array_operations/expected/input_plan.txt +10 -0
- data/golden/array_operations/expected/lir_00_unoptimized.txt +47 -0
- data/golden/array_operations/expected/lir_01_hoist_scalar_references.txt +47 -0
- data/golden/array_operations/expected/lir_02_inlined.txt +47 -0
- data/golden/array_operations/expected/lir_03_cse.txt +47 -0
- data/golden/array_operations/expected/lir_04_1_loop_fusion.txt +47 -0
- data/golden/array_operations/expected/lir_04_loop_invcm.txt +47 -0
- data/golden/array_operations/expected/lir_06_const_prop.txt +47 -0
- data/golden/array_operations/expected/nast.txt +32 -0
- data/golden/array_operations/expected/schema_javascript.mjs +60 -0
- data/golden/array_operations/expected/schema_ruby.rb +91 -0
- data/golden/array_operations/expected/snast.txt +32 -0
- data/golden/array_operations/expected.json +27 -0
- data/golden/array_operations/input.json +8 -0
- data/golden/array_operations/schema.kumi +12 -10
- data/golden/cascade_logic/expected/ast.txt +37 -0
- data/golden/cascade_logic/expected/input_plan.txt +2 -0
- data/golden/cascade_logic/expected/lir_00_unoptimized.txt +29 -0
- data/golden/cascade_logic/expected/lir_01_hoist_scalar_references.txt +29 -0
- data/golden/cascade_logic/expected/lir_02_inlined.txt +37 -0
- data/golden/cascade_logic/expected/lir_03_cse.txt +30 -0
- data/golden/cascade_logic/expected/lir_04_1_loop_fusion.txt +30 -0
- data/golden/cascade_logic/expected/lir_04_loop_invcm.txt +30 -0
- data/golden/cascade_logic/expected/lir_06_const_prop.txt +30 -0
- data/golden/cascade_logic/expected/nast.txt +32 -0
- data/golden/cascade_logic/expected/schema_javascript.mjs +31 -0
- data/golden/cascade_logic/expected/schema_ruby.rb +57 -0
- data/golden/cascade_logic/expected/snast.txt +32 -0
- data/golden/cascade_logic/expected.json +5 -0
- data/golden/cascade_logic/input.json +4 -0
- data/golden/cascade_logic/schema.kumi +1 -3
- data/golden/chained_fusion/expected/ast.txt +57 -0
- data/golden/chained_fusion/expected/input_plan.txt +13 -0
- data/golden/chained_fusion/expected/lir_00_unoptimized.txt +76 -0
- data/golden/chained_fusion/expected/lir_01_hoist_scalar_references.txt +76 -0
- data/golden/chained_fusion/expected/lir_02_inlined.txt +114 -0
- data/golden/chained_fusion/expected/lir_03_cse.txt +97 -0
- data/golden/chained_fusion/expected/lir_04_1_loop_fusion.txt +99 -0
- data/golden/chained_fusion/expected/lir_04_loop_invcm.txt +97 -0
- data/golden/chained_fusion/expected/lir_06_const_prop.txt +97 -0
- data/golden/chained_fusion/expected/nast.txt +55 -0
- data/golden/chained_fusion/expected/schema_javascript.mjs +116 -0
- data/golden/chained_fusion/expected/schema_ruby.rb +149 -0
- data/golden/chained_fusion/expected/snast.txt +55 -0
- data/golden/chained_fusion/expected.json +45 -0
- data/golden/chained_fusion/input.json +51 -0
- data/golden/chained_fusion/schema.kumi +52 -0
- data/golden/element_arrays/expected/ast.txt +55 -0
- data/golden/element_arrays/expected/input_plan.txt +7 -0
- data/golden/element_arrays/expected/lir_00_unoptimized.txt +81 -0
- data/golden/element_arrays/expected/lir_01_hoist_scalar_references.txt +81 -0
- data/golden/element_arrays/expected/lir_02_inlined.txt +85 -0
- data/golden/element_arrays/expected/lir_03_cse.txt +83 -0
- data/golden/element_arrays/expected/lir_04_1_loop_fusion.txt +83 -0
- data/golden/element_arrays/expected/lir_04_loop_invcm.txt +83 -0
- data/golden/element_arrays/expected/lir_06_const_prop.txt +83 -0
- data/golden/element_arrays/expected/nast.txt +42 -0
- data/golden/element_arrays/expected/schema_javascript.mjs +106 -0
- data/golden/element_arrays/expected/schema_ruby.rb +141 -0
- data/golden/element_arrays/expected/snast.txt +42 -0
- data/golden/element_arrays/expected.json +55 -0
- data/golden/element_arrays/input.json +12 -0
- data/golden/element_arrays/schema.kumi +21 -0
- data/golden/empty_and_null_inputs/expected/ast.txt +42 -0
- data/golden/empty_and_null_inputs/expected/input_plan.txt +12 -0
- data/golden/empty_and_null_inputs/expected/lir_00_unoptimized.txt +31 -0
- data/golden/empty_and_null_inputs/expected/lir_01_hoist_scalar_references.txt +31 -0
- data/golden/empty_and_null_inputs/expected/lir_02_inlined.txt +51 -0
- data/golden/empty_and_null_inputs/expected/lir_03_cse.txt +49 -0
- data/golden/empty_and_null_inputs/expected/lir_04_1_loop_fusion.txt +49 -0
- data/golden/empty_and_null_inputs/expected/lir_04_loop_invcm.txt +49 -0
- data/golden/empty_and_null_inputs/expected/lir_06_const_prop.txt +49 -0
- data/golden/empty_and_null_inputs/expected/nast.txt +18 -0
- data/golden/empty_and_null_inputs/expected/schema_javascript.mjs +47 -0
- data/golden/empty_and_null_inputs/expected/schema_ruby.rb +79 -0
- data/golden/empty_and_null_inputs/expected/snast.txt +18 -0
- data/golden/empty_and_null_inputs/expected.json +8 -0
- data/golden/empty_and_null_inputs/input.json +16 -0
- data/golden/empty_and_null_inputs/schema.kumi +30 -0
- data/golden/game_of_life/expected/ast.txt +118 -0
- data/golden/game_of_life/expected/input_plan.txt +5 -0
- data/golden/game_of_life/expected/lir_00_unoptimized.txt +343 -0
- data/golden/game_of_life/expected/lir_01_hoist_scalar_references.txt +343 -0
- data/golden/game_of_life/expected/lir_02_inlined.txt +1918 -0
- data/golden/game_of_life/expected/lir_03_cse.txt +766 -0
- data/golden/game_of_life/expected/lir_04_1_loop_fusion.txt +766 -0
- data/golden/game_of_life/expected/lir_04_loop_invcm.txt +766 -0
- data/golden/game_of_life/expected/lir_06_const_prop.txt +766 -0
- data/golden/game_of_life/expected/nast.txt +104 -0
- data/golden/game_of_life/expected/schema_javascript.mjs +98 -0
- data/golden/game_of_life/expected/schema_ruby.rb +125 -0
- data/golden/game_of_life/expected/snast.txt +104 -0
- data/golden/game_of_life/expected.json +3 -0
- data/golden/game_of_life/input.json +8 -0
- data/golden/game_of_life/schema.kumi +33 -0
- data/golden/hash_keys/expected/ast.txt +29 -0
- data/golden/hash_keys/expected/input_plan.txt +2 -0
- data/golden/hash_keys/expected/lir_00_unoptimized.txt +18 -0
- data/golden/hash_keys/expected/lir_01_hoist_scalar_references.txt +18 -0
- data/golden/hash_keys/expected/lir_02_inlined.txt +18 -0
- data/golden/hash_keys/expected/lir_03_cse.txt +18 -0
- data/golden/hash_keys/expected/lir_04_1_loop_fusion.txt +18 -0
- data/golden/hash_keys/expected/lir_04_loop_invcm.txt +18 -0
- data/golden/hash_keys/expected/lir_06_const_prop.txt +18 -0
- data/golden/hash_keys/expected/nast.txt +46 -0
- data/golden/hash_keys/expected/schema_javascript.mjs +34 -0
- data/golden/hash_keys/expected/schema_ruby.rb +61 -0
- data/golden/hash_keys/expected/snast.txt +46 -0
- data/golden/hash_keys/expected.json +20 -0
- data/golden/hash_keys/input.json +4 -0
- data/golden/hash_keys/schema.kumi +14 -0
- data/golden/hash_value/expected/ast.txt +37 -0
- data/golden/hash_value/expected/input_plan.txt +7 -0
- data/golden/hash_value/expected/lir_00_unoptimized.txt +30 -0
- data/golden/hash_value/expected/lir_01_hoist_scalar_references.txt +30 -0
- data/golden/hash_value/expected/lir_02_inlined.txt +36 -0
- data/golden/hash_value/expected/lir_03_cse.txt +33 -0
- data/golden/hash_value/expected/lir_04_1_loop_fusion.txt +33 -0
- data/golden/hash_value/expected/lir_04_loop_invcm.txt +33 -0
- data/golden/hash_value/expected/lir_06_const_prop.txt +33 -0
- data/golden/hash_value/expected/nast.txt +25 -0
- data/golden/hash_value/expected/schema_javascript.mjs +46 -0
- data/golden/hash_value/expected/schema_ruby.rb +75 -0
- data/golden/hash_value/expected/snast.txt +25 -0
- data/golden/hash_value/expected.json +19 -0
- data/golden/hash_value/input.json +12 -0
- data/golden/hash_value/schema.kumi +19 -0
- data/golden/hierarchical_complex/expected/ast.txt +85 -0
- data/golden/hierarchical_complex/expected/input_plan.txt +23 -0
- data/golden/hierarchical_complex/expected/lir_00_unoptimized.txt +87 -0
- data/golden/hierarchical_complex/expected/lir_01_hoist_scalar_references.txt +87 -0
- data/golden/hierarchical_complex/expected/lir_02_inlined.txt +115 -0
- data/golden/hierarchical_complex/expected/lir_03_cse.txt +89 -0
- data/golden/hierarchical_complex/expected/lir_04_1_loop_fusion.txt +89 -0
- data/golden/hierarchical_complex/expected/lir_04_loop_invcm.txt +89 -0
- data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +89 -0
- data/golden/hierarchical_complex/expected/nast.txt +49 -0
- data/golden/hierarchical_complex/expected/schema_javascript.mjs +121 -0
- data/golden/hierarchical_complex/expected/schema_ruby.rb +151 -0
- data/golden/hierarchical_complex/expected/snast.txt +49 -0
- data/golden/hierarchical_complex/expected.json +34 -0
- data/golden/hierarchical_complex/input.json +26 -0
- data/golden/hierarchical_complex/schema.kumi +38 -0
- data/golden/input_reference/expected/ast.txt +46 -0
- data/golden/input_reference/expected/input_plan.txt +15 -0
- data/golden/input_reference/expected/lir_00_unoptimized.txt +39 -0
- data/golden/input_reference/expected/lir_01_hoist_scalar_references.txt +39 -0
- data/golden/input_reference/expected/lir_02_inlined.txt +39 -0
- data/golden/input_reference/expected/lir_03_cse.txt +39 -0
- data/golden/input_reference/expected/lir_04_1_loop_fusion.txt +39 -0
- data/golden/input_reference/expected/lir_04_loop_invcm.txt +39 -0
- data/golden/input_reference/expected/lir_06_const_prop.txt +39 -0
- data/golden/input_reference/expected/nast.txt +21 -0
- data/golden/input_reference/expected/schema_javascript.mjs +45 -0
- data/golden/input_reference/expected/schema_ruby.rb +74 -0
- data/golden/input_reference/expected/snast.txt +21 -0
- data/golden/input_reference/expected.json +7 -0
- data/golden/input_reference/input.json +11 -0
- data/golden/input_reference/schema.kumi +22 -0
- data/golden/interleaved_fusion/expected/ast.txt +51 -0
- data/golden/interleaved_fusion/expected/input_plan.txt +13 -0
- data/golden/interleaved_fusion/expected/lir_00_unoptimized.txt +53 -0
- data/golden/interleaved_fusion/expected/lir_01_hoist_scalar_references.txt +53 -0
- data/golden/interleaved_fusion/expected/lir_02_inlined.txt +89 -0
- data/golden/interleaved_fusion/expected/lir_03_cse.txt +77 -0
- data/golden/interleaved_fusion/expected/lir_04_1_loop_fusion.txt +77 -0
- data/golden/interleaved_fusion/expected/lir_04_loop_invcm.txt +77 -0
- data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +77 -0
- data/golden/interleaved_fusion/expected/nast.txt +41 -0
- data/golden/interleaved_fusion/expected/schema_javascript.mjs +86 -0
- data/golden/interleaved_fusion/expected/schema_ruby.rb +122 -0
- data/golden/interleaved_fusion/expected/snast.txt +41 -0
- data/golden/interleaved_fusion/expected.json +37 -0
- data/golden/interleaved_fusion/input.json +26 -0
- data/golden/interleaved_fusion/schema.kumi +57 -0
- data/golden/let_inline/expected/ast.txt +33 -0
- data/golden/let_inline/expected/input_plan.txt +2 -0
- data/golden/let_inline/expected/lir_00_unoptimized.txt +26 -0
- data/golden/let_inline/expected/lir_01_hoist_scalar_references.txt +26 -0
- data/golden/let_inline/expected/lir_02_inlined.txt +36 -0
- data/golden/let_inline/expected/lir_03_cse.txt +30 -0
- data/golden/let_inline/expected/lir_04_1_loop_fusion.txt +30 -0
- data/golden/let_inline/expected/lir_04_loop_invcm.txt +30 -0
- data/golden/let_inline/expected/lir_06_const_prop.txt +30 -0
- data/golden/let_inline/expected/nast.txt +26 -0
- data/golden/let_inline/expected/schema_javascript.mjs +11 -0
- data/golden/let_inline/expected/schema_ruby.rb +37 -0
- data/golden/let_inline/expected/snast.txt +26 -0
- data/golden/let_inline/expected.json +1 -0
- data/golden/let_inline/input.json +1 -0
- data/golden/let_inline/schema.kumi +11 -0
- data/golden/loop_fusion/expected/ast.txt +44 -0
- data/golden/loop_fusion/expected/input_plan.txt +13 -0
- data/golden/loop_fusion/expected/lir_00_unoptimized.txt +43 -0
- data/golden/loop_fusion/expected/lir_01_hoist_scalar_references.txt +43 -0
- data/golden/loop_fusion/expected/lir_02_inlined.txt +62 -0
- data/golden/loop_fusion/expected/lir_03_cse.txt +57 -0
- data/golden/loop_fusion/expected/lir_04_1_loop_fusion.txt +57 -0
- data/golden/loop_fusion/expected/lir_04_loop_invcm.txt +57 -0
- data/golden/loop_fusion/expected/lir_06_const_prop.txt +57 -0
- data/golden/loop_fusion/expected/nast.txt +32 -0
- data/golden/loop_fusion/expected/schema_javascript.mjs +64 -0
- data/golden/loop_fusion/expected/schema_ruby.rb +97 -0
- data/golden/loop_fusion/expected/snast.txt +32 -0
- data/golden/loop_fusion/expected.json +30 -0
- data/golden/loop_fusion/input.json +28 -0
- data/golden/loop_fusion/schema.kumi +32 -0
- data/golden/min_reduce_scope/expected/ast.txt +49 -0
- data/golden/min_reduce_scope/expected/input_plan.txt +9 -0
- data/golden/min_reduce_scope/expected/lir_00_unoptimized.txt +59 -0
- data/golden/min_reduce_scope/expected/lir_01_hoist_scalar_references.txt +59 -0
- data/golden/min_reduce_scope/expected/lir_02_inlined.txt +63 -0
- data/golden/min_reduce_scope/expected/lir_03_cse.txt +60 -0
- data/golden/min_reduce_scope/expected/lir_04_1_loop_fusion.txt +60 -0
- data/golden/min_reduce_scope/expected/lir_04_loop_invcm.txt +60 -0
- data/golden/min_reduce_scope/expected/lir_06_const_prop.txt +60 -0
- data/golden/min_reduce_scope/expected/nast.txt +29 -0
- data/golden/min_reduce_scope/expected/schema_javascript.mjs +66 -0
- data/golden/min_reduce_scope/expected/schema_ruby.rb +99 -0
- data/golden/min_reduce_scope/expected/snast.txt +29 -0
- data/golden/min_reduce_scope/expected.json +9 -0
- data/golden/min_reduce_scope/input.json +18 -0
- data/golden/min_reduce_scope/schema.kumi +25 -0
- data/golden/mixed_dimensions/expected/ast.txt +54 -0
- data/golden/mixed_dimensions/expected/input_plan.txt +15 -0
- data/golden/mixed_dimensions/expected/lir_00_unoptimized.txt +42 -0
- data/golden/mixed_dimensions/expected/lir_01_hoist_scalar_references.txt +42 -0
- data/golden/mixed_dimensions/expected/lir_02_inlined.txt +48 -0
- data/golden/mixed_dimensions/expected/lir_03_cse.txt +48 -0
- data/golden/mixed_dimensions/expected/lir_04_1_loop_fusion.txt +48 -0
- data/golden/mixed_dimensions/expected/lir_04_loop_invcm.txt +48 -0
- data/golden/mixed_dimensions/expected/lir_06_const_prop.txt +48 -0
- data/golden/mixed_dimensions/expected/nast.txt +22 -0
- data/golden/mixed_dimensions/expected/schema_javascript.mjs +53 -0
- data/golden/mixed_dimensions/expected/schema_ruby.rb +84 -0
- data/golden/mixed_dimensions/expected/snast.txt +22 -0
- data/golden/mixed_dimensions/expected.json +6 -0
- data/golden/mixed_dimensions/input.json +22 -0
- data/golden/mixed_dimensions/schema.kumi +35 -0
- data/golden/multirank_hoisting/expected/ast.txt +72 -0
- data/golden/multirank_hoisting/expected/input_plan.txt +18 -0
- data/golden/multirank_hoisting/expected/lir_00_unoptimized.txt +75 -0
- data/golden/multirank_hoisting/expected/lir_01_hoist_scalar_references.txt +75 -0
- data/golden/multirank_hoisting/expected/lir_02_inlined.txt +126 -0
- data/golden/multirank_hoisting/expected/lir_03_cse.txt +109 -0
- data/golden/multirank_hoisting/expected/lir_04_1_loop_fusion.txt +109 -0
- data/golden/multirank_hoisting/expected/lir_04_loop_invcm.txt +109 -0
- data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +109 -0
- data/golden/multirank_hoisting/expected/nast.txt +39 -0
- data/golden/multirank_hoisting/expected/schema_javascript.mjs +128 -0
- data/golden/multirank_hoisting/expected/schema_ruby.rb +162 -0
- data/golden/multirank_hoisting/expected/snast.txt +39 -0
- data/golden/multirank_hoisting/expected.json +15 -0
- data/golden/multirank_hoisting/input.json +19 -0
- data/golden/multirank_hoisting/schema.kumi +38 -0
- data/golden/nested_hash/expected/ast.txt +22 -0
- data/golden/nested_hash/expected/input_plan.txt +5 -0
- data/golden/nested_hash/expected/lir_00_unoptimized.txt +10 -0
- data/golden/nested_hash/expected/lir_01_hoist_scalar_references.txt +10 -0
- data/golden/nested_hash/expected/lir_02_inlined.txt +10 -0
- data/golden/nested_hash/expected/lir_03_cse.txt +10 -0
- data/golden/nested_hash/expected/lir_04_1_loop_fusion.txt +10 -0
- data/golden/nested_hash/expected/lir_04_loop_invcm.txt +10 -0
- data/golden/nested_hash/expected/lir_06_const_prop.txt +10 -0
- data/golden/nested_hash/expected/nast.txt +8 -0
- data/golden/nested_hash/expected/schema_javascript.mjs +9 -0
- data/golden/nested_hash/expected/schema_ruby.rb +35 -0
- data/golden/nested_hash/expected/snast.txt +8 -0
- data/golden/nested_hash/expected.json +3 -0
- data/golden/nested_hash/input.json +7 -0
- data/golden/nested_hash/schema.kumi +11 -0
- data/golden/reduction_broadcast/expected/ast.txt +49 -0
- data/golden/reduction_broadcast/expected/input_plan.txt +13 -0
- data/golden/reduction_broadcast/expected/lir_00_unoptimized.txt +49 -0
- data/golden/reduction_broadcast/expected/lir_01_hoist_scalar_references.txt +49 -0
- data/golden/reduction_broadcast/expected/lir_02_inlined.txt +80 -0
- data/golden/reduction_broadcast/expected/lir_03_cse.txt +68 -0
- data/golden/reduction_broadcast/expected/lir_04_1_loop_fusion.txt +68 -0
- data/golden/reduction_broadcast/expected/lir_04_loop_invcm.txt +68 -0
- data/golden/reduction_broadcast/expected/lir_06_const_prop.txt +68 -0
- data/golden/reduction_broadcast/expected/nast.txt +24 -0
- data/golden/reduction_broadcast/expected/schema_javascript.mjs +74 -0
- data/golden/reduction_broadcast/expected/schema_ruby.rb +110 -0
- data/golden/reduction_broadcast/expected/snast.txt +24 -0
- data/golden/reduction_broadcast/expected.json +25 -0
- data/golden/reduction_broadcast/input.json +19 -0
- data/golden/reduction_broadcast/schema.kumi +34 -0
- data/golden/roll/expected/ast.txt +36 -0
- data/golden/roll/expected/input_plan.txt +3 -0
- data/golden/roll/expected/lir_00_unoptimized.txt +56 -0
- data/golden/roll/expected/lir_01_hoist_scalar_references.txt +56 -0
- data/golden/roll/expected/lir_02_inlined.txt +56 -0
- data/golden/roll/expected/lir_03_cse.txt +55 -0
- data/golden/roll/expected/lir_04_1_loop_fusion.txt +55 -0
- data/golden/roll/expected/lir_04_loop_invcm.txt +55 -0
- data/golden/roll/expected/lir_06_const_prop.txt +55 -0
- data/golden/roll/expected/nast.txt +26 -0
- data/golden/roll/expected/schema_javascript.mjs +65 -0
- data/golden/roll/expected/schema_ruby.rb +95 -0
- data/golden/roll/expected/snast.txt +26 -0
- data/golden/roll/expected.json +6 -0
- data/golden/roll/input.json +1 -0
- data/golden/roll/schema.kumi +13 -0
- data/golden/shift/expected/ast.txt +48 -0
- data/golden/shift/expected/input_plan.txt +3 -0
- data/golden/shift/expected/lir_00_unoptimized.txt +96 -0
- data/golden/shift/expected/lir_01_hoist_scalar_references.txt +96 -0
- data/golden/shift/expected/lir_02_inlined.txt +96 -0
- data/golden/shift/expected/lir_03_cse.txt +90 -0
- data/golden/shift/expected/lir_04_1_loop_fusion.txt +90 -0
- data/golden/shift/expected/lir_04_loop_invcm.txt +90 -0
- data/golden/shift/expected/lir_06_const_prop.txt +90 -0
- data/golden/shift/expected/nast.txt +38 -0
- data/golden/shift/expected/schema_javascript.mjs +106 -0
- data/golden/shift/expected/schema_ruby.rb +138 -0
- data/golden/shift/expected/snast.txt +38 -0
- data/golden/shift/expected.json +8 -0
- data/golden/shift/input.json +1 -0
- data/golden/shift/schema.kumi +15 -0
- data/golden/shift_2d/expected/ast.txt +88 -0
- data/golden/shift_2d/expected/input_plan.txt +5 -0
- data/golden/shift_2d/expected/lir_00_unoptimized.txt +274 -0
- data/golden/shift_2d/expected/lir_01_hoist_scalar_references.txt +274 -0
- data/golden/shift_2d/expected/lir_02_inlined.txt +274 -0
- data/golden/shift_2d/expected/lir_03_cse.txt +262 -0
- data/golden/shift_2d/expected/lir_04_1_loop_fusion.txt +262 -0
- data/golden/shift_2d/expected/lir_04_loop_invcm.txt +262 -0
- data/golden/shift_2d/expected/lir_06_const_prop.txt +262 -0
- data/golden/shift_2d/expected/nast.txt +74 -0
- data/golden/shift_2d/expected/schema_javascript.mjs +320 -0
- data/golden/shift_2d/expected/schema_ruby.rb +358 -0
- data/golden/shift_2d/expected/snast.txt +74 -0
- data/golden/shift_2d/expected.json +15 -0
- data/golden/shift_2d/input.json +14 -0
- data/golden/shift_2d/schema.kumi +25 -0
- data/golden/simple_math/expected/ast.txt +40 -0
- data/golden/simple_math/expected/input_plan.txt +2 -0
- data/golden/simple_math/expected/lir_00_unoptimized.txt +31 -0
- data/golden/simple_math/expected/lir_01_hoist_scalar_references.txt +31 -0
- data/golden/simple_math/expected/lir_02_inlined.txt +31 -0
- data/golden/simple_math/expected/lir_03_cse.txt +31 -0
- data/golden/simple_math/expected/lir_04_1_loop_fusion.txt +31 -0
- data/golden/simple_math/expected/lir_04_loop_invcm.txt +31 -0
- data/golden/simple_math/expected/lir_06_const_prop.txt +31 -0
- data/golden/simple_math/expected/nast.txt +33 -0
- data/golden/simple_math/expected/schema_javascript.mjs +33 -0
- data/golden/simple_math/expected/schema_ruby.rb +59 -0
- data/golden/simple_math/expected/snast.txt +33 -0
- data/golden/simple_math/expected.json +1 -0
- data/golden/simple_math/input.json +4 -0
- data/golden/simple_math/schema.kumi +2 -1
- data/golden/streaming_basics/expected/ast.txt +64 -0
- data/golden/streaming_basics/expected/input_plan.txt +8 -0
- data/golden/streaming_basics/expected/lir_00_unoptimized.txt +73 -0
- data/golden/streaming_basics/expected/lir_01_hoist_scalar_references.txt +73 -0
- data/golden/streaming_basics/expected/lir_02_inlined.txt +100 -0
- data/golden/streaming_basics/expected/lir_03_cse.txt +84 -0
- data/golden/streaming_basics/expected/lir_04_1_loop_fusion.txt +84 -0
- data/golden/streaming_basics/expected/lir_04_loop_invcm.txt +84 -0
- data/golden/streaming_basics/expected/lir_06_const_prop.txt +84 -0
- data/golden/streaming_basics/expected/nast.txt +48 -0
- data/golden/streaming_basics/expected/schema_javascript.mjs +94 -0
- data/golden/streaming_basics/expected/schema_ruby.rb +127 -0
- data/golden/streaming_basics/expected/snast.txt +48 -0
- data/golden/streaming_basics/expected.json +10 -0
- data/golden/streaming_basics/input.json +8 -0
- data/golden/streaming_basics/schema.kumi +24 -0
- data/golden/tuples/expected/ast.txt +48 -0
- data/golden/tuples/expected/input_plan.txt +1 -0
- data/golden/tuples/expected/lir_00_unoptimized.txt +40 -0
- data/golden/tuples/expected/lir_01_hoist_scalar_references.txt +40 -0
- data/golden/tuples/expected/lir_02_inlined.txt +48 -0
- data/golden/tuples/expected/lir_03_cse.txt +48 -0
- data/golden/tuples/expected/lir_04_1_loop_fusion.txt +48 -0
- data/golden/tuples/expected/lir_04_loop_invcm.txt +48 -0
- data/golden/tuples/expected/lir_06_const_prop.txt +48 -0
- data/golden/tuples/expected/nast.txt +42 -0
- data/golden/tuples/expected/schema_javascript.mjs +51 -0
- data/golden/tuples/expected/schema_ruby.rb +77 -0
- data/golden/tuples/expected/snast.txt +42 -0
- data/golden/tuples/expected.json +7 -0
- data/golden/tuples/input.json +3 -0
- data/golden/tuples/schema.kumi +11 -0
- data/golden/tuples_and_arrays/expected/ast.txt +44 -0
- data/golden/tuples_and_arrays/expected/input_plan.txt +7 -0
- data/golden/tuples_and_arrays/expected/lir_00_unoptimized.txt +41 -0
- data/golden/tuples_and_arrays/expected/lir_01_hoist_scalar_references.txt +41 -0
- data/golden/tuples_and_arrays/expected/lir_02_inlined.txt +62 -0
- data/golden/tuples_and_arrays/expected/lir_03_cse.txt +51 -0
- data/golden/tuples_and_arrays/expected/lir_04_1_loop_fusion.txt +51 -0
- data/golden/tuples_and_arrays/expected/lir_04_loop_invcm.txt +51 -0
- data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +51 -0
- data/golden/tuples_and_arrays/expected/nast.txt +28 -0
- data/golden/tuples_and_arrays/expected/schema_javascript.mjs +58 -0
- data/golden/tuples_and_arrays/expected/schema_ruby.rb +88 -0
- data/golden/tuples_and_arrays/expected/snast.txt +28 -0
- data/golden/tuples_and_arrays/expected.json +18 -0
- data/golden/tuples_and_arrays/input.json +7 -0
- data/golden/tuples_and_arrays/schema.kumi +38 -0
- data/golden/with_constants/expected/ast.txt +28 -0
- data/golden/with_constants/expected/input_plan.txt +2 -0
- data/golden/with_constants/expected/lir_00_unoptimized.txt +17 -0
- data/golden/with_constants/expected/lir_01_hoist_scalar_references.txt +17 -0
- data/golden/with_constants/expected/lir_02_inlined.txt +17 -0
- data/golden/with_constants/expected/lir_03_cse.txt +17 -0
- data/golden/with_constants/expected/lir_04_1_loop_fusion.txt +17 -0
- data/golden/with_constants/expected/lir_04_loop_invcm.txt +17 -0
- data/golden/with_constants/expected/lir_06_const_prop.txt +17 -0
- data/golden/with_constants/expected/nast.txt +21 -0
- data/golden/with_constants/expected/schema_javascript.mjs +18 -0
- data/golden/with_constants/expected/schema_ruby.rb +44 -0
- data/golden/with_constants/expected/snast.txt +15 -0
- data/golden/with_constants/schema.kumi +10 -0
- data/lib/kumi/analyzer.rb +76 -24
- data/lib/kumi/configuration.rb +60 -0
- data/lib/kumi/core/analyzer/binder.rb +121 -0
- data/lib/kumi/core/analyzer/checkpoint.rb +15 -9
- data/lib/kumi/core/analyzer/constant_evaluator.rb +32 -37
- data/lib/kumi/core/analyzer/constant_folding_helpers.rb +55 -0
- data/lib/kumi/core/analyzer/debug.rb +14 -16
- data/lib/kumi/core/analyzer/fn_aliases.rb +46 -0
- data/lib/kumi/core/analyzer/folder.rb +94 -0
- data/lib/kumi/core/analyzer/macro_expander.rb +69 -0
- data/lib/kumi/core/analyzer/passes/assemble_irv2_pass.rb +130 -0
- data/lib/kumi/core/analyzer/passes/attach_anchors_pass.rb +71 -0
- data/lib/kumi/core/analyzer/passes/attach_terminal_info_pass.rb +181 -0
- data/lib/kumi/core/analyzer/passes/codegen/js/declaration_emitter.rb +317 -0
- data/lib/kumi/core/analyzer/passes/codegen/js/emitter.rb +75 -0
- data/lib/kumi/core/analyzer/passes/codegen/js/output_buffer.rb +103 -0
- data/lib/kumi/core/analyzer/passes/codegen/js_pass.rb +27 -0
- data/lib/kumi/core/analyzer/passes/codegen/ruby/declaration_emitter.rb +321 -0
- data/lib/kumi/core/analyzer/passes/codegen/ruby/emitter.rb +85 -0
- data/lib/kumi/core/analyzer/passes/codegen/ruby/output_buffer.rb +111 -0
- data/lib/kumi/core/analyzer/passes/codegen/ruby_pass.rb +32 -0
- data/lib/kumi/core/analyzer/passes/constant_folding_pass.rb +33 -0
- data/lib/kumi/core/analyzer/passes/contract_checker_pass.rb +220 -0
- data/lib/kumi/core/analyzer/passes/dependency_resolver.rb +5 -6
- data/lib/kumi/core/analyzer/passes/input_access_planner_pass.rb +7 -3
- data/lib/kumi/core/analyzer/passes/input_collector.rb +74 -122
- data/lib/kumi/core/analyzer/passes/input_form_schema_pass.rb +43 -0
- data/lib/kumi/core/analyzer/passes/ir_dependency_pass.rb +1 -1
- data/lib/kumi/core/analyzer/passes/ir_execution_schedule_pass.rb +1 -1
- data/lib/kumi/core/analyzer/passes/join_reduce_planning_pass.rb +21 -23
- data/lib/kumi/core/analyzer/passes/lir/constant_propagation_pass.rb +84 -0
- data/lib/kumi/core/analyzer/passes/lir/dead_code_elimination_pass.rb +93 -0
- data/lib/kumi/core/analyzer/passes/lir/hoist_scalar_references_pass.rb +115 -0
- data/lib/kumi/core/analyzer/passes/lir/inline_declarations_pass.rb +274 -0
- data/lib/kumi/core/analyzer/passes/lir/instruction_scheduling_pass.rb +198 -0
- data/lib/kumi/core/analyzer/passes/lir/kernel_binding_pass.rb +30 -0
- data/lib/kumi/core/analyzer/passes/lir/local_cse_pass.rb +121 -0
- data/lib/kumi/core/analyzer/passes/lir/loop_fusion_pass.rb +156 -0
- data/lib/kumi/core/analyzer/passes/lir/loop_invariant_code_motion_pass.rb +148 -0
- data/lib/kumi/core/analyzer/passes/lir/lower_pass.rb +407 -0
- data/lib/kumi/core/analyzer/passes/lir/stencil_emitter.rb +243 -0
- data/lib/kumi/core/analyzer/passes/lir/validation_pass.rb +83 -0
- data/lib/kumi/core/analyzer/passes/load_input_cse.rb +17 -16
- data/lib/kumi/core/analyzer/passes/lower_to_ir_pass.rb +4 -2
- data/lib/kumi/core/analyzer/passes/lower_to_irv2_pass.rb +197 -0
- data/lib/kumi/core/analyzer/passes/name_indexer.rb +4 -1
- data/lib/kumi/core/analyzer/passes/nast_dimensional_analyzer_pass.rb +237 -0
- data/lib/kumi/core/analyzer/passes/normalize_to_nast_pass.rb +156 -0
- data/lib/kumi/core/analyzer/passes/output_schema_pass.rb +38 -0
- data/lib/kumi/core/analyzer/passes/pass_base.rb +30 -4
- data/lib/kumi/core/analyzer/passes/precompute_access_paths_pass.rb +93 -0
- data/lib/kumi/core/analyzer/passes/scope_resolution_pass.rb +33 -30
- data/lib/kumi/core/analyzer/passes/semantic_constraint_validator.rb +5 -26
- data/lib/kumi/core/analyzer/passes/snast_pass.rb +229 -0
- data/lib/kumi/core/analyzer/passes/toposorter.rb +1 -0
- data/lib/kumi/core/analyzer/passes/type_checker.rb +13 -0
- data/lib/kumi/core/analyzer/passes/type_inferencer_pass.rb +14 -16
- data/lib/kumi/core/analyzer/passes/unsat_detector.rb +2 -1
- data/lib/kumi/core/analyzer/plans.rb +12 -0
- data/lib/kumi/core/analyzer/state_serde.rb +4 -4
- data/lib/kumi/core/analyzer/structs/access_plan.rb +2 -2
- data/lib/kumi/core/analyzer/unsat_constant_evaluator.rb +59 -0
- data/lib/kumi/core/compiler/access_codegen.rb +1 -1
- data/lib/kumi/core/compiler/access_emit/base.rb +9 -5
- data/lib/kumi/core/compiler/access_emit/each_indexed.rb +10 -3
- data/lib/kumi/core/compiler/access_emit/materialize.rb +12 -5
- data/lib/kumi/core/compiler/access_emit/ravel.rb +10 -3
- data/lib/kumi/core/compiler/access_emit/read.rb +4 -1
- data/lib/kumi/core/compiler/access_planner.rb +42 -4
- data/lib/kumi/core/compiler/access_planner_v2.rb +164 -0
- data/lib/kumi/core/explain.rb +18 -11
- data/lib/kumi/core/functions/loader.rb +47 -0
- data/lib/kumi/core/functions/model.rb +10 -0
- data/lib/kumi/core/functions/type_rules.rb +108 -0
- data/lib/kumi/core/ir/execution_engine/interpreter.rb +1 -1
- data/lib/kumi/core/ir/execution_engine/profiler.rb +107 -97
- data/lib/kumi/core/ir.rb +6 -2
- data/lib/kumi/core/irv2/builder.rb +48 -0
- data/lib/kumi/core/irv2/declaration.rb +28 -0
- data/lib/kumi/core/irv2/module.rb +108 -0
- data/lib/kumi/core/irv2/value.rb +28 -0
- data/lib/kumi/core/lir/analyze.rb +64 -0
- data/lib/kumi/core/lir/build.rb +363 -0
- data/lib/kumi/core/lir/emit.rb +62 -0
- data/lib/kumi/core/lir/structs/instruction.rb +44 -0
- data/lib/kumi/core/lir/structs/literal.rb +14 -0
- data/lib/kumi/core/lir/structs/stamp.rb +13 -0
- data/lib/kumi/core/lir/support/error.rb +9 -0
- data/lib/kumi/core/lir/support/ids.rb +34 -0
- data/lib/kumi/core/lir/validate.rb +74 -0
- data/lib/kumi/core/lir.rb +34 -0
- data/lib/kumi/core/nast.rb +216 -0
- data/lib/kumi/core/ruby_parser/dsl.rb +2 -2
- data/lib/kumi/core/ruby_parser/dsl_cascade_builder.rb +1 -1
- data/lib/kumi/core/ruby_parser/expression_converter.rb +10 -0
- data/lib/kumi/core/ruby_parser/input_builder.rb +16 -17
- data/lib/kumi/core/ruby_parser/schema_builder.rb +36 -10
- data/lib/kumi/core/ruby_parser/sugar.rb +64 -0
- data/lib/kumi/core/types/builder.rb +2 -2
- data/lib/kumi/core/types/normalizer.rb +2 -0
- data/lib/kumi/core/types/validator.rb +10 -3
- data/lib/kumi/core/types.rb +7 -0
- data/lib/kumi/dev/codegen.rb +194 -0
- data/lib/kumi/dev/golden/generator.rb +105 -0
- data/lib/kumi/dev/golden/reporter.rb +160 -0
- data/lib/kumi/dev/golden/representation.rb +45 -0
- data/lib/kumi/dev/golden/result.rb +98 -0
- data/lib/kumi/dev/golden/runtime_test.rb +93 -0
- data/lib/kumi/dev/golden/suite.rb +131 -0
- data/lib/kumi/dev/golden/verifier.rb +76 -0
- data/lib/kumi/dev/golden.rb +75 -0
- data/lib/kumi/dev/ir.rb +4 -4
- data/lib/kumi/dev/parse.rb +1 -1
- data/lib/kumi/dev/pretty_printer.rb +229 -0
- data/lib/kumi/dev/printer/irv2_formatter.rb +163 -0
- data/lib/kumi/dev/printer/width_aware_json.rb +44 -0
- data/lib/kumi/dev/profile_aggregator.rb +36 -38
- data/lib/kumi/dev/profile_runner.rb +19 -23
- data/lib/kumi/dev/runner.rb +12 -22
- data/lib/kumi/dev/support/kumi_runner.mjs +39 -0
- data/lib/kumi/dev.rb +3 -3
- data/lib/kumi/frontends/ruby.rb +12 -12
- data/lib/kumi/frontends/text.rb +26 -21
- data/lib/kumi/frontends.rb +6 -8
- data/lib/kumi/kernel_registry.rb +59 -0
- data/lib/kumi/pack/builder.rb +229 -0
- data/lib/kumi/pack.rb +15 -0
- data/lib/kumi/registry_v2/loader.rb +81 -0
- data/lib/kumi/registry_v2.rb +118 -0
- data/lib/kumi/schema.rb +83 -43
- data/lib/kumi/support/diff.rb +3 -2
- data/lib/kumi/support/ir_render.rb +1 -1
- data/lib/kumi/support/lir_printer.rb +143 -0
- data/lib/kumi/support/nast_printer.rb +93 -0
- data/lib/kumi/support/s_expression_printer.rb +5 -4
- data/lib/kumi/support/snast_printer.rb +111 -0
- data/lib/kumi/syntax/call_expression.rb +1 -1
- data/lib/kumi/syntax/input_declaration.rb +2 -2
- data/lib/kumi/syntax/node.rb +4 -12
- data/lib/kumi/syntax/root.rb +10 -0
- data/lib/kumi/syntax/trait_declaration.rb +1 -0
- data/lib/kumi/syntax/value_declaration.rb +1 -0
- data/lib/kumi/version.rb +1 -1
- data/lib/kumi.rb +46 -4
- metadata +571 -54
- data/docs/AST.md +0 -133
- data/docs/DSL.md +0 -154
- data/docs/FUNCTIONS.md +0 -176
- data/docs/VECTOR_SEMANTICS.md +0 -286
- data/docs/compiler_design_principles.md +0 -86
- data/docs/dev/analyzer-debug.md +0 -52
- data/docs/dev/parse-command.md +0 -64
- data/docs/dev/vm-profiling.md +0 -95
- data/docs/development/README.md +0 -120
- data/docs/development/error-reporting.md +0 -361
- data/docs/features/README.md +0 -58
- data/docs/features/analysis-type-inference.md +0 -42
- data/docs/features/analysis-unsat-detection.md +0 -71
- data/docs/features/hierarchical-broadcasting.md +0 -415
- data/docs/features/input-declaration-system.md +0 -58
- data/docs/features/performance.md +0 -14
- data/docs/features/s-expression-printer.md +0 -77
- data/docs/schema_metadata/broadcasts.md +0 -53
- data/docs/schema_metadata/cascades.md +0 -45
- data/docs/schema_metadata/declarations.md +0 -54
- data/docs/schema_metadata/dependencies.md +0 -57
- data/docs/schema_metadata/evaluation_order.md +0 -29
- data/docs/schema_metadata/examples.md +0 -95
- data/docs/schema_metadata/inferred_types.md +0 -46
- data/docs/schema_metadata/inputs.md +0 -86
- data/docs/schema_metadata.md +0 -108
- data/golden/mixed_nesting/schema.kumi +0 -42
- data/lib/kumi/core/function_registry/collection_functions.rb +0 -298
- data/lib/kumi/core/function_registry/comparison_functions.rb +0 -33
- data/lib/kumi/core/function_registry/conditional_functions.rb +0 -48
- data/lib/kumi/core/function_registry/function_builder.rb +0 -184
- data/lib/kumi/core/function_registry/logical_functions.rb +0 -214
- data/lib/kumi/core/function_registry/math_functions.rb +0 -74
- data/lib/kumi/core/function_registry/stat_functions.rb +0 -156
- data/lib/kumi/core/function_registry/string_functions.rb +0 -57
- data/lib/kumi/core/function_registry/type_functions.rb +0 -53
- data/lib/kumi/core/function_registry.rb +0 -176
- data/lib/kumi/registry.rb +0 -32
- data/lib/kumi/runtime/executable.rb +0 -135
- data/lib/kumi/runtime/run.rb +0 -105
- data/performance_results.txt +0 -63
- data/scripts/analyze_broadcast_methods.rb +0 -68
- data/scripts/analyze_cascade_methods.rb +0 -74
- data/scripts/check_broadcasting_coverage.rb +0 -51
- data/scripts/find_dead_code.rb +0 -114
- data/scripts/generate_function_docs.rb +0 -71
- data/scripts/test_mixed_nesting_performance.rb +0 -206
@@ -0,0 +1,320 @@
|
|
1
|
+
export function _shift_cols_right_zero(input) {
|
2
|
+
let out = [];
|
3
|
+
let t1 = input["rows"];
|
4
|
+
let t6 = t1.length;
|
5
|
+
const t12 = 1;
|
6
|
+
const t14 = 0;
|
7
|
+
t1.forEach((rows_el_2, rows_i_3) => {
|
8
|
+
let out_1 = [];
|
9
|
+
let t7 = ((rows_i_3 % t6) + t6) % t6;
|
10
|
+
let t8 = t7 + t6;
|
11
|
+
let t9 = ((t8 % t6) + t6) % t6;
|
12
|
+
let t10 = t1[t9];
|
13
|
+
let t11 = t10.length;
|
14
|
+
let t19 = t11 - t12;
|
15
|
+
rows_el_2.forEach((col_el_4, col_i_5) => {
|
16
|
+
let t13 = col_i_5 - t12;
|
17
|
+
let t15 = t13 >= t14;
|
18
|
+
let t16 = t13 < t11;
|
19
|
+
let t17 = t15 && t16;
|
20
|
+
let t21 = Math.min(Math.max(t13, t14), t19);
|
21
|
+
let t22 = t10[t21];
|
22
|
+
let t24 = t17 ? t22 : t14;
|
23
|
+
out_1.push(t24);
|
24
|
+
});
|
25
|
+
out.push(out_1);
|
26
|
+
});
|
27
|
+
return out;
|
28
|
+
}
|
29
|
+
|
30
|
+
export function _shift_cols_right_clamp(input) {
|
31
|
+
let out = [];
|
32
|
+
let t25 = input["rows"];
|
33
|
+
let t30 = t25.length;
|
34
|
+
const t36 = 1;
|
35
|
+
const t40 = 0;
|
36
|
+
t25.forEach((rows_el_26, rows_i_27) => {
|
37
|
+
let out_1 = [];
|
38
|
+
let t31 = ((rows_i_27 % t30) + t30) % t30;
|
39
|
+
let t32 = t31 + t30;
|
40
|
+
let t33 = ((t32 % t30) + t30) % t30;
|
41
|
+
let t34 = t25[t33];
|
42
|
+
let t35 = t34.length;
|
43
|
+
let t39 = t35 - t36;
|
44
|
+
rows_el_26.forEach((col_el_28, col_i_29) => {
|
45
|
+
let t37 = col_i_29 - t36;
|
46
|
+
let t41 = Math.min(Math.max(t37, t40), t39);
|
47
|
+
let t42 = t34[t41];
|
48
|
+
out_1.push(t42);
|
49
|
+
});
|
50
|
+
out.push(out_1);
|
51
|
+
});
|
52
|
+
return out;
|
53
|
+
}
|
54
|
+
|
55
|
+
export function _shift_cols_right_wrap(input) {
|
56
|
+
let out = [];
|
57
|
+
let t43 = input["rows"];
|
58
|
+
let t48 = t43.length;
|
59
|
+
const t54 = 1;
|
60
|
+
t43.forEach((rows_el_44, rows_i_45) => {
|
61
|
+
let out_1 = [];
|
62
|
+
let t49 = ((rows_i_45 % t48) + t48) % t48;
|
63
|
+
let t50 = t49 + t48;
|
64
|
+
let t51 = ((t50 % t48) + t48) % t48;
|
65
|
+
let t52 = t43[t51];
|
66
|
+
let t53 = t52.length;
|
67
|
+
rows_el_44.forEach((col_el_46, col_i_47) => {
|
68
|
+
let t55 = col_i_47 - t54;
|
69
|
+
let t56 = ((t55 % t53) + t53) % t53;
|
70
|
+
let t57 = t56 + t53;
|
71
|
+
let t58 = ((t57 % t53) + t53) % t53;
|
72
|
+
let t59 = t52[t58];
|
73
|
+
out_1.push(t59);
|
74
|
+
});
|
75
|
+
out.push(out_1);
|
76
|
+
});
|
77
|
+
return out;
|
78
|
+
}
|
79
|
+
|
80
|
+
export function _shift_cols_left_zero(input) {
|
81
|
+
let out = [];
|
82
|
+
let t60 = input["rows"];
|
83
|
+
let t65 = t60.length;
|
84
|
+
const t71 = -1;
|
85
|
+
const t73 = 0;
|
86
|
+
const t77 = 1;
|
87
|
+
t60.forEach((rows_el_61, rows_i_62) => {
|
88
|
+
let out_1 = [];
|
89
|
+
let t66 = ((rows_i_62 % t65) + t65) % t65;
|
90
|
+
let t67 = t66 + t65;
|
91
|
+
let t68 = ((t67 % t65) + t65) % t65;
|
92
|
+
let t69 = t60[t68];
|
93
|
+
let t70 = t69.length;
|
94
|
+
let t78 = t70 - t77;
|
95
|
+
rows_el_61.forEach((col_el_63, col_i_64) => {
|
96
|
+
let t72 = col_i_64 - t71;
|
97
|
+
let t74 = t72 >= t73;
|
98
|
+
let t75 = t72 < t70;
|
99
|
+
let t76 = t74 && t75;
|
100
|
+
let t80 = Math.min(Math.max(t72, t73), t78);
|
101
|
+
let t81 = t69[t80];
|
102
|
+
let t83 = t76 ? t81 : t73;
|
103
|
+
out_1.push(t83);
|
104
|
+
});
|
105
|
+
out.push(out_1);
|
106
|
+
});
|
107
|
+
return out;
|
108
|
+
}
|
109
|
+
|
110
|
+
export function _shift_cols_left_clamp(input) {
|
111
|
+
let out = [];
|
112
|
+
let t84 = input["rows"];
|
113
|
+
let t89 = t84.length;
|
114
|
+
const t95 = -1;
|
115
|
+
const t97 = 1;
|
116
|
+
const t99 = 0;
|
117
|
+
t84.forEach((rows_el_85, rows_i_86) => {
|
118
|
+
let out_1 = [];
|
119
|
+
let t90 = ((rows_i_86 % t89) + t89) % t89;
|
120
|
+
let t91 = t90 + t89;
|
121
|
+
let t92 = ((t91 % t89) + t89) % t89;
|
122
|
+
let t93 = t84[t92];
|
123
|
+
let t94 = t93.length;
|
124
|
+
let t98 = t94 - t97;
|
125
|
+
rows_el_85.forEach((col_el_87, col_i_88) => {
|
126
|
+
let t96 = col_i_88 - t95;
|
127
|
+
let t100 = Math.min(Math.max(t96, t99), t98);
|
128
|
+
let t101 = t93[t100];
|
129
|
+
out_1.push(t101);
|
130
|
+
});
|
131
|
+
out.push(out_1);
|
132
|
+
});
|
133
|
+
return out;
|
134
|
+
}
|
135
|
+
|
136
|
+
export function _shift_cols_left_wrap(input) {
|
137
|
+
let out = [];
|
138
|
+
let t102 = input["rows"];
|
139
|
+
let t107 = t102.length;
|
140
|
+
const t113 = -1;
|
141
|
+
t102.forEach((rows_el_103, rows_i_104) => {
|
142
|
+
let out_1 = [];
|
143
|
+
let t108 = ((rows_i_104 % t107) + t107) % t107;
|
144
|
+
let t109 = t108 + t107;
|
145
|
+
let t110 = ((t109 % t107) + t107) % t107;
|
146
|
+
let t111 = t102[t110];
|
147
|
+
let t112 = t111.length;
|
148
|
+
rows_el_103.forEach((col_el_105, col_i_106) => {
|
149
|
+
let t114 = col_i_106 - t113;
|
150
|
+
let t115 = ((t114 % t112) + t112) % t112;
|
151
|
+
let t116 = t115 + t112;
|
152
|
+
let t117 = ((t116 % t112) + t112) % t112;
|
153
|
+
let t118 = t111[t117];
|
154
|
+
out_1.push(t118);
|
155
|
+
});
|
156
|
+
out.push(out_1);
|
157
|
+
});
|
158
|
+
return out;
|
159
|
+
}
|
160
|
+
|
161
|
+
export function _shift_rows_down_zero(input) {
|
162
|
+
let out = [];
|
163
|
+
let t119 = input["rows"];
|
164
|
+
let t124 = t119.length;
|
165
|
+
const t125 = 1;
|
166
|
+
const t127 = 0;
|
167
|
+
let t132 = t124 - t125;
|
168
|
+
t119.forEach((rows_el_120, rows_i_121) => {
|
169
|
+
let out_1 = [];
|
170
|
+
let t126 = rows_i_121 - t125;
|
171
|
+
let t128 = t126 >= t127;
|
172
|
+
let t129 = t126 < t124;
|
173
|
+
let t134 = Math.min(Math.max(t126, t127), t132);
|
174
|
+
let t130 = t128 && t129;
|
175
|
+
let t135 = t119[t134];
|
176
|
+
let t136 = t135.length;
|
177
|
+
rows_el_120.forEach((col_el_122, col_i_123) => {
|
178
|
+
let t137 = ((col_i_123 % t136) + t136) % t136;
|
179
|
+
let t138 = t137 + t136;
|
180
|
+
let t139 = ((t138 % t136) + t136) % t136;
|
181
|
+
let t140 = t135[t139];
|
182
|
+
let t142 = t130 ? t140 : t127;
|
183
|
+
out_1.push(t142);
|
184
|
+
});
|
185
|
+
out.push(out_1);
|
186
|
+
});
|
187
|
+
return out;
|
188
|
+
}
|
189
|
+
|
190
|
+
export function _shift_rows_down_clamp(input) {
|
191
|
+
let out = [];
|
192
|
+
let t143 = input["rows"];
|
193
|
+
let t148 = t143.length;
|
194
|
+
const t149 = 1;
|
195
|
+
const t153 = 0;
|
196
|
+
let t152 = t148 - t149;
|
197
|
+
t143.forEach((rows_el_144, rows_i_145) => {
|
198
|
+
let out_1 = [];
|
199
|
+
let t150 = rows_i_145 - t149;
|
200
|
+
let t154 = Math.min(Math.max(t150, t153), t152);
|
201
|
+
let t155 = t143[t154];
|
202
|
+
let t156 = t155.length;
|
203
|
+
rows_el_144.forEach((col_el_146, col_i_147) => {
|
204
|
+
let t157 = ((col_i_147 % t156) + t156) % t156;
|
205
|
+
let t158 = t157 + t156;
|
206
|
+
let t159 = ((t158 % t156) + t156) % t156;
|
207
|
+
let t160 = t155[t159];
|
208
|
+
out_1.push(t160);
|
209
|
+
});
|
210
|
+
out.push(out_1);
|
211
|
+
});
|
212
|
+
return out;
|
213
|
+
}
|
214
|
+
|
215
|
+
export function _shift_rows_down_wrap(input) {
|
216
|
+
let out = [];
|
217
|
+
let t161 = input["rows"];
|
218
|
+
let t166 = t161.length;
|
219
|
+
const t167 = 1;
|
220
|
+
t161.forEach((rows_el_162, rows_i_163) => {
|
221
|
+
let out_1 = [];
|
222
|
+
let t168 = rows_i_163 - t167;
|
223
|
+
let t169 = ((t168 % t166) + t166) % t166;
|
224
|
+
let t170 = t169 + t166;
|
225
|
+
let t171 = ((t170 % t166) + t166) % t166;
|
226
|
+
let t172 = t161[t171];
|
227
|
+
let t173 = t172.length;
|
228
|
+
rows_el_162.forEach((col_el_164, col_i_165) => {
|
229
|
+
let t174 = ((col_i_165 % t173) + t173) % t173;
|
230
|
+
let t175 = t174 + t173;
|
231
|
+
let t176 = ((t175 % t173) + t173) % t173;
|
232
|
+
let t177 = t172[t176];
|
233
|
+
out_1.push(t177);
|
234
|
+
});
|
235
|
+
out.push(out_1);
|
236
|
+
});
|
237
|
+
return out;
|
238
|
+
}
|
239
|
+
|
240
|
+
export function _shift_rows_up_zero(input) {
|
241
|
+
let out = [];
|
242
|
+
let t178 = input["rows"];
|
243
|
+
let t183 = t178.length;
|
244
|
+
const t184 = -1;
|
245
|
+
const t186 = 0;
|
246
|
+
const t190 = 1;
|
247
|
+
let t191 = t183 - t190;
|
248
|
+
t178.forEach((rows_el_179, rows_i_180) => {
|
249
|
+
let out_1 = [];
|
250
|
+
let t185 = rows_i_180 - t184;
|
251
|
+
let t187 = t185 >= t186;
|
252
|
+
let t188 = t185 < t183;
|
253
|
+
let t193 = Math.min(Math.max(t185, t186), t191);
|
254
|
+
let t189 = t187 && t188;
|
255
|
+
let t194 = t178[t193];
|
256
|
+
let t195 = t194.length;
|
257
|
+
rows_el_179.forEach((col_el_181, col_i_182) => {
|
258
|
+
let t196 = ((col_i_182 % t195) + t195) % t195;
|
259
|
+
let t197 = t196 + t195;
|
260
|
+
let t198 = ((t197 % t195) + t195) % t195;
|
261
|
+
let t199 = t194[t198];
|
262
|
+
let t201 = t189 ? t199 : t186;
|
263
|
+
out_1.push(t201);
|
264
|
+
});
|
265
|
+
out.push(out_1);
|
266
|
+
});
|
267
|
+
return out;
|
268
|
+
}
|
269
|
+
|
270
|
+
export function _shift_rows_up_clamp(input) {
|
271
|
+
let out = [];
|
272
|
+
let t202 = input["rows"];
|
273
|
+
let t207 = t202.length;
|
274
|
+
const t208 = -1;
|
275
|
+
const t210 = 1;
|
276
|
+
const t212 = 0;
|
277
|
+
let t211 = t207 - t210;
|
278
|
+
t202.forEach((rows_el_203, rows_i_204) => {
|
279
|
+
let out_1 = [];
|
280
|
+
let t209 = rows_i_204 - t208;
|
281
|
+
let t213 = Math.min(Math.max(t209, t212), t211);
|
282
|
+
let t214 = t202[t213];
|
283
|
+
let t215 = t214.length;
|
284
|
+
rows_el_203.forEach((col_el_205, col_i_206) => {
|
285
|
+
let t216 = ((col_i_206 % t215) + t215) % t215;
|
286
|
+
let t217 = t216 + t215;
|
287
|
+
let t218 = ((t217 % t215) + t215) % t215;
|
288
|
+
let t219 = t214[t218];
|
289
|
+
out_1.push(t219);
|
290
|
+
});
|
291
|
+
out.push(out_1);
|
292
|
+
});
|
293
|
+
return out;
|
294
|
+
}
|
295
|
+
|
296
|
+
export function _shift_rows_up_wrap(input) {
|
297
|
+
let out = [];
|
298
|
+
let t220 = input["rows"];
|
299
|
+
let t225 = t220.length;
|
300
|
+
const t226 = -1;
|
301
|
+
t220.forEach((rows_el_221, rows_i_222) => {
|
302
|
+
let out_1 = [];
|
303
|
+
let t227 = rows_i_222 - t226;
|
304
|
+
let t228 = ((t227 % t225) + t225) % t225;
|
305
|
+
let t229 = t228 + t225;
|
306
|
+
let t230 = ((t229 % t225) + t225) % t225;
|
307
|
+
let t231 = t220[t230];
|
308
|
+
let t232 = t231.length;
|
309
|
+
rows_el_221.forEach((col_el_223, col_i_224) => {
|
310
|
+
let t233 = ((col_i_224 % t232) + t232) % t232;
|
311
|
+
let t234 = t233 + t232;
|
312
|
+
let t235 = ((t234 % t232) + t232) % t232;
|
313
|
+
let t236 = t231[t235];
|
314
|
+
out_1.push(t236);
|
315
|
+
});
|
316
|
+
out.push(out_1);
|
317
|
+
});
|
318
|
+
return out;
|
319
|
+
}
|
320
|
+
|
@@ -0,0 +1,358 @@
|
|
1
|
+
# Autogenerated by Kumi Codegen
|
2
|
+
module Kumi::Compiled::KUMI_031f3aedfffe4329e9a9ba9c9a1b21b3b04919c8b1c1e484b8db833ffeac7cf4
|
3
|
+
def self.from(input_data = nil)
|
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)
|
40
|
+
out = []
|
41
|
+
t1 = input["rows"] || input[:rows]
|
42
|
+
t6 = t1.length
|
43
|
+
t12 = 1
|
44
|
+
t14 = 0
|
45
|
+
t1.each_with_index do |rows_el_2, rows_i_3|
|
46
|
+
out_1 = []
|
47
|
+
t7 = rows_i_3 % t6
|
48
|
+
t8 = t7 + t6
|
49
|
+
t9 = t8 % t6
|
50
|
+
t10 = t1[t9]
|
51
|
+
t11 = t10.length
|
52
|
+
t19 = t11 - t12
|
53
|
+
rows_el_2.each_with_index do |col_el_4, col_i_5|
|
54
|
+
t13 = col_i_5 - t12
|
55
|
+
t15 = t13 >= t14
|
56
|
+
t16 = t13 < t11
|
57
|
+
t17 = t15 && t16
|
58
|
+
t21 = [[ t13, t14 ].max, t19 ].min
|
59
|
+
t22 = t10[t21]
|
60
|
+
t24 = t17 ? t22 : t14
|
61
|
+
out_1 << t24
|
62
|
+
end
|
63
|
+
out << out_1
|
64
|
+
end
|
65
|
+
out
|
66
|
+
end
|
67
|
+
|
68
|
+
def _shift_cols_right_clamp(input = @input)
|
69
|
+
out = []
|
70
|
+
t25 = input["rows"] || input[:rows]
|
71
|
+
t30 = t25.length
|
72
|
+
t36 = 1
|
73
|
+
t40 = 0
|
74
|
+
t25.each_with_index do |rows_el_26, rows_i_27|
|
75
|
+
out_1 = []
|
76
|
+
t31 = rows_i_27 % t30
|
77
|
+
t32 = t31 + t30
|
78
|
+
t33 = t32 % t30
|
79
|
+
t34 = t25[t33]
|
80
|
+
t35 = t34.length
|
81
|
+
t39 = t35 - t36
|
82
|
+
rows_el_26.each_with_index do |col_el_28, col_i_29|
|
83
|
+
t37 = col_i_29 - t36
|
84
|
+
t41 = [[ t37, t40 ].max, t39 ].min
|
85
|
+
t42 = t34[t41]
|
86
|
+
out_1 << t42
|
87
|
+
end
|
88
|
+
out << out_1
|
89
|
+
end
|
90
|
+
out
|
91
|
+
end
|
92
|
+
|
93
|
+
def _shift_cols_right_wrap(input = @input)
|
94
|
+
out = []
|
95
|
+
t43 = input["rows"] || input[:rows]
|
96
|
+
t48 = t43.length
|
97
|
+
t54 = 1
|
98
|
+
t43.each_with_index do |rows_el_44, rows_i_45|
|
99
|
+
out_1 = []
|
100
|
+
t49 = rows_i_45 % t48
|
101
|
+
t50 = t49 + t48
|
102
|
+
t51 = t50 % t48
|
103
|
+
t52 = t43[t51]
|
104
|
+
t53 = t52.length
|
105
|
+
rows_el_44.each_with_index do |col_el_46, col_i_47|
|
106
|
+
t55 = col_i_47 - t54
|
107
|
+
t56 = t55 % t53
|
108
|
+
t57 = t56 + t53
|
109
|
+
t58 = t57 % t53
|
110
|
+
t59 = t52[t58]
|
111
|
+
out_1 << t59
|
112
|
+
end
|
113
|
+
out << out_1
|
114
|
+
end
|
115
|
+
out
|
116
|
+
end
|
117
|
+
|
118
|
+
def _shift_cols_left_zero(input = @input)
|
119
|
+
out = []
|
120
|
+
t60 = input["rows"] || input[:rows]
|
121
|
+
t65 = t60.length
|
122
|
+
t71 = -1
|
123
|
+
t73 = 0
|
124
|
+
t77 = 1
|
125
|
+
t60.each_with_index do |rows_el_61, rows_i_62|
|
126
|
+
out_1 = []
|
127
|
+
t66 = rows_i_62 % t65
|
128
|
+
t67 = t66 + t65
|
129
|
+
t68 = t67 % t65
|
130
|
+
t69 = t60[t68]
|
131
|
+
t70 = t69.length
|
132
|
+
t78 = t70 - t77
|
133
|
+
rows_el_61.each_with_index do |col_el_63, col_i_64|
|
134
|
+
t72 = col_i_64 - t71
|
135
|
+
t74 = t72 >= t73
|
136
|
+
t75 = t72 < t70
|
137
|
+
t76 = t74 && t75
|
138
|
+
t80 = [[ t72, t73 ].max, t78 ].min
|
139
|
+
t81 = t69[t80]
|
140
|
+
t83 = t76 ? t81 : t73
|
141
|
+
out_1 << t83
|
142
|
+
end
|
143
|
+
out << out_1
|
144
|
+
end
|
145
|
+
out
|
146
|
+
end
|
147
|
+
|
148
|
+
def _shift_cols_left_clamp(input = @input)
|
149
|
+
out = []
|
150
|
+
t84 = input["rows"] || input[:rows]
|
151
|
+
t89 = t84.length
|
152
|
+
t95 = -1
|
153
|
+
t97 = 1
|
154
|
+
t99 = 0
|
155
|
+
t84.each_with_index do |rows_el_85, rows_i_86|
|
156
|
+
out_1 = []
|
157
|
+
t90 = rows_i_86 % t89
|
158
|
+
t91 = t90 + t89
|
159
|
+
t92 = t91 % t89
|
160
|
+
t93 = t84[t92]
|
161
|
+
t94 = t93.length
|
162
|
+
t98 = t94 - t97
|
163
|
+
rows_el_85.each_with_index do |col_el_87, col_i_88|
|
164
|
+
t96 = col_i_88 - t95
|
165
|
+
t100 = [[ t96, t99 ].max, t98 ].min
|
166
|
+
t101 = t93[t100]
|
167
|
+
out_1 << t101
|
168
|
+
end
|
169
|
+
out << out_1
|
170
|
+
end
|
171
|
+
out
|
172
|
+
end
|
173
|
+
|
174
|
+
def _shift_cols_left_wrap(input = @input)
|
175
|
+
out = []
|
176
|
+
t102 = input["rows"] || input[:rows]
|
177
|
+
t107 = t102.length
|
178
|
+
t113 = -1
|
179
|
+
t102.each_with_index do |rows_el_103, rows_i_104|
|
180
|
+
out_1 = []
|
181
|
+
t108 = rows_i_104 % t107
|
182
|
+
t109 = t108 + t107
|
183
|
+
t110 = t109 % t107
|
184
|
+
t111 = t102[t110]
|
185
|
+
t112 = t111.length
|
186
|
+
rows_el_103.each_with_index do |col_el_105, col_i_106|
|
187
|
+
t114 = col_i_106 - t113
|
188
|
+
t115 = t114 % t112
|
189
|
+
t116 = t115 + t112
|
190
|
+
t117 = t116 % t112
|
191
|
+
t118 = t111[t117]
|
192
|
+
out_1 << t118
|
193
|
+
end
|
194
|
+
out << out_1
|
195
|
+
end
|
196
|
+
out
|
197
|
+
end
|
198
|
+
|
199
|
+
def _shift_rows_down_zero(input = @input)
|
200
|
+
out = []
|
201
|
+
t119 = input["rows"] || input[:rows]
|
202
|
+
t124 = t119.length
|
203
|
+
t125 = 1
|
204
|
+
t127 = 0
|
205
|
+
t132 = t124 - t125
|
206
|
+
t119.each_with_index do |rows_el_120, rows_i_121|
|
207
|
+
out_1 = []
|
208
|
+
t126 = rows_i_121 - t125
|
209
|
+
t128 = t126 >= t127
|
210
|
+
t129 = t126 < t124
|
211
|
+
t134 = [[ t126, t127 ].max, t132 ].min
|
212
|
+
t130 = t128 && t129
|
213
|
+
t135 = t119[t134]
|
214
|
+
t136 = t135.length
|
215
|
+
rows_el_120.each_with_index do |col_el_122, col_i_123|
|
216
|
+
t137 = col_i_123 % t136
|
217
|
+
t138 = t137 + t136
|
218
|
+
t139 = t138 % t136
|
219
|
+
t140 = t135[t139]
|
220
|
+
t142 = t130 ? t140 : t127
|
221
|
+
out_1 << t142
|
222
|
+
end
|
223
|
+
out << out_1
|
224
|
+
end
|
225
|
+
out
|
226
|
+
end
|
227
|
+
|
228
|
+
def _shift_rows_down_clamp(input = @input)
|
229
|
+
out = []
|
230
|
+
t143 = input["rows"] || input[:rows]
|
231
|
+
t148 = t143.length
|
232
|
+
t149 = 1
|
233
|
+
t153 = 0
|
234
|
+
t152 = t148 - t149
|
235
|
+
t143.each_with_index do |rows_el_144, rows_i_145|
|
236
|
+
out_1 = []
|
237
|
+
t150 = rows_i_145 - t149
|
238
|
+
t154 = [[ t150, t153 ].max, t152 ].min
|
239
|
+
t155 = t143[t154]
|
240
|
+
t156 = t155.length
|
241
|
+
rows_el_144.each_with_index do |col_el_146, col_i_147|
|
242
|
+
t157 = col_i_147 % t156
|
243
|
+
t158 = t157 + t156
|
244
|
+
t159 = t158 % t156
|
245
|
+
t160 = t155[t159]
|
246
|
+
out_1 << t160
|
247
|
+
end
|
248
|
+
out << out_1
|
249
|
+
end
|
250
|
+
out
|
251
|
+
end
|
252
|
+
|
253
|
+
def _shift_rows_down_wrap(input = @input)
|
254
|
+
out = []
|
255
|
+
t161 = input["rows"] || input[:rows]
|
256
|
+
t166 = t161.length
|
257
|
+
t167 = 1
|
258
|
+
t161.each_with_index do |rows_el_162, rows_i_163|
|
259
|
+
out_1 = []
|
260
|
+
t168 = rows_i_163 - t167
|
261
|
+
t169 = t168 % t166
|
262
|
+
t170 = t169 + t166
|
263
|
+
t171 = t170 % t166
|
264
|
+
t172 = t161[t171]
|
265
|
+
t173 = t172.length
|
266
|
+
rows_el_162.each_with_index do |col_el_164, col_i_165|
|
267
|
+
t174 = col_i_165 % t173
|
268
|
+
t175 = t174 + t173
|
269
|
+
t176 = t175 % t173
|
270
|
+
t177 = t172[t176]
|
271
|
+
out_1 << t177
|
272
|
+
end
|
273
|
+
out << out_1
|
274
|
+
end
|
275
|
+
out
|
276
|
+
end
|
277
|
+
|
278
|
+
def _shift_rows_up_zero(input = @input)
|
279
|
+
out = []
|
280
|
+
t178 = input["rows"] || input[:rows]
|
281
|
+
t183 = t178.length
|
282
|
+
t184 = -1
|
283
|
+
t186 = 0
|
284
|
+
t190 = 1
|
285
|
+
t191 = t183 - t190
|
286
|
+
t178.each_with_index do |rows_el_179, rows_i_180|
|
287
|
+
out_1 = []
|
288
|
+
t185 = rows_i_180 - t184
|
289
|
+
t187 = t185 >= t186
|
290
|
+
t188 = t185 < t183
|
291
|
+
t193 = [[ t185, t186 ].max, t191 ].min
|
292
|
+
t189 = t187 && t188
|
293
|
+
t194 = t178[t193]
|
294
|
+
t195 = t194.length
|
295
|
+
rows_el_179.each_with_index do |col_el_181, col_i_182|
|
296
|
+
t196 = col_i_182 % t195
|
297
|
+
t197 = t196 + t195
|
298
|
+
t198 = t197 % t195
|
299
|
+
t199 = t194[t198]
|
300
|
+
t201 = t189 ? t199 : t186
|
301
|
+
out_1 << t201
|
302
|
+
end
|
303
|
+
out << out_1
|
304
|
+
end
|
305
|
+
out
|
306
|
+
end
|
307
|
+
|
308
|
+
def _shift_rows_up_clamp(input = @input)
|
309
|
+
out = []
|
310
|
+
t202 = input["rows"] || input[:rows]
|
311
|
+
t207 = t202.length
|
312
|
+
t208 = -1
|
313
|
+
t210 = 1
|
314
|
+
t212 = 0
|
315
|
+
t211 = t207 - t210
|
316
|
+
t202.each_with_index do |rows_el_203, rows_i_204|
|
317
|
+
out_1 = []
|
318
|
+
t209 = rows_i_204 - t208
|
319
|
+
t213 = [[ t209, t212 ].max, t211 ].min
|
320
|
+
t214 = t202[t213]
|
321
|
+
t215 = t214.length
|
322
|
+
rows_el_203.each_with_index do |col_el_205, col_i_206|
|
323
|
+
t216 = col_i_206 % t215
|
324
|
+
t217 = t216 + t215
|
325
|
+
t218 = t217 % t215
|
326
|
+
t219 = t214[t218]
|
327
|
+
out_1 << t219
|
328
|
+
end
|
329
|
+
out << out_1
|
330
|
+
end
|
331
|
+
out
|
332
|
+
end
|
333
|
+
|
334
|
+
def _shift_rows_up_wrap(input = @input)
|
335
|
+
out = []
|
336
|
+
t220 = input["rows"] || input[:rows]
|
337
|
+
t225 = t220.length
|
338
|
+
t226 = -1
|
339
|
+
t220.each_with_index do |rows_el_221, rows_i_222|
|
340
|
+
out_1 = []
|
341
|
+
t227 = rows_i_222 - t226
|
342
|
+
t228 = t227 % t225
|
343
|
+
t229 = t228 + t225
|
344
|
+
t230 = t229 % t225
|
345
|
+
t231 = t220[t230]
|
346
|
+
t232 = t231.length
|
347
|
+
rows_el_221.each_with_index do |col_el_223, col_i_224|
|
348
|
+
t233 = col_i_224 % t232
|
349
|
+
t234 = t233 + t232
|
350
|
+
t235 = t234 % t232
|
351
|
+
t236 = t231[t235]
|
352
|
+
out_1 << t236
|
353
|
+
end
|
354
|
+
out << out_1
|
355
|
+
end
|
356
|
+
out
|
357
|
+
end
|
358
|
+
end
|