@abaplint/transpiler 2.5.38 → 2.5.39
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.
- package/build/src/chunk.d.ts +19 -19
- package/build/src/chunk.js +146 -146
- package/build/src/db/database_setup_result.d.ts +8 -8
- package/build/src/db/database_setup_result.js +2 -2
- package/build/src/db/index.d.ts +13 -13
- package/build/src/db/index.js +86 -86
- package/build/src/db/sqlite_database_schema.d.ts +9 -9
- package/build/src/db/sqlite_database_schema.js +120 -120
- package/build/src/expressions/_expression_transpiler.d.ts +6 -6
- package/build/src/expressions/_expression_transpiler.js +2 -2
- package/build/src/expressions/arith_operator.d.ts +7 -7
- package/build/src/expressions/arith_operator.js +37 -37
- package/build/src/expressions/attribute_chain.d.ts +7 -7
- package/build/src/expressions/attribute_chain.js +20 -20
- package/build/src/expressions/attribute_name.d.ts +7 -7
- package/build/src/expressions/attribute_name.js +10 -10
- package/build/src/expressions/call_transformation_options.d.ts +7 -7
- package/build/src/expressions/call_transformation_options.js +27 -27
- package/build/src/expressions/call_transformation_parameters.d.ts +7 -7
- package/build/src/expressions/call_transformation_parameters.js +36 -36
- package/build/src/expressions/compare.d.ts +7 -7
- package/build/src/expressions/compare.js +88 -88
- package/build/src/expressions/compare_operator.d.ts +7 -7
- package/build/src/expressions/compare_operator.js +54 -54
- package/build/src/expressions/component_chain.d.ts +7 -7
- package/build/src/expressions/component_chain.js +20 -20
- package/build/src/expressions/component_chain_simple.d.ts +7 -7
- package/build/src/expressions/component_chain_simple.js +28 -28
- package/build/src/expressions/component_compare.d.ts +7 -7
- package/build/src/expressions/component_compare.js +49 -49
- package/build/src/expressions/component_cond.d.ts +7 -7
- package/build/src/expressions/component_cond.js +33 -33
- package/build/src/expressions/component_cond_sub.d.ts +7 -7
- package/build/src/expressions/component_cond_sub.js +36 -36
- package/build/src/expressions/cond.d.ts +7 -7
- package/build/src/expressions/cond.js +26 -26
- package/build/src/expressions/cond_sub.d.ts +7 -7
- package/build/src/expressions/cond_sub.js +26 -26
- package/build/src/expressions/constant.d.ts +10 -10
- package/build/src/expressions/constant.js +86 -86
- package/build/src/expressions/database_table.d.ts +7 -7
- package/build/src/expressions/database_table.js +20 -20
- package/build/src/expressions/field_chain.d.ts +10 -10
- package/build/src/expressions/field_chain.js +92 -92
- package/build/src/expressions/field_length.d.ts +7 -7
- package/build/src/expressions/field_length.js +25 -25
- package/build/src/expressions/field_offset.d.ts +7 -7
- package/build/src/expressions/field_offset.js +25 -25
- package/build/src/expressions/field_symbol.d.ts +7 -7
- package/build/src/expressions/field_symbol.js +13 -13
- package/build/src/expressions/function_exporting.d.ts +7 -7
- package/build/src/expressions/function_exporting.js +28 -28
- package/build/src/expressions/function_parameters.d.ts +7 -7
- package/build/src/expressions/function_parameters.js +36 -36
- package/build/src/expressions/index.d.ts +50 -50
- package/build/src/expressions/index.js +66 -66
- package/build/src/expressions/message_number.d.ts +7 -7
- package/build/src/expressions/message_number.js +10 -10
- package/build/src/expressions/method_call.d.ts +7 -7
- package/build/src/expressions/method_call.js +37 -37
- package/build/src/expressions/method_call_body.d.ts +10 -10
- package/build/src/expressions/method_call_body.js +29 -29
- package/build/src/expressions/method_call_chain.d.ts +7 -7
- package/build/src/expressions/method_call_chain.js +66 -66
- package/build/src/expressions/method_call_param.d.ts +10 -10
- package/build/src/expressions/method_call_param.js +49 -49
- package/build/src/expressions/method_parameters.d.ts +7 -7
- package/build/src/expressions/method_parameters.js +34 -34
- package/build/src/expressions/method_source.d.ts +9 -9
- package/build/src/expressions/method_source.js +111 -111
- package/build/src/expressions/parameter_list_s.d.ts +7 -7
- package/build/src/expressions/parameter_list_s.js +17 -17
- package/build/src/expressions/parameter_list_t.d.ts +7 -7
- package/build/src/expressions/parameter_list_t.js +17 -17
- package/build/src/expressions/parameter_name.d.ts +7 -7
- package/build/src/expressions/parameter_name.js +12 -12
- package/build/src/expressions/parameter_s.d.ts +7 -7
- package/build/src/expressions/parameter_s.js +15 -15
- package/build/src/expressions/parameter_t.d.ts +7 -7
- package/build/src/expressions/parameter_t.js +15 -15
- package/build/src/expressions/simple_source1.d.ts +7 -7
- package/build/src/expressions/simple_source1.js +10 -10
- package/build/src/expressions/simple_source2.d.ts +7 -7
- package/build/src/expressions/simple_source2.js +10 -10
- package/build/src/expressions/simple_source3.d.ts +9 -9
- package/build/src/expressions/simple_source3.js +13 -13
- package/build/src/expressions/simple_source4.d.ts +7 -7
- package/build/src/expressions/simple_source4.js +10 -10
- package/build/src/expressions/source.d.ts +9 -9
- package/build/src/expressions/source.js +96 -96
- package/build/src/expressions/source_field.d.ts +7 -7
- package/build/src/expressions/source_field.js +14 -14
- package/build/src/expressions/source_field_symbol.d.ts +7 -7
- package/build/src/expressions/source_field_symbol.js +10 -10
- package/build/src/expressions/sql_cond.d.ts +11 -11
- package/build/src/expressions/sql_cond.js +128 -128
- package/build/src/expressions/sql_from.d.ts +7 -7
- package/build/src/expressions/sql_from.js +25 -25
- package/build/src/expressions/sql_join.d.ts +7 -7
- package/build/src/expressions/sql_join.js +24 -24
- package/build/src/expressions/sql_source.d.ts +7 -7
- package/build/src/expressions/sql_source.js +14 -14
- package/build/src/expressions/sql_source_simple.d.ts +7 -7
- package/build/src/expressions/sql_source_simple.js +14 -14
- package/build/src/expressions/sql_target.d.ts +7 -7
- package/build/src/expressions/sql_target.js +11 -11
- package/build/src/expressions/string_template.d.ts +7 -7
- package/build/src/expressions/string_template.js +39 -39
- package/build/src/expressions/string_template_source.d.ts +8 -8
- package/build/src/expressions/string_template_source.js +52 -52
- package/build/src/expressions/target.d.ts +7 -7
- package/build/src/expressions/target.js +83 -83
- package/build/src/handlers/handle_abap.d.ts +12 -12
- package/build/src/handlers/handle_abap.js +144 -144
- package/build/src/handlers/handle_data_element.d.ts +5 -5
- package/build/src/handlers/handle_data_element.js +35 -35
- package/build/src/handlers/handle_enqu.d.ts +5 -5
- package/build/src/handlers/handle_enqu.js +27 -27
- package/build/src/handlers/handle_smim.d.ts +5 -5
- package/build/src/handlers/handle_smim.js +42 -42
- package/build/src/handlers/handle_table.d.ts +5 -5
- package/build/src/handlers/handle_table.js +29 -29
- package/build/src/handlers/handle_table_type.d.ts +5 -5
- package/build/src/handlers/handle_table_type.js +28 -28
- package/build/src/handlers/handle_type_pool.d.ts +5 -5
- package/build/src/handlers/handle_type_pool.js +38 -38
- package/build/src/handlers/handle_view.d.ts +5 -5
- package/build/src/handlers/handle_view.js +30 -30
- package/build/src/handlers/handle_w3mi.d.ts +5 -5
- package/build/src/handlers/handle_w3mi.js +42 -42
- package/build/src/index.d.ts +11 -11
- package/build/src/index.js +95 -103
- package/build/src/keywords.d.ts +9 -9
- package/build/src/keywords.js +91 -91
- package/build/src/rearranger.d.ts +7 -7
- package/build/src/rearranger.js +109 -109
- package/build/src/requires.d.ts +7 -7
- package/build/src/requires.js +111 -111
- package/build/src/statements/_statement_transpiler.d.ts +6 -6
- package/build/src/statements/_statement_transpiler.js +2 -2
- package/build/src/statements/add.d.ts +7 -7
- package/build/src/statements/add.js +20 -20
- package/build/src/statements/append.d.ts +7 -7
- package/build/src/statements/append.js +70 -70
- package/build/src/statements/assert.d.ts +7 -7
- package/build/src/statements/assert.js +15 -15
- package/build/src/statements/assign.d.ts +7 -7
- package/build/src/statements/assign.js +82 -82
- package/build/src/statements/at.d.ts +7 -7
- package/build/src/statements/at.js +10 -10
- package/build/src/statements/authority_check.d.ts +7 -7
- package/build/src/statements/authority_check.js +14 -14
- package/build/src/statements/break.d.ts +7 -7
- package/build/src/statements/break.js +10 -10
- package/build/src/statements/break_id.d.ts +7 -7
- package/build/src/statements/break_id.js +11 -11
- package/build/src/statements/call.d.ts +7 -7
- package/build/src/statements/call.js +82 -82
- package/build/src/statements/call_function.d.ts +7 -7
- package/build/src/statements/call_function.js +40 -40
- package/build/src/statements/call_kernel.d.ts +7 -7
- package/build/src/statements/call_kernel.js +21 -21
- package/build/src/statements/call_screen.d.ts +7 -7
- package/build/src/statements/call_screen.js +10 -10
- package/build/src/statements/call_transaction.d.ts +7 -7
- package/build/src/statements/call_transaction.js +10 -10
- package/build/src/statements/call_transformation.d.ts +7 -7
- package/build/src/statements/call_transformation.js +37 -37
- package/build/src/statements/case.d.ts +7 -7
- package/build/src/statements/case.js +16 -16
- package/build/src/statements/check.d.ts +7 -7
- package/build/src/statements/check.js +24 -24
- package/build/src/statements/class_deferred.d.ts +7 -7
- package/build/src/statements/class_deferred.js +10 -10
- package/build/src/statements/class_definition_load.d.ts +7 -7
- package/build/src/statements/class_definition_load.js +11 -11
- package/build/src/statements/class_implementation.d.ts +9 -9
- package/build/src/statements/class_implementation.js +53 -53
- package/build/src/statements/class_local_friends.d.ts +7 -7
- package/build/src/statements/class_local_friends.js +10 -10
- package/build/src/statements/clear.d.ts +7 -7
- package/build/src/statements/clear.js +16 -16
- package/build/src/statements/close_dataset.d.ts +7 -7
- package/build/src/statements/close_dataset.js +10 -10
- package/build/src/statements/collect.d.ts +7 -7
- package/build/src/statements/collect.js +22 -22
- package/build/src/statements/commit.d.ts +7 -7
- package/build/src/statements/commit.js +10 -10
- package/build/src/statements/concatenate.d.ts +7 -7
- package/build/src/statements/concatenate.js +33 -33
- package/build/src/statements/condense.d.ts +7 -7
- package/build/src/statements/condense.js +17 -17
- package/build/src/statements/constant.d.ts +7 -7
- package/build/src/statements/constant.js +10 -10
- package/build/src/statements/continue.d.ts +7 -7
- package/build/src/statements/continue.js +10 -10
- package/build/src/statements/convert.d.ts +7 -7
- package/build/src/statements/convert.js +42 -42
- package/build/src/statements/create_data.d.ts +7 -7
- package/build/src/statements/create_data.js +70 -70
- package/build/src/statements/create_object.d.ts +8 -8
- package/build/src/statements/create_object.js +74 -74
- package/build/src/statements/data.d.ts +8 -8
- package/build/src/statements/data.js +53 -53
- package/build/src/statements/delete_database.d.ts +7 -7
- package/build/src/statements/delete_database.js +23 -23
- package/build/src/statements/delete_dataset.d.ts +7 -7
- package/build/src/statements/delete_dataset.js +10 -10
- package/build/src/statements/delete_internal.d.ts +7 -7
- package/build/src/statements/delete_internal.js +52 -52
- package/build/src/statements/delete_textpool.d.ts +7 -7
- package/build/src/statements/delete_textpool.js +10 -10
- package/build/src/statements/describe.d.ts +7 -7
- package/build/src/statements/describe.js +45 -45
- package/build/src/statements/do.d.ts +9 -9
- package/build/src/statements/do.js +26 -26
- package/build/src/statements/editor_call.d.ts +7 -7
- package/build/src/statements/editor_call.js +10 -10
- package/build/src/statements/else.d.ts +7 -7
- package/build/src/statements/else.js +10 -10
- package/build/src/statements/else_if.d.ts +7 -7
- package/build/src/statements/else_if.js +15 -15
- package/build/src/statements/end_at.d.ts +7 -7
- package/build/src/statements/end_at.js +10 -10
- package/build/src/statements/end_case.d.ts +7 -7
- package/build/src/statements/end_case.js +10 -10
- package/build/src/statements/end_class.d.ts +7 -7
- package/build/src/statements/end_class.js +13 -13
- package/build/src/statements/end_do.d.ts +9 -9
- package/build/src/statements/end_do.js +13 -13
- package/build/src/statements/end_enhancement_section.d.ts +7 -7
- package/build/src/statements/end_enhancement_section.js +11 -11
- package/build/src/statements/end_form.d.ts +7 -7
- package/build/src/statements/end_form.js +10 -10
- package/build/src/statements/end_if.d.ts +7 -7
- package/build/src/statements/end_if.js +10 -10
- package/build/src/statements/end_loop.d.ts +7 -7
- package/build/src/statements/end_loop.js +10 -10
- package/build/src/statements/end_method.d.ts +8 -8
- package/build/src/statements/end_method.js +57 -57
- package/build/src/statements/end_try.d.ts +7 -7
- package/build/src/statements/end_try.js +10 -10
- package/build/src/statements/end_while.d.ts +9 -9
- package/build/src/statements/end_while.js +13 -13
- package/build/src/statements/enhancement_section.d.ts +7 -7
- package/build/src/statements/enhancement_section.js +11 -11
- package/build/src/statements/exit.d.ts +7 -7
- package/build/src/statements/exit.js +16 -16
- package/build/src/statements/export.d.ts +7 -7
- package/build/src/statements/export.js +10 -10
- package/build/src/statements/field_symbol.d.ts +7 -7
- package/build/src/statements/field_symbol.js +32 -32
- package/build/src/statements/find.d.ts +7 -7
- package/build/src/statements/find.js +74 -74
- package/build/src/statements/form.d.ts +6 -6
- package/build/src/statements/form.js +14 -14
- package/build/src/statements/free.d.ts +7 -7
- package/build/src/statements/free.js +10 -10
- package/build/src/statements/free_memory.d.ts +7 -7
- package/build/src/statements/free_memory.js +10 -10
- package/build/src/statements/function_pool.d.ts +7 -7
- package/build/src/statements/function_pool.js +10 -10
- package/build/src/statements/get_bit.d.ts +7 -7
- package/build/src/statements/get_bit.js +18 -18
- package/build/src/statements/get_dataset.d.ts +7 -7
- package/build/src/statements/get_dataset.js +10 -10
- package/build/src/statements/get_locale.d.ts +7 -7
- package/build/src/statements/get_locale.js +12 -12
- package/build/src/statements/get_parameter.d.ts +7 -7
- package/build/src/statements/get_parameter.js +17 -17
- package/build/src/statements/get_reference.d.ts +7 -7
- package/build/src/statements/get_reference.js +29 -29
- package/build/src/statements/get_run_time.d.ts +7 -7
- package/build/src/statements/get_run_time.js +16 -16
- package/build/src/statements/get_time.d.ts +7 -7
- package/build/src/statements/get_time.js +22 -22
- package/build/src/statements/if.d.ts +7 -7
- package/build/src/statements/if.js +16 -16
- package/build/src/statements/import.d.ts +7 -7
- package/build/src/statements/import.js +10 -10
- package/build/src/statements/include.d.ts +7 -7
- package/build/src/statements/include.js +11 -11
- package/build/src/statements/index.d.ts +141 -141
- package/build/src/statements/index.js +157 -157
- package/build/src/statements/initialization.d.ts +7 -7
- package/build/src/statements/initialization.js +10 -10
- package/build/src/statements/insert_database.d.ts +7 -7
- package/build/src/statements/insert_database.js +28 -28
- package/build/src/statements/insert_internal.d.ts +7 -7
- package/build/src/statements/insert_internal.js +41 -41
- package/build/src/statements/insert_report.d.ts +7 -7
- package/build/src/statements/insert_report.js +10 -10
- package/build/src/statements/insert_textpool.d.ts +7 -7
- package/build/src/statements/insert_textpool.js +10 -10
- package/build/src/statements/leave.d.ts +7 -7
- package/build/src/statements/leave.js +10 -10
- package/build/src/statements/log_point.d.ts +7 -7
- package/build/src/statements/log_point.js +11 -11
- package/build/src/statements/loop.d.ts +15 -15
- package/build/src/statements/loop.js +115 -115
- package/build/src/statements/loop_at_screen.d.ts +7 -7
- package/build/src/statements/loop_at_screen.js +10 -10
- package/build/src/statements/macro_call.d.ts +7 -7
- package/build/src/statements/macro_call.js +10 -10
- package/build/src/statements/message.d.ts +7 -7
- package/build/src/statements/message.js +80 -80
- package/build/src/statements/method_implementation.d.ts +9 -9
- package/build/src/statements/method_implementation.js +182 -182
- package/build/src/statements/modify_database.d.ts +7 -7
- package/build/src/statements/modify_database.js +23 -23
- package/build/src/statements/modify_internal.d.ts +7 -7
- package/build/src/statements/modify_internal.js +31 -31
- package/build/src/statements/modify_screen.d.ts +7 -7
- package/build/src/statements/modify_screen.js +10 -10
- package/build/src/statements/move.d.ts +7 -7
- package/build/src/statements/move.js +35 -35
- package/build/src/statements/move_corresponding.d.ts +7 -7
- package/build/src/statements/move_corresponding.js +15 -15
- package/build/src/statements/open_dataset.d.ts +7 -7
- package/build/src/statements/open_dataset.js +10 -10
- package/build/src/statements/overlay.d.ts +7 -7
- package/build/src/statements/overlay.js +18 -18
- package/build/src/statements/parameter.d.ts +7 -7
- package/build/src/statements/parameter.js +10 -10
- package/build/src/statements/perform.d.ts +7 -7
- package/build/src/statements/perform.js +19 -19
- package/build/src/statements/raise.d.ts +7 -7
- package/build/src/statements/raise.js +30 -30
- package/build/src/statements/raise_event.d.ts +7 -7
- package/build/src/statements/raise_event.js +11 -11
- package/build/src/statements/read_dataset.d.ts +7 -7
- package/build/src/statements/read_dataset.js +10 -10
- package/build/src/statements/read_line.d.ts +7 -7
- package/build/src/statements/read_line.js +10 -10
- package/build/src/statements/read_report.d.ts +7 -7
- package/build/src/statements/read_report.js +25 -25
- package/build/src/statements/read_table.d.ts +7 -7
- package/build/src/statements/read_table.js +90 -90
- package/build/src/statements/read_textpool.d.ts +7 -7
- package/build/src/statements/read_textpool.js +10 -10
- package/build/src/statements/receive.d.ts +7 -7
- package/build/src/statements/receive.js +10 -10
- package/build/src/statements/refresh.d.ts +7 -7
- package/build/src/statements/refresh.js +16 -16
- package/build/src/statements/replace.d.ts +7 -7
- package/build/src/statements/replace.js +47 -47
- package/build/src/statements/report.d.ts +7 -7
- package/build/src/statements/report.js +10 -10
- package/build/src/statements/retry.d.ts +7 -7
- package/build/src/statements/retry.js +10 -10
- package/build/src/statements/return.d.ts +7 -7
- package/build/src/statements/return.js +29 -29
- package/build/src/statements/rollback.d.ts +7 -7
- package/build/src/statements/rollback.js +10 -10
- package/build/src/statements/scan.d.ts +7 -7
- package/build/src/statements/scan.js +31 -31
- package/build/src/statements/search.d.ts +7 -7
- package/build/src/statements/search.js +10 -10
- package/build/src/statements/select.d.ts +9 -9
- package/build/src/statements/select.js +122 -122
- package/build/src/statements/select_option.d.ts +7 -7
- package/build/src/statements/select_option.js +10 -10
- package/build/src/statements/selection_screen.d.ts +7 -7
- package/build/src/statements/selection_screen.js +10 -10
- package/build/src/statements/set_bit.d.ts +7 -7
- package/build/src/statements/set_bit.js +20 -20
- package/build/src/statements/set_dataset.d.ts +7 -7
- package/build/src/statements/set_dataset.js +10 -10
- package/build/src/statements/set_handler.d.ts +7 -7
- package/build/src/statements/set_handler.js +26 -26
- package/build/src/statements/set_language.d.ts +7 -7
- package/build/src/statements/set_language.js +10 -10
- package/build/src/statements/set_locale.d.ts +7 -7
- package/build/src/statements/set_locale.js +12 -12
- package/build/src/statements/set_parameter.d.ts +7 -7
- package/build/src/statements/set_parameter.js +10 -10
- package/build/src/statements/set_pf_status.d.ts +7 -7
- package/build/src/statements/set_pf_status.js +10 -10
- package/build/src/statements/set_screen.d.ts +7 -7
- package/build/src/statements/set_screen.js +10 -10
- package/build/src/statements/set_titlebar.d.ts +7 -7
- package/build/src/statements/set_titlebar.js +10 -10
- package/build/src/statements/shift.d.ts +7 -7
- package/build/src/statements/shift.js +42 -42
- package/build/src/statements/sort.d.ts +8 -8
- package/build/src/statements/sort.js +48 -48
- package/build/src/statements/sort_dataset.d.ts +7 -7
- package/build/src/statements/sort_dataset.js +10 -10
- package/build/src/statements/split.d.ts +7 -7
- package/build/src/statements/split.js +23 -23
- package/build/src/statements/start_of_selection.d.ts +6 -6
- package/build/src/statements/start_of_selection.js +10 -10
- package/build/src/statements/submit.d.ts +7 -7
- package/build/src/statements/submit.js +10 -10
- package/build/src/statements/subtract.d.ts +7 -7
- package/build/src/statements/subtract.js +20 -20
- package/build/src/statements/syntax_check.d.ts +7 -7
- package/build/src/statements/syntax_check.js +10 -10
- package/build/src/statements/tables.d.ts +7 -7
- package/build/src/statements/tables.js +30 -30
- package/build/src/statements/translate.d.ts +7 -7
- package/build/src/statements/translate.js +29 -29
- package/build/src/statements/truncate_dataset.d.ts +7 -7
- package/build/src/statements/truncate_dataset.js +10 -10
- package/build/src/statements/try.d.ts +7 -7
- package/build/src/statements/try.js +10 -10
- package/build/src/statements/type.d.ts +6 -6
- package/build/src/statements/type.js +10 -10
- package/build/src/statements/type_pools.d.ts +7 -7
- package/build/src/statements/type_pools.js +11 -11
- package/build/src/statements/unassign.d.ts +7 -7
- package/build/src/statements/unassign.js +13 -13
- package/build/src/statements/unpack.d.ts +7 -7
- package/build/src/statements/unpack.js +10 -10
- package/build/src/statements/update_database.d.ts +7 -7
- package/build/src/statements/update_database.js +29 -29
- package/build/src/statements/wait.d.ts +7 -7
- package/build/src/statements/wait.js +28 -28
- package/build/src/statements/when.d.ts +9 -9
- package/build/src/statements/when.js +23 -23
- package/build/src/statements/while.d.ts +9 -9
- package/build/src/statements/while.js +21 -21
- package/build/src/statements/write.d.ts +7 -7
- package/build/src/statements/write.js +56 -56
- package/build/src/structures/_structure_transpiler.d.ts +6 -6
- package/build/src/structures/_structure_transpiler.js +2 -2
- package/build/src/structures/at.d.ts +7 -7
- package/build/src/structures/at.js +47 -47
- package/build/src/structures/at_first.d.ts +7 -7
- package/build/src/structures/at_first.js +16 -16
- package/build/src/structures/at_last.d.ts +7 -7
- package/build/src/structures/at_last.js +16 -16
- package/build/src/structures/case.d.ts +7 -7
- package/build/src/structures/case.js +53 -53
- package/build/src/structures/class_definition.d.ts +7 -7
- package/build/src/structures/class_definition.js +27 -27
- package/build/src/structures/class_implementation.d.ts +14 -14
- package/build/src/structures/class_implementation.js +146 -146
- package/build/src/structures/constants.d.ts +7 -7
- package/build/src/structures/constants.js +33 -33
- package/build/src/structures/data.d.ts +7 -7
- package/build/src/structures/data.js +26 -26
- package/build/src/structures/define.d.ts +7 -7
- package/build/src/structures/define.js +11 -11
- package/build/src/structures/do.d.ts +7 -7
- package/build/src/structures/do.js +27 -27
- package/build/src/structures/function_module.d.ts +8 -8
- package/build/src/structures/function_module.js +71 -71
- package/build/src/structures/index.d.ts +17 -17
- package/build/src/structures/index.js +33 -33
- package/build/src/structures/interface.d.ts +9 -9
- package/build/src/structures/interface.js +74 -74
- package/build/src/structures/loop.d.ts +7 -7
- package/build/src/structures/loop.js +93 -93
- package/build/src/structures/select.d.ts +7 -7
- package/build/src/structures/select.js +34 -34
- package/build/src/structures/try.d.ts +8 -8
- package/build/src/structures/try.js +69 -69
- package/build/src/structures/types.d.ts +7 -7
- package/build/src/structures/types.js +10 -10
- package/build/src/structures/when.d.ts +7 -7
- package/build/src/structures/when.js +15 -15
- package/build/src/structures/while.d.ts +7 -7
- package/build/src/structures/while.js +27 -27
- package/build/src/transpile_types.d.ts +6 -6
- package/build/src/transpile_types.js +175 -175
- package/build/src/traversal.d.ts +52 -52
- package/build/src/traversal.js +549 -549
- package/build/src/types.d.ts +58 -58
- package/build/src/types.js +2 -2
- package/build/src/unique_identifier.d.ts +9 -9
- package/build/src/unique_identifier.js +27 -27
- package/build/src/unit_test.d.ts +15 -15
- package/build/src/unit_test.js +183 -183
- package/build/src/validation.d.ts +8 -8
- package/build/src/validation.js +116 -116
- package/package.json +2 -2
package/build/src/types.d.ts
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { Chunk } from "./chunk";
|
|
2
|
-
import * as abaplint from "@abaplint/core";
|
|
3
|
-
import { TestMethodList } from "./unit_test";
|
|
4
|
-
import { DatabaseSetupResult } from "./db/database_setup_result";
|
|
5
|
-
export interface IFile {
|
|
6
|
-
filename: string;
|
|
7
|
-
relative?: string;
|
|
8
|
-
contents: string;
|
|
9
|
-
}
|
|
10
|
-
export interface IObjectIdentifier {
|
|
11
|
-
name: string;
|
|
12
|
-
type: string;
|
|
13
|
-
}
|
|
14
|
-
export interface IOutput {
|
|
15
|
-
objects: IOutputFile[];
|
|
16
|
-
reg: abaplint.IRegistry;
|
|
17
|
-
unitTestScript: string;
|
|
18
|
-
unitTestScriptOpen: string;
|
|
19
|
-
initializationScript: string;
|
|
20
|
-
initializationScript2: string;
|
|
21
|
-
databaseSetup: DatabaseSetupResult;
|
|
22
|
-
}
|
|
23
|
-
export interface IRequire {
|
|
24
|
-
name: string | undefined;
|
|
25
|
-
filename: string;
|
|
26
|
-
}
|
|
27
|
-
export interface IProgress {
|
|
28
|
-
set(total: number, text: string): void;
|
|
29
|
-
tick(text: string): Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
/** one javascript output file for each object */
|
|
32
|
-
export interface IOutputFile {
|
|
33
|
-
object: IObjectIdentifier;
|
|
34
|
-
filename: string;
|
|
35
|
-
chunk: Chunk;
|
|
36
|
-
requires: readonly IRequire[];
|
|
37
|
-
exports: readonly string[];
|
|
38
|
-
}
|
|
39
|
-
export interface ITranspilerOptions {
|
|
40
|
-
/** ignore syntax check, used for internal testing */
|
|
41
|
-
ignoreSyntaxCheck?: boolean;
|
|
42
|
-
/** adds common js modules */
|
|
43
|
-
addCommonJS?: boolean;
|
|
44
|
-
/** adds filenames as comments in the output js */
|
|
45
|
-
addFilenames?: boolean;
|
|
46
|
-
/** skip outputing constants, used for internal testing */
|
|
47
|
-
skipConstants?: boolean;
|
|
48
|
-
/** sets behavior for unknown types, either fail at compile- or run-time */
|
|
49
|
-
unknownTypes?: "compileError" | "runtimeError";
|
|
50
|
-
skip?: TestMethodList;
|
|
51
|
-
only?: TestMethodList;
|
|
52
|
-
/** extra setup script to be executed during initialization */
|
|
53
|
-
extraSetup?: string;
|
|
54
|
-
/** list of keywords to rename, if not supplied default will be used */
|
|
55
|
-
keywords?: string[];
|
|
56
|
-
/** dont insert into REPOSRC */
|
|
57
|
-
skipReposrc?: boolean;
|
|
58
|
-
}
|
|
1
|
+
import { Chunk } from "./chunk";
|
|
2
|
+
import * as abaplint from "@abaplint/core";
|
|
3
|
+
import { TestMethodList } from "./unit_test";
|
|
4
|
+
import { DatabaseSetupResult } from "./db/database_setup_result";
|
|
5
|
+
export interface IFile {
|
|
6
|
+
filename: string;
|
|
7
|
+
relative?: string;
|
|
8
|
+
contents: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IObjectIdentifier {
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IOutput {
|
|
15
|
+
objects: IOutputFile[];
|
|
16
|
+
reg: abaplint.IRegistry;
|
|
17
|
+
unitTestScript: string;
|
|
18
|
+
unitTestScriptOpen: string;
|
|
19
|
+
initializationScript: string;
|
|
20
|
+
initializationScript2: string;
|
|
21
|
+
databaseSetup: DatabaseSetupResult;
|
|
22
|
+
}
|
|
23
|
+
export interface IRequire {
|
|
24
|
+
name: string | undefined;
|
|
25
|
+
filename: string;
|
|
26
|
+
}
|
|
27
|
+
export interface IProgress {
|
|
28
|
+
set(total: number, text: string): void;
|
|
29
|
+
tick(text: string): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/** one javascript output file for each object */
|
|
32
|
+
export interface IOutputFile {
|
|
33
|
+
object: IObjectIdentifier;
|
|
34
|
+
filename: string;
|
|
35
|
+
chunk: Chunk;
|
|
36
|
+
requires: readonly IRequire[];
|
|
37
|
+
exports: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
export interface ITranspilerOptions {
|
|
40
|
+
/** ignore syntax check, used for internal testing */
|
|
41
|
+
ignoreSyntaxCheck?: boolean;
|
|
42
|
+
/** adds common js modules */
|
|
43
|
+
addCommonJS?: boolean;
|
|
44
|
+
/** adds filenames as comments in the output js */
|
|
45
|
+
addFilenames?: boolean;
|
|
46
|
+
/** skip outputing constants, used for internal testing */
|
|
47
|
+
skipConstants?: boolean;
|
|
48
|
+
/** sets behavior for unknown types, either fail at compile- or run-time */
|
|
49
|
+
unknownTypes?: "compileError" | "runtimeError";
|
|
50
|
+
skip?: TestMethodList;
|
|
51
|
+
only?: TestMethodList;
|
|
52
|
+
/** extra setup script to be executed during initialization */
|
|
53
|
+
extraSetup?: string;
|
|
54
|
+
/** list of keywords to rename, if not supplied default will be used */
|
|
55
|
+
keywords?: string[];
|
|
56
|
+
/** dont insert into REPOSRC */
|
|
57
|
+
skipReposrc?: boolean;
|
|
58
|
+
}
|
package/build/src/types.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare class UniqueIdentifier {
|
|
2
|
-
private static counter;
|
|
3
|
-
private static indexBackup;
|
|
4
|
-
static reset(): void;
|
|
5
|
-
static get(): string;
|
|
6
|
-
static resetIndexBackup(): void;
|
|
7
|
-
static getIndexBackup(): string;
|
|
8
|
-
static getIndexBackup1(): string;
|
|
9
|
-
}
|
|
1
|
+
export declare class UniqueIdentifier {
|
|
2
|
+
private static counter;
|
|
3
|
+
private static indexBackup;
|
|
4
|
+
static reset(): void;
|
|
5
|
+
static get(): string;
|
|
6
|
+
static resetIndexBackup(): void;
|
|
7
|
+
static getIndexBackup(): string;
|
|
8
|
+
static getIndexBackup1(): string;
|
|
9
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UniqueIdentifier = void 0;
|
|
4
|
-
class UniqueIdentifier {
|
|
5
|
-
static reset() {
|
|
6
|
-
this.counter = 0;
|
|
7
|
-
}
|
|
8
|
-
static get() {
|
|
9
|
-
// as part of the validation, it is ensured that no identifiers exists
|
|
10
|
-
// in the input source with ^unique\d+$
|
|
11
|
-
this.counter++;
|
|
12
|
-
return "unique" + this.counter;
|
|
13
|
-
}
|
|
14
|
-
static resetIndexBackup() {
|
|
15
|
-
this.indexBackup = 0;
|
|
16
|
-
}
|
|
17
|
-
static getIndexBackup() {
|
|
18
|
-
this.indexBackup++;
|
|
19
|
-
return "indexBackup" + this.indexBackup;
|
|
20
|
-
}
|
|
21
|
-
static getIndexBackup1() {
|
|
22
|
-
return "indexBackup1";
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
UniqueIdentifier.
|
|
27
|
-
UniqueIdentifier
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UniqueIdentifier = void 0;
|
|
4
|
+
class UniqueIdentifier {
|
|
5
|
+
static reset() {
|
|
6
|
+
this.counter = 0;
|
|
7
|
+
}
|
|
8
|
+
static get() {
|
|
9
|
+
// as part of the validation, it is ensured that no identifiers exists
|
|
10
|
+
// in the input source with ^unique\d+$
|
|
11
|
+
this.counter++;
|
|
12
|
+
return "unique" + this.counter;
|
|
13
|
+
}
|
|
14
|
+
static resetIndexBackup() {
|
|
15
|
+
this.indexBackup = 0;
|
|
16
|
+
}
|
|
17
|
+
static getIndexBackup() {
|
|
18
|
+
this.indexBackup++;
|
|
19
|
+
return "indexBackup" + this.indexBackup;
|
|
20
|
+
}
|
|
21
|
+
static getIndexBackup1() {
|
|
22
|
+
return "indexBackup1";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
UniqueIdentifier.counter = 0;
|
|
26
|
+
UniqueIdentifier.indexBackup = 0;
|
|
27
|
+
exports.UniqueIdentifier = UniqueIdentifier;
|
|
28
28
|
//# sourceMappingURL=unique_identifier.js.map
|
package/build/src/unit_test.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as abaplint from "@abaplint/core";
|
|
2
|
-
import { DatabaseSetupResult } from "./db/database_setup_result";
|
|
3
|
-
export
|
|
4
|
-
object: string;
|
|
5
|
-
class: string;
|
|
6
|
-
method: string;
|
|
7
|
-
}[];
|
|
8
|
-
export declare class UnitTest {
|
|
9
|
-
initializationScript(reg: abaplint.IRegistry, dbSetup: DatabaseSetupResult, extraSetup?: string, useImport?: boolean): string;
|
|
10
|
-
private escapeNamespace;
|
|
11
|
-
unitTestScriptOpen(reg: abaplint.IRegistry, _skip?: TestMethodList, _only?: TestMethodList): string;
|
|
12
|
-
unitTestScript(reg: abaplint.IRegistry, skip?: TestMethodList, _only?: TestMethodList): string;
|
|
13
|
-
private buildImports;
|
|
14
|
-
private hasClassConstructor;
|
|
15
|
-
}
|
|
1
|
+
import * as abaplint from "@abaplint/core";
|
|
2
|
+
import { DatabaseSetupResult } from "./db/database_setup_result";
|
|
3
|
+
export type TestMethodList = {
|
|
4
|
+
object: string;
|
|
5
|
+
class: string;
|
|
6
|
+
method: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare class UnitTest {
|
|
9
|
+
initializationScript(reg: abaplint.IRegistry, dbSetup: DatabaseSetupResult, extraSetup?: string, useImport?: boolean): string;
|
|
10
|
+
private escapeNamespace;
|
|
11
|
+
unitTestScriptOpen(reg: abaplint.IRegistry, _skip?: TestMethodList, _only?: TestMethodList): string;
|
|
12
|
+
unitTestScript(reg: abaplint.IRegistry, skip?: TestMethodList, _only?: TestMethodList): string;
|
|
13
|
+
private buildImports;
|
|
14
|
+
private hasClassConstructor;
|
|
15
|
+
}
|
package/build/src/unit_test.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnitTest = void 0;
|
|
4
|
-
/* eslint-disable max-len */
|
|
5
|
-
const abaplint = require("@abaplint/core");
|
|
6
|
-
class UnitTest {
|
|
7
|
-
// todo, move this method somewhere else, its much more than just unit test relevant
|
|
8
|
-
initializationScript(reg, dbSetup, extraSetup, useImport) {
|
|
9
|
-
let ret = "";
|
|
10
|
-
if (useImport === true) {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnitTest = void 0;
|
|
4
|
+
/* eslint-disable max-len */
|
|
5
|
+
const abaplint = require("@abaplint/core");
|
|
6
|
+
class UnitTest {
|
|
7
|
+
// todo, move this method somewhere else, its much more than just unit test relevant
|
|
8
|
+
initializationScript(reg, dbSetup, extraSetup, useImport) {
|
|
9
|
+
let ret = "";
|
|
10
|
+
if (useImport === true) {
|
|
11
11
|
ret = `/* eslint-disable import/newline-after-import */
|
|
12
|
-
import "./_top.mjs";\n`;
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
12
|
+
import "./_top.mjs";\n`;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
15
|
ret = `/* eslint-disable import/newline-after-import */
|
|
16
16
|
import runtime from "@abaplint/runtime";
|
|
17
|
-
globalThis.abap = new runtime.ABAP();\n`;
|
|
18
|
-
}
|
|
17
|
+
globalThis.abap = new runtime.ABAP();\n`;
|
|
18
|
+
}
|
|
19
19
|
ret += `${this.buildImports(reg, useImport)}
|
|
20
20
|
|
|
21
|
-
export async function initializeABAP() {\n`;
|
|
22
|
-
ret += ` const sqlite = [];\n`;
|
|
23
|
-
for (const i of dbSetup.schemas.sqlite) {
|
|
24
|
-
ret += `sqlite.push(\`${i}\`);\n`;
|
|
25
|
-
}
|
|
26
|
-
ret += ` const hdb = \`${dbSetup.schemas.hdb}\`;\n`;
|
|
27
|
-
ret += ` const pg = \`${dbSetup.schemas.pg}\`;\n`;
|
|
28
|
-
ret += ` const schemas = {sqlite, hdb, pg};\n`;
|
|
29
|
-
ret += ` const insert = [];\n`;
|
|
30
|
-
for (const i of dbSetup.insert) {
|
|
31
|
-
ret += ` insert.push(\`${i}\`);\n`;
|
|
32
|
-
}
|
|
33
|
-
if (extraSetup === undefined) {
|
|
34
|
-
ret += `// no setup logic specified in config\n`;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
ret += ` const {setup} = await import("${extraSetup}");\n` +
|
|
38
|
-
` await setup(globalThis.abap, schemas, insert);\n`;
|
|
39
|
-
}
|
|
40
|
-
ret += `}`;
|
|
41
|
-
return ret;
|
|
42
|
-
}
|
|
43
|
-
escapeNamespace(filename) {
|
|
44
|
-
// ES modules are resolved and cached as URLs. This means that special characters must be percent-encoded, such as # with %23 and ? with %3F.
|
|
45
|
-
return filename.replace(/\//g, "%23");
|
|
46
|
-
}
|
|
47
|
-
unitTestScriptOpen(reg, _skip, _only) {
|
|
21
|
+
export async function initializeABAP() {\n`;
|
|
22
|
+
ret += ` const sqlite = [];\n`;
|
|
23
|
+
for (const i of dbSetup.schemas.sqlite) {
|
|
24
|
+
ret += `sqlite.push(\`${i}\`);\n`;
|
|
25
|
+
}
|
|
26
|
+
ret += ` const hdb = \`${dbSetup.schemas.hdb}\`;\n`;
|
|
27
|
+
ret += ` const pg = \`${dbSetup.schemas.pg}\`;\n`;
|
|
28
|
+
ret += ` const schemas = {sqlite, hdb, pg};\n`;
|
|
29
|
+
ret += ` const insert = [];\n`;
|
|
30
|
+
for (const i of dbSetup.insert) {
|
|
31
|
+
ret += ` insert.push(\`${i}\`);\n`;
|
|
32
|
+
}
|
|
33
|
+
if (extraSetup === undefined) {
|
|
34
|
+
ret += `// no setup logic specified in config\n`;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
ret += ` const {setup} = await import("${extraSetup}");\n` +
|
|
38
|
+
` await setup(globalThis.abap, schemas, insert);\n`;
|
|
39
|
+
}
|
|
40
|
+
ret += `}`;
|
|
41
|
+
return ret;
|
|
42
|
+
}
|
|
43
|
+
escapeNamespace(filename) {
|
|
44
|
+
// ES modules are resolved and cached as URLs. This means that special characters must be percent-encoded, such as # with %23 and ? with %3F.
|
|
45
|
+
return filename.replace(/\//g, "%23");
|
|
46
|
+
}
|
|
47
|
+
unitTestScriptOpen(reg, _skip, _only) {
|
|
48
48
|
let ret = `/* eslint-disable curly */
|
|
49
49
|
import fs from "fs";
|
|
50
50
|
import path from "path";
|
|
@@ -58,33 +58,33 @@ async function run() {
|
|
|
58
58
|
let lt_input = new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30)}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]});
|
|
59
59
|
let ls_input = new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30)});
|
|
60
60
|
let ls_result = new abap.types.Structure({list: new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30), expected: new abap.types.String(), actual: new abap.types.String(), status: new abap.types.String(), runtime: new abap.types.Integer(), message: new abap.types.String(), js_location: new abap.types.String(), console: new abap.types.String()}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]}), json: new abap.types.String()});
|
|
61
|
-
`;
|
|
62
|
-
for (const obj of reg.getObjects()) {
|
|
63
|
-
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(".testclasses."); });
|
|
67
|
-
if (hasTestFile === true) {
|
|
68
|
-
ret += ` await import("./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs");\n`;
|
|
69
|
-
}
|
|
70
|
-
for (const file of obj.getABAPFiles()) {
|
|
71
|
-
for (const def of file.getInfo().listClassDefinitions()) {
|
|
72
|
-
if (def.isForTesting === false || def.isGlobal === true || def.methods.length === 0) {
|
|
73
|
-
// todo, fix, there might be global test methods
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
for (const m of def.methods) {
|
|
77
|
-
if (m.isForTesting === false) {
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
61
|
+
`;
|
|
62
|
+
for (const obj of reg.getObjects()) {
|
|
63
|
+
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(".testclasses."); });
|
|
67
|
+
if (hasTestFile === true) {
|
|
68
|
+
ret += ` await import("./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs");\n`;
|
|
69
|
+
}
|
|
70
|
+
for (const file of obj.getABAPFiles()) {
|
|
71
|
+
for (const def of file.getInfo().listClassDefinitions()) {
|
|
72
|
+
if (def.isForTesting === false || def.isGlobal === true || def.methods.length === 0) {
|
|
73
|
+
// todo, fix, there might be global test methods
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
for (const m of def.methods) {
|
|
77
|
+
if (m.isForTesting === false) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
80
|
ret += ` ls_input.get().class_name.set("${obj.getName()}");
|
|
81
81
|
ls_input.get().testclass_name.set("${def.name.toUpperCase()}");
|
|
82
82
|
ls_input.get().method_name.set("${m.name.toUpperCase()}");
|
|
83
|
-
abap.statements.append({source: ls_input, target: lt_input});\n`;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
83
|
+
abap.statements.append({source: ls_input, target: lt_input});\n`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
88
|
ret += `
|
|
89
89
|
|
|
90
90
|
ls_result.set(await abap.Classes["KERNEL_UNIT_RUNNER"].run({it_input: lt_input}));
|
|
@@ -96,10 +96,10 @@ run().then(() => {
|
|
|
96
96
|
}).catch((err) => {
|
|
97
97
|
console.log(err);
|
|
98
98
|
process.exit(1);
|
|
99
|
-
});`;
|
|
100
|
-
return ret;
|
|
101
|
-
}
|
|
102
|
-
unitTestScript(reg, skip, _only) {
|
|
99
|
+
});`;
|
|
100
|
+
return ret;
|
|
101
|
+
}
|
|
102
|
+
unitTestScript(reg, skip, _only) {
|
|
103
103
|
let ret = `/* eslint-disable curly */
|
|
104
104
|
import fs from "fs";
|
|
105
105
|
import path from "path";
|
|
@@ -115,55 +115,55 @@ async function run() {
|
|
|
115
115
|
let clas;
|
|
116
116
|
let locl;
|
|
117
117
|
let meth;
|
|
118
|
-
try {\n`;
|
|
119
|
-
for (const obj of reg.getObjects()) {
|
|
120
|
-
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
ret += `// --------------------------------------------\n`;
|
|
124
|
-
ret += ` clas = unit.addObject("${obj.getName()}");\n`;
|
|
125
|
-
for (const file of obj.getABAPFiles()) {
|
|
126
|
-
for (const def of file.getInfo().listClassDefinitions()) {
|
|
127
|
-
if (def.isForTesting === false
|
|
128
|
-
|| def.isGlobal === true
|
|
129
|
-
|| def.methods.length === 0
|
|
130
|
-
|| def.isAbstract === true) {
|
|
131
|
-
// todo, fix, there might be global test methods
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(".testclasses."); });
|
|
135
|
-
if (hasTestFile === false) {
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
118
|
+
try {\n`;
|
|
119
|
+
for (const obj of reg.getObjects()) {
|
|
120
|
+
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
ret += `// --------------------------------------------\n`;
|
|
124
|
+
ret += ` clas = unit.addObject("${obj.getName()}");\n`;
|
|
125
|
+
for (const file of obj.getABAPFiles()) {
|
|
126
|
+
for (const def of file.getInfo().listClassDefinitions()) {
|
|
127
|
+
if (def.isForTesting === false
|
|
128
|
+
|| def.isGlobal === true
|
|
129
|
+
|| def.methods.length === 0
|
|
130
|
+
|| def.isAbstract === true) {
|
|
131
|
+
// todo, fix, there might be global test methods
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(".testclasses."); });
|
|
135
|
+
if (hasTestFile === false) {
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
138
|
ret += ` {
|
|
139
139
|
const {${def.name}} = await import("./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs");
|
|
140
140
|
locl = clas.addTestClass("${def.name}");
|
|
141
|
-
if (${def.name}.class_setup) await ${def.name}.class_setup();\n`;
|
|
142
|
-
for (const m of def.methods) {
|
|
143
|
-
if (m.isForTesting === false) {
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
const skipThis = (skip || []).some(a => a.object === obj.getName() && a.class === def.name && a.method === m.name);
|
|
147
|
-
if (skipThis) {
|
|
148
|
-
ret += ` console.log('${obj.getName()}: running ${def.name}->${m.name}, skipped');\n`;
|
|
149
|
-
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
150
|
-
ret += ` meth.skip();\n`;
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
ret += ` {\n const test = await (new ${def.name}()).constructor_();\n`;
|
|
154
|
-
ret += ` if (test.setup) await test.setup();\n`;
|
|
155
|
-
ret += ` console.log("${obj.getName()}: running ${def.name}->${m.name}");\n`;
|
|
156
|
-
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
157
|
-
ret += ` await test.${m.name}();\n`;
|
|
158
|
-
ret += ` meth.pass();\n`;
|
|
159
|
-
ret += ` if (test.teardown) await test.teardown();\n`;
|
|
160
|
-
ret += ` }\n`;
|
|
161
|
-
}
|
|
162
|
-
ret += ` if (${def.name}.class_teardown) await ${def.name}.class_teardown();\n`;
|
|
163
|
-
ret += ` }\n`;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
141
|
+
if (${def.name}.class_setup) await ${def.name}.class_setup();\n`;
|
|
142
|
+
for (const m of def.methods) {
|
|
143
|
+
if (m.isForTesting === false) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const skipThis = (skip || []).some(a => a.object === obj.getName() && a.class === def.name && a.method === m.name);
|
|
147
|
+
if (skipThis) {
|
|
148
|
+
ret += ` console.log('${obj.getName()}: running ${def.name}->${m.name}, skipped');\n`;
|
|
149
|
+
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
150
|
+
ret += ` meth.skip();\n`;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
ret += ` {\n const test = await (new ${def.name}()).constructor_();\n`;
|
|
154
|
+
ret += ` if (test.setup) await test.setup();\n`;
|
|
155
|
+
ret += ` console.log("${obj.getName()}: running ${def.name}->${m.name}");\n`;
|
|
156
|
+
ret += ` meth = locl.addMethod("${m.name}");\n`;
|
|
157
|
+
ret += ` await test.${m.name}();\n`;
|
|
158
|
+
ret += ` meth.pass();\n`;
|
|
159
|
+
ret += ` if (test.teardown) await test.teardown();\n`;
|
|
160
|
+
ret += ` }\n`;
|
|
161
|
+
}
|
|
162
|
+
ret += ` if (${def.name}.class_teardown) await ${def.name}.class_teardown();\n`;
|
|
163
|
+
ret += ` }\n`;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
167
|
ret += `// -------------------END-------------------
|
|
168
168
|
console.log(abap.console.get());
|
|
169
169
|
fs.writeFileSync(__dirname + path.sep + "_output.xml", unit.xUnitXML());
|
|
@@ -182,71 +182,71 @@ run().then(() => {
|
|
|
182
182
|
}).catch((err) => {
|
|
183
183
|
console.log(err);
|
|
184
184
|
process.exit(1);
|
|
185
|
-
});`;
|
|
186
|
-
return ret;
|
|
187
|
-
}
|
|
188
|
-
buildImports(reg, useImport) {
|
|
189
|
-
// note: ES modules are hoised, so use the dynamic import(), due to setting of globalThis.abap
|
|
190
|
-
// some sorting required: eg. a class constructor using constant from interface
|
|
191
|
-
const list = [];
|
|
192
|
-
const late = [];
|
|
193
|
-
const imp = (filename) => {
|
|
194
|
-
if (useImport === true) {
|
|
195
|
-
return `import "./${filename}.mjs";`;
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
return `await import("./${filename}.mjs");`;
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
for (const obj of reg.getObjects()) {
|
|
202
|
-
if (obj instanceof abaplint.Objects.Table
|
|
203
|
-
|| obj instanceof abaplint.Objects.DataElement
|
|
204
|
-
|| obj instanceof abaplint.Objects.LockObject
|
|
205
|
-
|| obj instanceof abaplint.Objects.MIMEObject
|
|
206
|
-
|| obj instanceof abaplint.Objects.WebMIME
|
|
207
|
-
|| obj instanceof abaplint.Objects.TypePool
|
|
208
|
-
|| obj instanceof abaplint.Objects.TableType) {
|
|
209
|
-
list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
for (const obj of reg.getObjects()) {
|
|
213
|
-
if (obj instanceof abaplint.Objects.FunctionGroup) {
|
|
214
|
-
for (const m of obj.getModules()) {
|
|
215
|
-
list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.fugr.${this.escapeNamespace(m.getName().toLowerCase())}`));
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
else if (obj instanceof abaplint.Objects.Class) {
|
|
219
|
-
if (obj.getName().toUpperCase() !== "CL_ABAP_CHAR_UTILITIES"
|
|
220
|
-
&& this.hasClassConstructor(reg, obj)) {
|
|
221
|
-
// this will not solve all problems with class constors 100%, but probably good enough
|
|
222
|
-
late.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
else if (obj instanceof abaplint.Objects.Interface) {
|
|
229
|
-
list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return [...list.sort(), ...late].join("\n");
|
|
233
|
-
}
|
|
234
|
-
// class constructors might make early use of eg. constants from interfaces
|
|
235
|
-
// sub classes will import() super classes and trigger a class constructor of the super
|
|
236
|
-
hasClassConstructor(reg, clas) {
|
|
237
|
-
var _a, _b;
|
|
238
|
-
if (((_a = clas.getDefinition()) === null || _a === void 0 ? void 0 : _a.getMethodDefinitions().getByName("CLASS_CONSTRUCTOR")) !== undefined) {
|
|
239
|
-
return true;
|
|
240
|
-
}
|
|
241
|
-
const sup = (_b = clas.getDefinition()) === null || _b === void 0 ? void 0 : _b.getSuperClass();
|
|
242
|
-
if (sup !== undefined) {
|
|
243
|
-
const superClass = reg.getObject("CLAS", sup);
|
|
244
|
-
if (superClass) {
|
|
245
|
-
return this.hasClassConstructor(reg, superClass);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
exports.UnitTest = UnitTest;
|
|
185
|
+
});`;
|
|
186
|
+
return ret;
|
|
187
|
+
}
|
|
188
|
+
buildImports(reg, useImport) {
|
|
189
|
+
// note: ES modules are hoised, so use the dynamic import(), due to setting of globalThis.abap
|
|
190
|
+
// some sorting required: eg. a class constructor using constant from interface
|
|
191
|
+
const list = [];
|
|
192
|
+
const late = [];
|
|
193
|
+
const imp = (filename) => {
|
|
194
|
+
if (useImport === true) {
|
|
195
|
+
return `import "./${filename}.mjs";`;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return `await import("./${filename}.mjs");`;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
for (const obj of reg.getObjects()) {
|
|
202
|
+
if (obj instanceof abaplint.Objects.Table
|
|
203
|
+
|| obj instanceof abaplint.Objects.DataElement
|
|
204
|
+
|| obj instanceof abaplint.Objects.LockObject
|
|
205
|
+
|| obj instanceof abaplint.Objects.MIMEObject
|
|
206
|
+
|| obj instanceof abaplint.Objects.WebMIME
|
|
207
|
+
|| obj instanceof abaplint.Objects.TypePool
|
|
208
|
+
|| obj instanceof abaplint.Objects.TableType) {
|
|
209
|
+
list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
for (const obj of reg.getObjects()) {
|
|
213
|
+
if (obj instanceof abaplint.Objects.FunctionGroup) {
|
|
214
|
+
for (const m of obj.getModules()) {
|
|
215
|
+
list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.fugr.${this.escapeNamespace(m.getName().toLowerCase())}`));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
else if (obj instanceof abaplint.Objects.Class) {
|
|
219
|
+
if (obj.getName().toUpperCase() !== "CL_ABAP_CHAR_UTILITIES"
|
|
220
|
+
&& this.hasClassConstructor(reg, obj)) {
|
|
221
|
+
// this will not solve all problems with class constors 100%, but probably good enough
|
|
222
|
+
late.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
else if (obj instanceof abaplint.Objects.Interface) {
|
|
229
|
+
list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return [...list.sort(), ...late].join("\n");
|
|
233
|
+
}
|
|
234
|
+
// class constructors might make early use of eg. constants from interfaces
|
|
235
|
+
// sub classes will import() super classes and trigger a class constructor of the super
|
|
236
|
+
hasClassConstructor(reg, clas) {
|
|
237
|
+
var _a, _b;
|
|
238
|
+
if (((_a = clas.getDefinition()) === null || _a === void 0 ? void 0 : _a.getMethodDefinitions().getByName("CLASS_CONSTRUCTOR")) !== undefined) {
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
const sup = (_b = clas.getDefinition()) === null || _b === void 0 ? void 0 : _b.getSuperClass();
|
|
242
|
+
if (sup !== undefined) {
|
|
243
|
+
const superClass = reg.getObject("CLAS", sup);
|
|
244
|
+
if (superClass) {
|
|
245
|
+
return this.hasClassConstructor(reg, superClass);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
exports.UnitTest = UnitTest;
|
|
252
252
|
//# sourceMappingURL=unit_test.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Issue, IRegistry, IConfig } from "@abaplint/core";
|
|
2
|
-
import { ITranspilerOptions } from "./types";
|
|
3
|
-
export declare const config: IConfig;
|
|
4
|
-
export declare class Validation {
|
|
5
|
-
private readonly options;
|
|
6
|
-
constructor(options?: ITranspilerOptions);
|
|
7
|
-
run(reg: IRegistry): readonly Issue[];
|
|
8
|
-
}
|
|
1
|
+
import { Issue, IRegistry, IConfig } from "@abaplint/core";
|
|
2
|
+
import { ITranspilerOptions } from "./types";
|
|
3
|
+
export declare const config: IConfig;
|
|
4
|
+
export declare class Validation {
|
|
5
|
+
private readonly options;
|
|
6
|
+
constructor(options?: ITranspilerOptions);
|
|
7
|
+
run(reg: IRegistry): readonly Issue[];
|
|
8
|
+
}
|