├── .cargo └── config.toml ├── .config └── nextest.toml ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .dockerignore ├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── refactoring.md └── workflows │ ├── doc.yml │ ├── linux.yml │ ├── lit.yml │ ├── metrics.yml │ └── windows.yml ├── .gitignore ├── .gitpod.yml ├── .pre-commit-config.yaml ├── .vscode └── launch.json ├── COPYING ├── COPYING.LESSER ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── README.md ├── book ├── .gitignore ├── book.toml ├── custom.js ├── highlight.js ├── iecst.min.js ├── llvm.min.js └── src │ ├── SUMMARY.md │ ├── arch │ ├── architecture.md │ ├── codegen.md │ ├── indexer.md │ ├── linker.md │ ├── parser.md │ └── validation.md │ ├── build_and_install.md │ ├── cfc.md │ ├── cfc │ ├── cfc.md │ └── m2m.md │ ├── datatypes.md │ ├── direct_variables.md │ ├── intro_1.md │ ├── libraries.md │ ├── libraries │ ├── api_lib_guide.md │ └── external_functions.md │ ├── pous.md │ ├── using_rusty.md │ ├── using_rusty │ ├── build_configuration.md │ └── error_configuration.md │ └── variables.md ├── codecov.yml ├── compiler ├── plc_ast │ ├── Cargo.toml │ └── src │ │ ├── ast.rs │ │ ├── control_statements.rs │ │ ├── lib.rs │ │ ├── literals.rs │ │ ├── mut_visitor.rs │ │ ├── pre_processor.rs │ │ ├── provider.rs │ │ └── visitor.rs ├── plc_derive │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ └── tests │ │ └── rusty_derive_tests.rs ├── plc_diagnostics │ ├── Cargo.toml │ └── src │ │ ├── diagnostician.rs │ │ ├── diagnostics.rs │ │ ├── diagnostics │ │ ├── diagnostics_registry.rs │ │ └── error_codes │ │ │ ├── E001.md │ │ │ ├── E002.md │ │ │ ├── E003.md │ │ │ ├── E004.md │ │ │ ├── E005.md │ │ │ ├── E006.md │ │ │ ├── E007.md │ │ │ ├── E008.md │ │ │ ├── E009.md │ │ │ ├── E010.md │ │ │ ├── E011.md │ │ │ ├── E012.md │ │ │ ├── E013.md │ │ │ ├── E014.md │ │ │ ├── E015.md │ │ │ ├── E016.md │ │ │ ├── E017.md │ │ │ ├── E018.md │ │ │ ├── E019.md │ │ │ ├── E020.md │ │ │ ├── E021.md │ │ │ ├── E022.md │ │ │ ├── E023.md │ │ │ ├── E024.md │ │ │ ├── E025.md │ │ │ ├── E026.md │ │ │ ├── E027.md │ │ │ ├── E028.md │ │ │ ├── E029.md │ │ │ ├── E030.md │ │ │ ├── E031.md │ │ │ ├── E032.md │ │ │ ├── E033.md │ │ │ ├── E034.md │ │ │ ├── E035.md │ │ │ ├── E036.md │ │ │ ├── E037.md │ │ │ ├── E038.md │ │ │ ├── E039.md │ │ │ ├── E040.md │ │ │ ├── E041.md │ │ │ ├── E042.md │ │ │ ├── E043.md │ │ │ ├── E044.md │ │ │ ├── E045.md │ │ │ ├── E046.md │ │ │ ├── E047.md │ │ │ ├── E048.md │ │ │ ├── E049.md │ │ │ ├── E050.md │ │ │ ├── E051.md │ │ │ ├── E052.md │ │ │ ├── E053.md │ │ │ ├── E054.md │ │ │ ├── E055.md │ │ │ ├── E056.md │ │ │ ├── E057.md │ │ │ ├── E058.md │ │ │ ├── E059.md │ │ │ ├── E060.md │ │ │ ├── E061.md │ │ │ ├── E062.md │ │ │ ├── E063.md │ │ │ ├── E064.md │ │ │ ├── E065.md │ │ │ ├── E066.md │ │ │ ├── E067.md │ │ │ ├── E068.md │ │ │ ├── E069.md │ │ │ ├── E070.md │ │ │ ├── E071.md │ │ │ ├── E072.md │ │ │ ├── E073.md │ │ │ ├── E074.md │ │ │ ├── E075.md │ │ │ ├── E076.md │ │ │ ├── E077.md │ │ │ ├── E078.md │ │ │ ├── E079.md │ │ │ ├── E080.md │ │ │ ├── E081.md │ │ │ ├── E082.md │ │ │ ├── E083.md │ │ │ ├── E084.md │ │ │ ├── E085.md │ │ │ ├── E086.md │ │ │ ├── E087.md │ │ │ ├── E088.md │ │ │ ├── E089.md │ │ │ ├── E090.md │ │ │ ├── E091.md │ │ │ ├── E092.md │ │ │ ├── E093.md │ │ │ ├── E094.md │ │ │ ├── E095.md │ │ │ ├── E096.md │ │ │ ├── E097.md │ │ │ ├── E098.md │ │ │ ├── E099.md │ │ │ ├── E100.md │ │ │ ├── E101.md │ │ │ ├── E102.md │ │ │ ├── E103.md │ │ │ ├── E104.md │ │ │ ├── E105.md │ │ │ ├── E106.md │ │ │ ├── E107.md │ │ │ ├── E108.md │ │ │ ├── E109.md │ │ │ ├── E110.md │ │ │ ├── E111.md │ │ │ ├── E112.md │ │ │ ├── E113.md │ │ │ ├── E114.md │ │ │ ├── E115.md │ │ │ ├── E116.md │ │ │ ├── E117.md │ │ │ ├── E118.md │ │ │ ├── E119.md │ │ │ └── E120.md │ │ ├── lib.rs │ │ ├── reporter.rs │ │ └── reporter │ │ ├── clang.rs │ │ ├── codespan.rs │ │ └── null.rs ├── plc_driver │ ├── Cargo.toml │ ├── build.rs │ └── src │ │ ├── cli.rs │ │ ├── lib.rs │ │ ├── main.rs │ │ ├── pipelines.rs │ │ ├── pipelines │ │ ├── participant.rs │ │ └── property.rs │ │ ├── runner.rs │ │ ├── tests.rs │ │ └── tests │ │ ├── external_files.rs │ │ ├── multi_files.rs │ │ └── snapshots │ │ ├── plc_driver__tests__external_files__calling_external_file_function_without_including_file_results_in_error.snap │ │ ├── plc_driver__tests__external_files__external_file_function_call.snap │ │ ├── plc_driver__tests__external_files__external_file_global_var.snap │ │ ├── plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap │ │ ├── plc_driver__tests__multi_files__multiple_files_with_debug_info.snap │ │ └── plc_driver__tests__multi_files__multiple_source_files_generated.snap ├── plc_index │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── plc_lowering │ ├── Cargo.toml │ └── src │ │ ├── inheritance.rs │ │ ├── lib.rs │ │ ├── tests.rs │ │ └── tests │ │ ├── inheritance_tests.rs │ │ └── super_tests.rs ├── plc_project │ ├── Cargo.toml │ ├── schema │ │ └── plc-json.schema │ └── src │ │ ├── build_config.rs │ │ ├── lib.rs │ │ ├── object.rs │ │ ├── project.rs │ │ └── snapshots │ │ ├── plc_project__build_config__tests__json_with_additional_fields_reports_unexpected_fields.snap │ │ ├── plc_project__build_config__tests__json_with_empty_files_array_reports_error.snap │ │ ├── plc_project__build_config__tests__json_with_invalid_enum_variants_reports_error.snap │ │ ├── plc_project__build_config__tests__json_with_missing_required_properties_reports_error-2.snap │ │ ├── plc_project__build_config__tests__json_with_missing_required_properties_reports_error.snap │ │ └── plc_project__build_config__tests__json_with_optional_properties_is_valid.snap ├── plc_source │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── snapshots │ │ ├── plc_source__source_location__tests__span_combined.snap │ │ ├── plc_source__source_location__tests__span_id_and_range.snap │ │ ├── plc_source__source_location__tests__span_none.snap │ │ ├── plc_source__source_location__tests__span_two_blocks.snap │ │ ├── plc_source__source_location__tests__span_two_blocks_with_same_id.snap │ │ └── plc_source__source_location__tests__span_two_ranges.snap │ │ └── source_location.rs ├── plc_util │ ├── Cargo.toml │ └── src │ │ ├── convention.rs │ │ └── lib.rs ├── plc_xml │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── error.rs │ │ ├── extensions.rs │ │ ├── lib.rs │ │ ├── model │ │ ├── action.rs │ │ ├── block.rs │ │ ├── body.rs │ │ ├── connector.rs │ │ ├── control.rs │ │ ├── fbd.rs │ │ ├── interface.rs │ │ ├── pou.rs │ │ ├── project.rs │ │ ├── snapshots │ │ │ ├── plc_xml__model__action__tests__list_of_actions_parsed_to_model.snap │ │ │ ├── plc_xml__model__block__tests__add_block.snap │ │ │ ├── plc_xml__model__body__tests__empty.snap │ │ │ ├── plc_xml__model__body__tests__fbd_with_add_block.snap │ │ │ ├── plc_xml__model__fbd__tests__add_block.snap │ │ │ ├── plc_xml__model__fbd__tests__model_with_no_source_sink_unchanged.snap │ │ │ ├── plc_xml__model__fbd__tests__multiple_sink_are_ok_and_duplicate_sources_instances_are_reported.snap │ │ │ ├── plc_xml__model__fbd__tests__recursive_sink_source_connections_are_an_error-2.snap │ │ │ ├── plc_xml__model__fbd__tests__recursive_sink_source_connections_are_an_error.snap │ │ │ ├── plc_xml__model__fbd__tests__source_sink_chain_converted_to_connection.snap │ │ │ ├── plc_xml__model__fbd__tests__source_to_sink_converted_to_connection.snap │ │ │ ├── plc_xml__model__fbd__tests__two_sinks_for_single_source_converted_to_connections.snap │ │ │ ├── plc_xml__model__fbd__tests__unassociated_sink_removed_from_model_with_error-2.snap │ │ │ ├── plc_xml__model__fbd__tests__unassociated_sink_removed_from_model_with_error.snap │ │ │ ├── plc_xml__model__fbd__tests__unassociated_source_remains_in_model.snap │ │ │ ├── plc_xml__model__fbd__tests__unconnected_source_has_no_effect-2.snap │ │ │ ├── plc_xml__model__fbd__tests__unconnected_source_has_no_effect.snap │ │ │ ├── plc_xml__model__pou__tests__empty.snap │ │ │ ├── plc_xml__model__pou__tests__poutype_function.snap │ │ │ ├── plc_xml__model__pou__tests__poutype_function_block.snap │ │ │ ├── plc_xml__model__pou__tests__poutype_program.snap │ │ │ ├── plc_xml__model__variables__tests__block_inout_variable.snap │ │ │ ├── plc_xml__model__variables__tests__block_input_variable.snap │ │ │ ├── plc_xml__model__variables__tests__block_output_variable.snap │ │ │ ├── plc_xml__model__variables__tests__fbd_in_variable.snap │ │ │ └── plc_xml__model__variables__tests__fbd_out_variable.snap │ │ └── variables.rs │ │ ├── reader.rs │ │ ├── serializer.rs │ │ ├── xml_parser.rs │ │ └── xml_parser │ │ ├── action.rs │ │ ├── block.rs │ │ ├── control.rs │ │ ├── fbd.rs │ │ ├── pou.rs │ │ ├── snapshots │ │ ├── plc_xml__xml_parser__control__tests__jump_and_label_converted_to_ast.snap │ │ ├── plc_xml__xml_parser__control__tests__jump_to_label.snap │ │ ├── plc_xml__xml_parser__control__tests__label_parsed.snap │ │ ├── plc_xml__xml_parser__control__tests__negated_jump.snap │ │ ├── plc_xml__xml_parser__control__tests__negated_jump_ast.snap │ │ ├── plc_xml__xml_parser__control__tests__simple_negated_return.snap │ │ ├── plc_xml__xml_parser__control__tests__simple_return.snap │ │ ├── plc_xml__xml_parser__control__tests__unconnected_jump_generated_as_empty_statement-2.snap │ │ ├── plc_xml__xml_parser__control__tests__unconnected_jump_generated_as_empty_statement.snap │ │ ├── plc_xml__xml_parser__control__tests__unconnected_jump_to_label.snap │ │ ├── plc_xml__xml_parser__control__tests__unnamed_controls-2.snap │ │ ├── plc_xml__xml_parser__control__tests__unnamed_controls.snap │ │ ├── plc_xml__xml_parser__tests__actions_generated_correctly.snap │ │ ├── plc_xml__xml_parser__tests__ast_generates_locations-2.snap │ │ ├── plc_xml__xml_parser__tests__ast_generates_locations-3.snap │ │ ├── plc_xml__xml_parser__tests__ast_generates_locations-4.snap │ │ ├── plc_xml__xml_parser__tests__ast_generates_locations-5.snap │ │ ├── plc_xml__xml_parser__tests__ast_generates_locations-6.snap │ │ ├── plc_xml__xml_parser__tests__ast_generates_locations-7.snap │ │ ├── plc_xml__xml_parser__tests__ast_generates_locations.snap │ │ ├── plc_xml__xml_parser__tests__conditional_return.snap │ │ ├── plc_xml__xml_parser__tests__conditional_return_chained_to_another_conditional_return.snap │ │ ├── plc_xml__xml_parser__tests__conditional_return_negated.snap │ │ ├── plc_xml__xml_parser__tests__conditional_return_without_connection.snap │ │ ├── plc_xml__xml_parser__tests__connection_variable_source_to_multiple_sinks_parses.snap │ │ ├── plc_xml__xml_parser__tests__direct_connection_of_sink_to_other_source_ast_parses.snap │ │ ├── plc_xml__xml_parser__tests__direct_connection_of_sink_to_other_source_generates_correct_model.snap │ │ ├── plc_xml__xml_parser__tests__function_returns.snap │ │ ├── plc_xml__xml_parser__tests__model_is_sorted_by_execution_order.snap │ │ ├── plc_xml__xml_parser__tests__return_connected_to_sink_parses.snap │ │ ├── plc_xml__xml_parser__tests__sink_source_data_recursion_does_not_overflow_the_stack.snap │ │ ├── plc_xml__xml_parser__tests__unassociated_connections.snap │ │ ├── plc_xml__xml_parser__tests__unconnected_connections.snap │ │ └── plc_xml__xml_parser__tests__variable_assignment.snap │ │ ├── tests.rs │ │ └── variables.rs └── section_mangler │ ├── Cargo.toml │ └── src │ ├── lib.rs │ └── parser.rs ├── errorcode_book_generator ├── Cargo.toml └── src │ └── main.rs ├── examples ├── ExternalFunctions.st ├── actions.st ├── class_method.st ├── function_with_return.st ├── hello_world.st ├── lt.st ├── math_st.c ├── plc.json ├── pointer.st ├── program_with_expressions.st ├── program_with_references.st ├── program_with_variable_and_operation.st ├── program_with_variables.st ├── simple_program.st └── while_loop_with_continue.st ├── libs └── stdlib │ ├── .cargo │ └── config.toml │ ├── .gitignore │ ├── Cargo.toml │ ├── LICENSE │ ├── README.md │ ├── build.rs │ ├── iec61131-st │ ├── README.md │ ├── arithmetic_functions.st │ ├── bistable_functionblocks.st │ ├── bit_conversion.st │ ├── bit_num_conversion.st │ ├── bit_shift_functions.st │ ├── counters.st │ ├── date_time_conversion.st │ ├── date_time_extra_functions.st │ ├── date_time_numeric_functions.st │ ├── endianness_conversion_functions.st │ ├── extra_functions.st │ ├── flanks.st │ ├── num_conversion.st │ ├── numerical_functions.st │ ├── real_trunc_int.py │ ├── real_trunc_int.st │ ├── selectors.st │ ├── string_conversion.st │ ├── string_functions.st │ ├── timers.st │ ├── to_bit.st │ ├── to_date_time.st │ ├── to_num.py │ ├── to_num.st │ ├── to_string.st │ ├── trunc_int.py │ ├── trunc_int.st │ └── validation_functions.st │ ├── src │ ├── arithmetic_functions.rs │ ├── bistable_functionblocks.rs │ ├── bit_num_conversion.rs │ ├── bit_shift_functions.rs │ ├── counters.rs │ ├── date_time_conversion.rs │ ├── date_time_extra_functions.rs │ ├── date_time_numeric_functions.rs │ ├── endianness_conversion_functions.rs │ ├── extra_functions.rs │ ├── extra_functions │ │ └── test_time_helpers.rs │ ├── flanks.rs │ ├── lib.rs │ ├── numerical_functions.rs │ ├── string_conversion.rs │ ├── string_functions.rs │ ├── timers.rs │ ├── timers │ │ └── test_time_helpers.rs │ ├── types.rs │ ├── utils.rs │ └── validation_functions.rs │ ├── tests │ ├── arithmetic_functions_tests.rs │ ├── bistable_functionblocks_tests.rs │ ├── bit_conversion_tests.rs │ ├── bit_num_conversion_tests.rs │ ├── bit_shift_functions_tests.rs │ ├── common │ │ └── mod.rs │ ├── counters_tests.rs │ ├── date_time_conversion_tests.rs │ ├── date_time_extra_functions_tests.rs │ ├── date_time_numeric_functions_tests.rs │ ├── endianness_conversion_functions_tests.rs │ ├── expt.rs │ ├── extra_function_tests.rs │ ├── flank_tests.rs │ ├── num_conversion_tests.rs │ ├── numerical_functions_tests.rs │ ├── selectors.rs │ ├── string_conversion_tests.rs │ ├── string_function_tests.rs │ ├── timer_tests.rs │ └── validation_functions_tests.rs │ └── utils │ └── code_gen.py ├── rustfmt.toml ├── scripts ├── build.sh ├── cargo_watch.sh ├── common.sh ├── data │ └── offline.toml └── linker │ ├── aarch64.script │ └── x86_64.script ├── src ├── builtins.rs ├── codegen.rs ├── codegen │ ├── debug.rs │ ├── generators.rs │ ├── generators │ │ ├── data_type_generator.rs │ │ ├── expression_generator.rs │ │ ├── llvm.rs │ │ ├── pou_generator.rs │ │ ├── section_names.rs │ │ ├── statement_generator.rs │ │ └── variable_generator.rs │ ├── llvm_index.rs │ ├── llvm_typesystem.rs │ ├── tests.rs │ └── tests │ │ ├── address_tests.rs │ │ ├── code_gen_tests.rs │ │ ├── codegen_error_messages_tests.rs │ │ ├── compare_instructions_tests.rs │ │ ├── constants_tests.rs │ │ ├── debug_tests.rs │ │ ├── debug_tests │ │ ├── expression_debugging.rs │ │ └── snapshots │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__external_impl_is_not_added_as_external_subroutine.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__string_size_correctly_set_in_dwarf_info.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap │ │ │ ├── rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap │ │ │ └── rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap │ │ ├── directaccess_test.rs │ │ ├── expression_tests.rs │ │ ├── function_tests.rs │ │ ├── generics_test.rs │ │ ├── initialization_test.rs │ │ ├── initialization_test │ │ ├── complex_initializers.rs │ │ ├── global_initializers.rs │ │ ├── pou_initializers.rs │ │ ├── snapshots │ │ │ ├── rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap │ │ │ ├── rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap │ │ │ ├── rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_constant_variables.snap │ │ │ ├── rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables.snap │ │ │ ├── rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap │ │ │ ├── rusty__codegen__tests__initialization_test__global_initializers__uninitialized_global_array.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__enum_variants_have_precedence_over_global_variables_in_inline_assignment.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_with_initializers_is_initialized.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_without_initializers_is_initialized.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_array_of_array_variable.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_are_referenced_correctly.snap │ │ │ ├── rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_with_similar_names_are_referenced_correctly.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__alias_chain_with_lots_of_initializers.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__complex_initial_values_in_struct_variable_using_multiplied_statement.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__enums_with_inline_initializer_are_initialized.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__expression_list_as_array_initilization.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization_with_custom_init_value.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_nested_struct_delayed_init.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_array_variable_using_multiplied_statement.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_multi_dimension_array_variable.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_type.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_variable.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_types.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable_missing_init.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_sub_range_type.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_type_alias.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__partly_uninitialized_const_struct_will_get_default_values.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__struct_init_with_wrong_types_does_not_trigger_codegen_validation.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__struct_initial_values_different_data_types.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__struct_initialization_uses_types_default_if_not_provided.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__struct_initializer_needs_assignments.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__struct_initializer_uses_fallback_to_field_default.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__struct_with_one_field_can_be_initialized.snap │ │ │ ├── rusty__codegen__tests__initialization_test__type_initializers__type_defaults_are_used_for_uninitialized_constants.snap │ │ │ └── rusty__codegen__tests__initialization_test__type_initializers__unresolvable_types_validation.snap │ │ └── type_initializers.rs │ │ ├── multifile_codegen_tests.rs │ │ ├── online_change_tests.rs │ │ ├── oop_tests.rs │ │ ├── oop_tests │ │ ├── debug_tests.rs │ │ └── super_tests.rs │ │ ├── parameters_tests.rs │ │ ├── snapshots │ │ ├── rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap │ │ ├── rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap │ │ ├── rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap │ │ ├── rusty__codegen__tests__code_gen_tests__action_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap │ │ ├── rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap │ │ ├── rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap │ │ ├── rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap │ │ ├── rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap │ │ ├── rusty__codegen__tests__code_gen_tests__arrays_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__arrays_with_global_const_size_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__basic_datatypes_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__case_with_constant_expressions_in_case_selectors.snap │ │ ├── rusty__codegen__tests__code_gen_tests__case_with_enum_expressions_in_case_selectors.snap │ │ ├── rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap │ │ ├── rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap │ │ ├── rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap │ │ ├── rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap │ │ ├── rusty__codegen__tests__code_gen_tests__complex_pointers.snap │ │ ├── rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__constant_propagation_of_struct_fields_on_assignment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap │ │ ├── rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap │ │ ├── rusty__codegen__tests__code_gen_tests__date_and_time_global_constants_initialize.snap │ │ ├── rusty__codegen__tests__code_gen_tests__date_comparisons.snap │ │ ├── rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap │ │ ├── rusty__codegen__tests__code_gen_tests__different_case_references.snap │ │ ├── rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap │ │ ├── rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap │ │ ├── rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap │ │ ├── rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap │ │ ├── rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap │ │ ├── rusty__codegen__tests__code_gen_tests__enums_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__expression_list_as_array_initilization.snap │ │ ├── rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap │ │ ├── rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap │ │ ├── rusty__codegen__tests__code_gen_tests__fb_method_called_as_function.snap │ │ ├── rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap │ │ ├── rusty__codegen__tests__code_gen_tests__fb_method_with_var_in_out.snap │ │ ├── rusty__codegen__tests__code_gen_tests__fb_method_with_var_input_defaults.snap │ │ ├── rusty__codegen__tests__code_gen_tests__for_statement_continue.snap │ │ ├── rusty__codegen__tests__code_gen_tests__for_statement_int.snap │ │ ├── rusty__codegen__tests__code_gen_tests__for_statement_lint.snap │ │ ├── rusty__codegen__tests__code_gen_tests__for_statement_sint.snap │ │ ├── rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap │ │ ├── rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap │ │ ├── rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap │ │ ├── rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap │ │ ├── rusty__codegen__tests__code_gen_tests__function_call_with_same_name_as_return_type.snap │ │ ├── rusty__codegen__tests__code_gen_tests__function_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap │ │ ├── rusty__codegen__tests__code_gen_tests__function_with_local_temp_var_initialization.snap │ │ ├── rusty__codegen__tests__code_gen_tests__function_with_local_var_initialization_and_call.snap │ │ ├── rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__if_generator_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap │ │ ├── rusty__codegen__tests__code_gen_tests__inline_enums_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__inline_structs_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap │ │ ├── rusty__codegen__tests__code_gen_tests__method_codegen_return.snap │ │ ├── rusty__codegen__tests__code_gen_tests__method_codegen_void.snap │ │ ├── rusty__codegen__tests__code_gen_tests__method_codegen_with_initialized_input.snap │ │ ├── rusty__codegen__tests__code_gen_tests__method_codegen_with_multiple_input.snap │ │ ├── rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap │ │ ├── rusty__codegen__tests__code_gen_tests__methods_var_output.snap │ │ ├── rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap │ │ ├── rusty__codegen__tests__code_gen_tests__multidim_array_access.snap │ │ ├── rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap │ │ ├── rusty__codegen__tests__code_gen_tests__nested_array_access.snap │ │ ├── rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap │ │ ├── rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap │ │ ├── rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap │ │ ├── rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap │ │ ├── rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap │ │ ├── rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap │ │ ├── rusty__codegen__tests__code_gen_tests__pointers_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_chars.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap │ │ ├── rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap │ │ ├── rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap │ │ ├── rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap │ │ ├── rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap │ │ ├── rusty__codegen__tests__code_gen_tests__repeat_statement.snap │ │ ├── rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap │ │ ├── rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap │ │ ├── rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap │ │ ├── rusty__codegen__tests__code_gen_tests__simple_case_statement.snap │ │ ├── rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap │ │ ├── rusty__codegen__tests__code_gen_tests__structs_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap │ │ ├── rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap │ │ ├── rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap │ │ ├── rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap │ │ ├── rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap │ │ ├── rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap │ │ ├── rusty__codegen__tests__code_gen_tests__typed_enums_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap │ │ ├── rusty__codegen__tests__code_gen_tests__typed_enums_with_initializers_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__typed_enums_with_partly_initializers_are_generated.snap │ │ ├── rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap │ │ ├── rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap │ │ ├── rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap │ │ ├── rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap │ │ ├── rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap │ │ ├── rusty__codegen__tests__code_gen_tests__while_statement.snap │ │ ├── rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__assigning_empty_string_literal_to_char_results_in_error.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__assigning_empty_string_literal_to_wide_char_results_in_error.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__assigning_string_literal_to_int_variable_results_in_casting_error.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__assigning_to_rvalue.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__continue_not_in_loop.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__exit_not_in_loop.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__invalid_array_access_in_struct_should_be_reported_with_line_number.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__invalid_array_access_should_be_reported_with_line_number.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__pointer_binary_expression_adding_two_pointers.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__pointer_binary_expression_division.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__pointer_binary_expression_modulo.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__pointer_binary_expression_multiplication.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__recursive_initial_constant_values.snap │ │ ├── rusty__codegen__tests__codegen_error_messages_tests__unknown_reference_should_be_reported_with_line_number.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap │ │ ├── rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap │ │ ├── rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap │ │ ├── rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap │ │ ├── rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap │ │ ├── rusty__codegen__tests__debug_tests__dwarf_version_override.snap │ │ ├── rusty__codegen__tests__debug_tests__global_alias_type.snap │ │ ├── rusty__codegen__tests__debug_tests__global_var_array_added_to_debug_info.snap │ │ ├── rusty__codegen__tests__debug_tests__global_var_byteseq_added_to_debug_info.snap │ │ ├── rusty__codegen__tests__debug_tests__global_var_enum_added_to_debug_info.snap │ │ ├── rusty__codegen__tests__debug_tests__global_var_float_added_to_debug_info.snap │ │ ├── rusty__codegen__tests__debug_tests__global_var_int_added_to_debug_info.snap │ │ ├── rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap │ │ ├── rusty__codegen__tests__debug_tests__global_var_pointer_added_to_debug_info.snap │ │ ├── rusty__codegen__tests__debug_tests__global_var_string_added_to_debug_info.snap │ │ ├── rusty__codegen__tests__debug_tests__global_var_struct_added_to_debug_info.snap │ │ ├── rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap │ │ ├── rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap │ │ ├── rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap │ │ ├── rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap │ │ ├── rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap │ │ ├── rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap │ │ ├── rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap │ │ ├── rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap │ │ ├── rusty__codegen__tests__expression_tests__allowed_assignable_types.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_add_float.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_add_ints.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_add_mixed.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_div_float.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_div_ints.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_div_mixed.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_adr.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_lower_bound.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_move.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_ref.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_sel.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_sizeof.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_mul_float.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_mul_ints.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_sub_float.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_sub_ints.snap │ │ ├── rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap │ │ ├── rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap │ │ ├── rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap │ │ ├── rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap │ │ ├── rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap │ │ ├── rusty__codegen__tests__expression_tests__compare_date_time_literals.snap │ │ ├── rusty__codegen__tests__expression_tests__max_int.snap │ │ ├── rusty__codegen__tests__expression_tests__nested_call_statements.snap │ │ ├── rusty__codegen__tests__expression_tests__pointer_arithmetics.snap │ │ ├── rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap │ │ ├── rusty__codegen__tests__expression_tests__pointers_in_function_return.snap │ │ ├── rusty__codegen__tests__expression_tests__strings_in_function_return.snap │ │ ├── rusty__codegen__tests__expression_tests__structs_in_function_return.snap │ │ ├── rusty__codegen__tests__expression_tests__type_mix_in_call.snap │ │ ├── rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap │ │ ├── rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap │ │ ├── rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap │ │ ├── rusty__codegen__tests__function_tests__autocast_argument_literals_for_function_call.snap │ │ ├── rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap │ │ ├── rusty__codegen__tests__function_tests__function_call_with_array_access.snap │ │ ├── rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap │ │ ├── rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap │ │ ├── rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap │ │ ├── rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap │ │ ├── rusty__codegen__tests__function_tests__member_variables_in_body.snap │ │ ├── rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap │ │ ├── rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap │ │ ├── rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap │ │ ├── rusty__codegen__tests__function_tests__passing_arguments_to_functions_by_ref_and_val.snap │ │ ├── rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap │ │ ├── rusty__codegen__tests__function_tests__simple_call.snap │ │ ├── rusty__codegen__tests__function_tests__var_output_in_function_call.snap │ │ ├── rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap │ │ ├── rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap │ │ ├── rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap │ │ ├── rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap │ │ ├── rusty__codegen__tests__generics_test__generic_function_has_no_declaration.snap │ │ ├── rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap │ │ ├── rusty__codegen__tests__generics_test__generic_output_parameter.snap │ │ ├── rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap │ │ ├── rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap │ │ ├── rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap │ │ ├── rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap │ │ ├── rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap │ │ ├── rusty__codegen__tests__multifile_codegen_tests__global_value_from_different_file.snap │ │ ├── rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap │ │ ├── rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap │ │ ├── rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_input_param.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap │ │ ├── rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap │ │ ├── rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap │ │ ├── rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap │ │ ├── rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap │ │ ├── rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap │ │ ├── rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap │ │ ├── rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap │ │ ├── rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap │ │ ├── rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap │ │ ├── rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap │ │ ├── rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap │ │ ├── rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap │ │ ├── rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap │ │ ├── rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap │ │ ├── rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap │ │ ├── rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap │ │ ├── rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap │ │ ├── rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap │ │ ├── rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap │ │ ├── rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap │ │ ├── rusty__codegen__tests__string_tests__generate_with_invalid_casted_string_assignment.snap │ │ ├── rusty__codegen__tests__string_tests__nested_struct_initialization_of_multi_dim_string_arrays.snap │ │ ├── rusty__codegen__tests__string_tests__program_string_output.snap │ │ ├── rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap │ │ ├── rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap │ │ ├── rusty__codegen__tests__string_tests__simple_string_test.snap │ │ ├── rusty__codegen__tests__string_tests__string_function_parameters.snap │ │ ├── rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap │ │ ├── rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap │ │ ├── rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap │ │ ├── rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap │ │ ├── rusty__codegen__tests__string_tests__variable_string_assignment_test.snap │ │ ├── rusty__codegen__tests__string_tests__vartmp_string_init_test.snap │ │ ├── rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap │ │ ├── rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap │ │ ├── rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap │ │ ├── rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap │ │ ├── rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap │ │ ├── rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap │ │ ├── rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap │ │ ├── rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap │ │ ├── rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap │ │ ├── rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap │ │ ├── rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap │ │ ├── rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap │ │ ├── rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap │ │ ├── rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap │ │ ├── rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap │ │ ├── rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap │ │ ├── rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap │ │ ├── rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap │ │ └── rusty__codegen__tests__vla_tests__vla_read_access.snap │ │ ├── statement_codegen_test.rs │ │ ├── string_tests.rs │ │ ├── switch_case_tests.rs │ │ ├── typesystem_test.rs │ │ └── vla_tests.rs ├── datalayout.rs ├── expression_path.rs ├── hardware_binding.rs ├── index.rs ├── index │ ├── const_expressions.rs │ ├── indexer.rs │ ├── indexer │ │ ├── global_var_indexer.rs │ │ ├── implementation_indexer.rs │ │ ├── pou_indexer.rs │ │ └── user_type_indexer.rs │ ├── instance_iterator.rs │ ├── symbol.rs │ ├── tests.rs │ └── tests │ │ ├── builtin_tests.rs │ │ ├── generic_tests.rs │ │ ├── index_tests.rs │ │ ├── instance_resolver_tests.rs │ │ ├── interface_tests.rs │ │ └── snapshots │ │ ├── rusty__index__tests__index_tests__fb_parameters_variable_type.snap │ │ ├── rusty__index__tests__index_tests__function_parameters_variable_type.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_array_of_array_type-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_array_of_array_type.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_array_of_array-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_array_of_array-3.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_array_of_array.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_array_of_array_of_array-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_array_of_array_of_array-3.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_array_of_array_of_array-4.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_array_of_array_of_array.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_arrays-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_arrays.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_enums-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_enums.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_enums_global-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_enums_global.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-3.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_pointers-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_structs-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_structs.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_structs_global-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_inline_structs_global.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_nested_array_in_struct-2.snap │ │ ├── rusty__index__tests__index_tests__pre_processing_nested_array_in_struct.snap │ │ ├── rusty__index__tests__index_tests__program_parameters_variable_type.snap │ │ ├── rusty__index__tests__instance_resolver_tests__array_instances_are_repeated.snap │ │ ├── rusty__index__tests__instance_resolver_tests__array_with_const_instances_are_repeated.snap │ │ ├── rusty__index__tests__instance_resolver_tests__filter_on_variables_are_applied.snap │ │ ├── rusty__index__tests__instance_resolver_tests__functions_are_not_retrieved.snap │ │ ├── rusty__index__tests__instance_resolver_tests__functions_blocks_are_not_retrieved.snap │ │ ├── rusty__index__tests__instance_resolver_tests__global_fb_variables_are_retrieved.snap │ │ ├── rusty__index__tests__instance_resolver_tests__global_struct_variables_are_retrieved.snap │ │ ├── rusty__index__tests__instance_resolver_tests__global_vars_are_retrieved.snap │ │ ├── rusty__index__tests__instance_resolver_tests__nested_global_struct_variables_are_retrieved.snap │ │ ├── rusty__index__tests__instance_resolver_tests__pointer_variables_are_not_retrieved.snap │ │ ├── rusty__index__tests__instance_resolver_tests__program_variables_are_retrieved.snap │ │ └── rusty__index__tests__instance_resolver_tests__programs_are_retrieved.snap ├── lexer.rs ├── lexer │ ├── tests.rs │ ├── tests │ │ └── lexer_tests.rs │ └── tokens.rs ├── lib.rs ├── linker.rs ├── lowering.rs ├── lowering │ ├── calls.rs │ ├── initializers.rs │ ├── property.rs │ └── snapshots │ │ ├── rusty__lowering__calls__tests__call_statemements_in_global.snap │ │ ├── rusty__lowering__calls__tests__call_statements_in_initializers_not_changed.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_assignment.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_assignment_method.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_assignment_twice.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_body.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_call.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_call_with_implicit_literal_parameter.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_call_with_implicit_parameter.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_elif_condition.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_else_block.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_if_statement_body.snap │ │ ├── rusty__lowering__calls__tests__complex_call_statement_in_if_statement_condition.snap │ │ ├── rusty__lowering__calls__tests__do_not_change_builtin_call.snap │ │ ├── rusty__lowering__calls__tests__function_wirh_array_of_string_return-2.snap │ │ ├── rusty__lowering__calls__tests__function_wirh_array_of_string_return-3.snap │ │ ├── rusty__lowering__calls__tests__function_wirh_array_of_string_return.snap │ │ ├── rusty__lowering__calls__tests__function_with_explicit_call_statement_has_explicit_return-2.snap │ │ ├── rusty__lowering__calls__tests__function_with_explicit_call_statement_has_explicit_return.snap │ │ ├── rusty__lowering__calls__tests__function_with_simple_return_not_changed.snap │ │ ├── rusty__lowering__calls__tests__function_with_string_return_is_changed-2.snap │ │ ├── rusty__lowering__calls__tests__function_with_string_return_is_changed.snap │ │ ├── rusty__lowering__calls__tests__generic_call_statement-2.snap │ │ ├── rusty__lowering__calls__tests__generic_call_statement.snap │ │ ├── rusty__lowering__calls__tests__generic_call_statement_with_aggregate_return-2.snap │ │ ├── rusty__lowering__calls__tests__generic_call_statement_with_aggregate_return.snap │ │ ├── rusty__lowering__calls__tests__method_with_string_return_is_changed-2.snap │ │ ├── rusty__lowering__calls__tests__method_with_string_return_is_changed.snap │ │ └── rusty__lowering__calls__tests__nested_complex_calls_in_if_condition.snap ├── output.rs ├── parser.rs ├── parser │ ├── control_parser.rs │ ├── expressions_parser.rs │ ├── tests.rs │ └── tests │ │ ├── ast_visitor_tests.rs │ │ ├── class_parser_tests.rs │ │ ├── container_parser_tests.rs │ │ ├── control_parser_tests.rs │ │ ├── expressions_parser_tests.rs │ │ ├── function_parser_tests.rs │ │ ├── initializer_parser_tests.rs │ │ ├── interface_parser_tests.rs │ │ ├── misc_parser_tests.rs │ │ ├── parse_errors.rs │ │ ├── parse_errors │ │ ├── parse_error_classes_tests.rs │ │ ├── parse_error_containers_tests.rs │ │ ├── parse_error_literals_tests.rs │ │ ├── parse_error_messages_test.rs │ │ ├── parse_error_statements_tests.rs │ │ └── snapshots │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_classes_tests__method_with_invalid_return_type.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_classes_tests__simple_class_without_name.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__a_program_needs_to_end_with_end_program.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__a_variable_declaration_block_needs_to_end_with_endvar.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__function_return_type_with_initializer-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__function_return_type_with_initializer.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__function_with_illegal_return_variable_declaration-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__function_with_illegal_return_variable_declaration.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__illegal_end_pou_keyword-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__illegal_end_pou_keyword.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__missing_pou_name-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__missing_pou_name.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__missing_pou_name_2-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__missing_pou_name_2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__unclosed_var_container-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__unclosed_var_container.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_containers_tests__unexpected_type_declaration_error_message.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__illegal_literal_time_double_segments_test.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__illegal_literal_time_missing_segments_test.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__illegal_literal_time_out_of_order_segments_test.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__literal_bin_number_with_double_underscores.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__literal_dec_number_with_double_underscores.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__literal_hex_number_with_double_underscores.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__literal_oct_number_with_double_underscores.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__string_with_round_parens_can_be_parsed-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__string_with_round_parens_can_be_parsed.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_literals_tests__time_literal_problems_can_be_recovered_from_during_parsing.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_messages_test__case_with_unexpected_token.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_messages_test__for_with_unexpected_token_1.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_messages_test__for_with_unexpected_token_2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_messages_test__if_then_with_unexpected_token.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_messages_test__unclosed_body_error_message.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_messages_test__unexpected_token_error_message.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_messages_test__unexpected_token_error_message2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__bitwise_access_error_validation.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__case_body_with_missing_semicolon.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__case_without_condition.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__for_with_missing_semicolon_in_body.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__if_with_missing_semicolon_in_body.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__illegal_semicolon_in_call_parameters.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__incomplete_statement_in_parantheses_recovery_test-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__incomplete_statement_in_parantheses_recovery_test.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__incomplete_statement_test.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__invalid_variable_data_type_error_recovery.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__invalid_variable_name_error_recovery.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__mismatched_parantheses_recovery_test-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__mismatched_parantheses_recovery_test.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__missing_comma_in_call_parameters.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__missing_semicolon_after_call-2.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__missing_semicolon_after_call.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__nested_for_with_missing_end_for.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__nested_if_with_missing_end_if.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__nested_repeat_with_missing_condition_and_end_repeat.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__nested_repeat_with_missing_end_repeat.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__nested_repeat_with_missing_until_end_repeat.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__nested_while_with_missing_end_while.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__pointer_type_with_wrong_keyword_to_test.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__pointer_type_without_to_test.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__repeat_with_missing_semicolon_in_body.snap │ │ │ ├── rusty__parser__tests__parse_errors__parse_error_statements_tests__while_with_missing_do.snap │ │ │ └── rusty__parser__tests__parse_errors__parse_error_statements_tests__while_with_missing_semicolon_in_body.snap │ │ ├── parse_generics.rs │ │ ├── program_parser_tests.rs │ │ ├── property_parser_tests.rs │ │ ├── snapshots │ │ ├── rusty__parser__tests__container_parser_tests__actions_with_invalid_token.snap │ │ ├── rusty__parser__tests__control_parser_tests__case_statement_with_else_and_no_condition.snap │ │ ├── rusty__parser__tests__control_parser_tests__case_statement_with_multiple_conditions.snap │ │ ├── rusty__parser__tests__control_parser_tests__case_statement_with_multiple_expressions_per_condition.snap │ │ ├── rusty__parser__tests__control_parser_tests__case_statement_with_no_conditions.snap │ │ ├── rusty__parser__tests__control_parser_tests__case_statement_with_one_condition.snap │ │ ├── rusty__parser__tests__control_parser_tests__case_statement_with_one_condition_and_an_else.snap │ │ ├── rusty__parser__tests__control_parser_tests__case_statement_with_one_condition_with_trailling_comma.snap │ │ ├── rusty__parser__tests__control_parser_tests__case_statement_with_one_empty_condition_and_an_else.snap │ │ ├── rusty__parser__tests__control_parser_tests__for_with_body_statement.snap │ │ ├── rusty__parser__tests__control_parser_tests__for_with_literals_statement.snap │ │ ├── rusty__parser__tests__control_parser_tests__for_with_reference_statement.snap │ │ ├── rusty__parser__tests__control_parser_tests__for_with_step_statement.snap │ │ ├── rusty__parser__tests__control_parser_tests__if_else_statement_with_expressions.snap │ │ ├── rusty__parser__tests__control_parser_tests__if_elsif_elsif_else_statement_with_expressions.snap │ │ ├── rusty__parser__tests__control_parser_tests__repeat_with_body_statement.snap │ │ ├── rusty__parser__tests__control_parser_tests__repeat_with_expression.snap │ │ ├── rusty__parser__tests__control_parser_tests__while_with_body_statement.snap │ │ ├── rusty__parser__tests__control_parser_tests__while_with_expression.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__addition_ast_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__addition_compare_or_priority_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__additon_of_three_variables_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__amp_as_and_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__and_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__arrays_can_be_parsed-2.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__arrays_in_structs_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__arrays_of_structs_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__assignment_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__assignment_to_null.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__assignment_to_number_reference_with_explicit_plus_sign.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__assignment_to_number_with_implicit_and_explicit_plus_sign.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__binary_stmts_of_two_variables_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__bitwise_access_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__boolean_expression_ast_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__boolean_expression_param_ast_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__boolean_literals_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__boolean_priority_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__comparison_expression_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__comparison_priority_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__direct_access_as_expression_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__equality_expression_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__exp_mul_priority_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__exponent_expressions_parse.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__expression_list.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__expression_list_assignments.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__function_call_array_index.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__function_call_formal_params.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__function_call_no_params.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__function_call_params.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__function_call_params_with_trailling_comma.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__function_call_return_params.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__global_namespace_operator.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__literal_binary_with_underscore_number_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__literal_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__literal_dec_number_with_underscores_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__literal_enum_parse_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__literal_hex_number_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__literal_hex_number_with_underscores_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__literal_oct_number_with_underscore_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__literal_oct_number_with_underscores_can_be_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__module_expression_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__multidim_arrays_can_be_parsed-2.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__multiplication_ast_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__multiplication_expressions_parse.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__nested_arrays_can_be_parsed-2.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__or_compare_expressions_priority_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__parenthesis_expressions_should_change_the_ast.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__parenthesized_term_ast_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__pointer_dereference_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__pointer_dereference_test_nested.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__qualified_reference_statement_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__range_expression.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__signed_literal_expression_reversed_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__signed_literal_expression_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__signed_literal_minus_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__single_statement_parsed.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__string_can_be_parsed-2.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__term_ast_test.snap │ │ ├── rusty__parser__tests__expressions_parser_tests__wide_string_can_be_parsed-2.snap │ │ ├── rusty__parser__tests__function_parser_tests__function_inline_enum_return_unsupported.snap │ │ ├── rusty__parser__tests__function_parser_tests__function_inline_struct_return_unsupported.snap │ │ ├── rusty__parser__tests__function_parser_tests__simple_foo_function_can_be_parsed.snap │ │ ├── rusty__parser__tests__initializer_parser_tests__parenthesized_expression_within_array.snap │ │ ├── rusty__parser__tests__initializer_parser_tests__struct_initializer_can_be_parsed.snap │ │ ├── rusty__parser__tests__misc_parser_tests__exponent_literals_parsed_as_variables-2.snap │ │ ├── rusty__parser__tests__misc_parser_tests__exponent_literals_parsed_as_variables.snap │ │ ├── rusty__parser__tests__parse_generics__generic_method_parameters_are_datatypes.snap │ │ ├── rusty__parser__tests__parse_generics__generic_parameters_are_datatypes.snap │ │ ├── rusty__parser__tests__statement_parser_tests__empty_parameter_assignments_in_call_statement.snap │ │ ├── rusty__parser__tests__statement_parser_tests__multilevel_inline_struct_and_enum_declaration_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__array_type_can_be_parsed_test.snap │ │ ├── rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap │ │ ├── rusty__parser__tests__type_parser_tests__global_pointer_declaration-3.snap │ │ ├── rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap │ │ ├── rusty__parser__tests__type_parser_tests__multi_dimensional_variable_length_arrays_can_be_parsed-2.snap │ │ ├── rusty__parser__tests__type_parser_tests__multi_dimensional_variable_length_arrays_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__multi_type_declaration.snap │ │ ├── rusty__parser__tests__type_parser_tests__pointer_type_test.snap │ │ ├── rusty__parser__tests__type_parser_tests__ref_type_test.snap │ │ ├── rusty__parser__tests__type_parser_tests__simple_enum_type_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__simple_enum_with_numeric_type_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__simple_enum_with_one_element_numeric_type_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__string_type_can_be_parsed_test.snap │ │ ├── rusty__parser__tests__type_parser_tests__struct_with_inline_array_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__subrangetype_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__typed_enum_with_initial_values_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__typed_inline_enum_with_initial_values_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__variable_length_array_can_be_parsed.snap │ │ ├── rusty__parser__tests__type_parser_tests__wide_string_type_can_be_parsed_test.snap │ │ ├── rusty__parser__tests__variable_parser_tests__date_and_time_constants_test.snap │ │ ├── rusty__parser__tests__variable_parser_tests__global_var_with_address.snap │ │ ├── rusty__parser__tests__variable_parser_tests__pou_var_with_address.snap │ │ └── rusty__parser__tests__variable_parser_tests__struct_with_address.snap │ │ ├── statement_parser_tests.rs │ │ ├── type_parser_tests.rs │ │ └── variable_parser_tests.rs ├── resolver.rs ├── resolver │ ├── const_evaluator.rs │ ├── generics.rs │ ├── tests.rs │ └── tests │ │ ├── const_resolver_tests.rs │ │ ├── lowering.rs │ │ ├── resolve_and_lower_init_functions.rs │ │ ├── resolve_config_variables.rs │ │ ├── resolve_control_statments.rs │ │ ├── resolve_declarations.rs │ │ ├── resolve_expressions_tests.rs │ │ ├── resolve_generic_calls.rs │ │ ├── resolve_literals_tests.rs │ │ ├── resolver_dependency_resolution.rs │ │ └── snapshots │ │ ├── rusty__resolver__tests__const_resolver_tests__const_enum_variable_default_value_compile_time_evaluation.snap │ │ ├── rusty__resolver__tests__const_resolver_tests__const_variables_default_value_compile_time_evaluation.snap │ │ ├── rusty__resolver__tests__const_resolver_tests__default_values_are_transitive_for_range_types.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__builtin_add_replacement_ast.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__builtin_eq_replacement_ast.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__builtin_ge_replacement_ast.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__builtin_gt_replacement_ast.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__builtin_le_replacement_ast.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__builtin_lt_replacement_ast.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__builtin_ne_replacement_ast.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__comparison_resolves_to_function_call-2.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__comparison_resolves_to_function_call-3.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__comparison_resolves_to_function_call-4.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__comparison_resolves_to_function_call-5.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__comparison_resolves_to_function_call.snap │ │ ├── rusty__resolver__tests__resolve_expressions_tests__string_compare_should_resolve_to_bool.snap │ │ ├── rusty__resolver__tests__resolve_generic_calls__generic_function_sharing_a_datatype_name_resolves.snap │ │ └── rusty__resolver__tests__resolve_generic_calls__generic_function_with_aggregate_return.snap ├── snapshots │ ├── rusty__hardware_binding__tests__hardware_collected_fb.snap │ ├── rusty__hardware_binding__tests__hardware_collected_gv.snap │ ├── rusty__hardware_binding__tests__hardware_collected_program.snap │ ├── rusty__hardware_binding__tests__hardware_printed_fb-2.snap │ ├── rusty__hardware_binding__tests__hardware_printed_fb.snap │ ├── rusty__hardware_binding__tests__hardware_printed_fb_no_arrays-2.snap │ └── rusty__hardware_binding__tests__hardware_printed_fb_no_arrays.snap ├── test_utils.rs ├── tests │ ├── adr.rs │ └── adr │ │ ├── annotated_ast_adr.rs │ │ ├── arrays_adr.rs │ │ ├── enum_adr.rs │ │ ├── initializer_functions_adr.rs │ │ ├── pou_adr.rs │ │ ├── reference_expressions_adr.rs │ │ ├── strings_adr.rs │ │ ├── structs_adr.rs │ │ ├── util_macros.rs │ │ └── vla_adr.rs ├── typesystem.rs ├── typesystem │ └── tests.rs ├── validation.rs └── validation │ ├── array.rs │ ├── global.rs │ ├── pou.rs │ ├── property.rs │ ├── recursive.rs │ ├── snapshots │ ├── rusty__validation__variable__variable_validator_tests__validate_empty_enum_declaration.snap │ └── rusty__validation__variable__variable_validator_tests__validate_empty_struct_declaration.snap │ ├── statement.rs │ ├── tests.rs │ ├── tests │ ├── array_validation_test.rs │ ├── assignment_validation_tests.rs │ ├── bitaccess_validation_test.rs │ ├── builtin_validation_tests.rs │ ├── duplicates_validation_test.rs │ ├── enum_validation_test.rs │ ├── generic_validation_tests.rs │ ├── interface_validation_tests.rs │ ├── literals_validation_tests.rs │ ├── naming_validation_test.rs │ ├── pou_validation_tests.rs │ ├── property_validation_tests.rs │ ├── recursive_validation_tests.rs │ ├── reference_resolve_tests.rs │ ├── snapshots │ │ ├── rusty__validation__tests__array_validation_test__array_access_dimension_mismatch.snap │ │ ├── rusty__validation__tests__array_validation_test__array_access_validation.snap │ │ ├── rusty__validation__tests__array_validation_test__array_assignment_function_call.snap │ │ ├── rusty__validation__tests__array_validation_test__array_initialization_validation.snap │ │ ├── rusty__validation__tests__array_validation_test__assignment_1d.snap │ │ ├── rusty__validation__tests__array_validation_test__assignment_2d.snap │ │ ├── rusty__validation__tests__array_validation_test__assignment_3d.snap │ │ ├── rusty__validation__tests__array_validation_test__assignment_multiplied_statement.snap │ │ ├── rusty__validation__tests__array_validation_test__assignment_structs.snap │ │ ├── rusty__validation__tests__array_validation_test__parenthesized_struct_initializers.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__action_call_parameters_are_only_validated_outside_of_parent_pou_contexts.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__array_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__assigning_literal_with_incompatible_encoding_to_char_is_validated.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__assigning_to_input_by_ref_should_deliver_improvment_suggestion.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__bit_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__builtins_report_downcasts_depending_on_parameters.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__call_results_are_validated_for_downcasts.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__char_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__constant_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__date_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__downcast_will_report_bigger_types_in_expression.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__duration_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__implicit_action_downcasts_are_validated.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__implicit_invalid_action_call_assignments_are_validated.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__int_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__invalid_action_call_assignments_are_validated.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__invalid_function_block_instantiation_is_validated.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__invalid_method_call_assignments_are_validated.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__literals_out_of_range_for_lhs_will_result_in_downcast_warning.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__modulo_operation_validates_if_the_left_hand_type_fits_into_the_target_type.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__pointer_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__real_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__string_assignment_validation.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__string_type_alias_assignment_can_be_validated.snap │ │ ├── rusty__validation__tests__assignment_validation_tests__struct_assignment_validation.snap │ │ ├── rusty__validation__tests__bitaccess_validation_test__bitaccess_only_on_bit_types.snap │ │ ├── rusty__validation__tests__bitaccess_validation_test__bitaccess_range_test.snap │ │ ├── rusty__validation__tests__bitaccess_validation_test__byteaccess_only_on_bigger_sizes.snap │ │ ├── rusty__validation__tests__bitaccess_validation_test__byteaccess_range_test.snap │ │ ├── rusty__validation__tests__bitaccess_validation_test__dwordaccess_only_on_bigger_sizes.snap │ │ ├── rusty__validation__tests__bitaccess_validation_test__dwordaccess_range_test.snap │ │ ├── rusty__validation__tests__bitaccess_validation_test__reference_direct_access_only_with_ints.snap │ │ ├── rusty__validation__tests__bitaccess_validation_test__wordaccess_only_on_bigger_sizes.snap │ │ ├── rusty__validation__tests__bitaccess_validation_test__wordaccess_range_test.snap │ │ ├── rusty__validation__tests__builtin_validation_tests__arithmetic_builtins_allow_mixing_of_fp_and_int_params.snap │ │ ├── rusty__validation__tests__builtin_validation_tests__arithmetic_builtins_called_with_invalid_param_count.snap │ │ ├── rusty__validation__tests__builtin_validation_tests__comparison_builtins_called_with_invalid_param_count.snap │ │ ├── rusty__validation__tests__duplicates_validation_test__duplicate_action_should_be_a_problem.snap │ │ ├── rusty__validation__tests__duplicates_validation_test__duplicate_enum_variables.snap │ │ ├── rusty__validation__tests__duplicates_validation_test__duplicate_fb_inst_and_function.snap │ │ ├── rusty__validation__tests__duplicates_validation_test__duplicate_global_and_program.snap │ │ ├── rusty__validation__tests__duplicates_validation_test__duplicate_global_variables.snap │ │ ├── rusty__validation__tests__duplicates_validation_test__duplicate_pous_and_types_validation.snap │ │ ├── rusty__validation__tests__duplicates_validation_test__duplicate_pous_validation.snap │ │ ├── rusty__validation__tests__duplicates_validation_test__duplicate_variables_in_same_pou.snap │ │ ├── rusty__validation__tests__enum_validation_test__enum_mismatch_error_with_many_variants_truncates_values_for_better_readability.snap │ │ ├── rusty__validation__tests__enum_validation_test__enum_variants_mismatch.snap │ │ ├── rusty__validation__tests__enum_validation_test__enum_variants_mismatch_but_values_are_identical.snap │ │ ├── rusty__validation__tests__enum_validation_test__validate_enum_variant_initializer.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_bit_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_bit_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_bit_does_not_allow_ints.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_bit_does_not_allow_reals.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_bit_does_not_allow_string.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_bit_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_bit_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_char_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_char_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_char_does_not_allow_ints.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_char_does_not_allow_reals.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_char_does_not_allow_string.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_char_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_char_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_chars_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_chars_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_chars_does_not_allow_ints.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_chars_does_not_allow_reals.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_chars_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_chars_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_date_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_date_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_date_does_not_allow_ints.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_date_does_not_allow_reals.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_date_does_not_allow_string.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_date_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_date_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_duration_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_duration_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_duration_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_duration_does_not_allow_ints.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_duration_does_not_allow_reals.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_duration_does_not_allow_string.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_duration_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_int_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_int_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_int_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_int_does_not_allow_reals.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_int_does_not_allow_string.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_int_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_int_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_magnitude_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_magnitude_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_magnitude_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_magnitude_does_not_allow_strings.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_magnitude_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_num_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_num_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_num_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_num_does_not_allow_strings.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_num_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_num_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_real_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_real_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_real_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_real_does_not_allow_string.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_real_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_real_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_signed_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_signed_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_signed_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_signed_does_not_allow_reals.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_signed_does_not_allow_string.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_signed_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_signed_does_not_allow_unsigned_ints.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_signed_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_string_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_string_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_string_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_string_does_not_allow_ints.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_string_does_not_allow_reals.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_string_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_string_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_unsigned_does_not_allow_bits.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_unsigned_does_not_allow_chars.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_unsigned_does_not_allow_date.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_unsigned_does_not_allow_reals.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_unsigned_does_not_allow_signed_ints.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_unsigned_does_not_allow_string.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_unsigned_does_not_allow_time.snap │ │ ├── rusty__validation__tests__generic_validation_tests__any_unsigned_multiple_parameters.snap │ │ ├── rusty__validation__tests__generic_validation_tests__generic_call_with_formal_parameter.snap │ │ ├── rusty__validation__tests__generic_validation_tests__non_resolved_generics_reported.snap │ │ ├── rusty__validation__tests__literals_validation_tests__bool_literal_casts_are_validated.snap │ │ ├── rusty__validation__tests__literals_validation_tests__char_cast_validate.snap │ │ ├── rusty__validation__tests__literals_validation_tests__date_literal_casts_are_validated.snap │ │ ├── rusty__validation__tests__literals_validation_tests__int_literal_casts_max_values_are_validated.snap │ │ ├── rusty__validation__tests__literals_validation_tests__literal_cast_with_non_literal.snap │ │ ├── rusty__validation__tests__literals_validation_tests__real_literal_casts_are_validated.snap │ │ ├── rusty__validation__tests__literals_validation_tests__string_literal_casts_are_validated.snap │ │ ├── rusty__validation__tests__naming_validation_test__BOOL.snap │ │ ├── rusty__validation__tests__naming_validation_test__BYTE.snap │ │ ├── rusty__validation__tests__naming_validation_test__CHAR.snap │ │ ├── rusty__validation__tests__naming_validation_test__D.snap │ │ ├── rusty__validation__tests__naming_validation_test__DATE.snap │ │ ├── rusty__validation__tests__naming_validation_test__DATE_AND_TIME.snap │ │ ├── rusty__validation__tests__naming_validation_test__DINT.snap │ │ ├── rusty__validation__tests__naming_validation_test__DT.snap │ │ ├── rusty__validation__tests__naming_validation_test__DWORD.snap │ │ ├── rusty__validation__tests__naming_validation_test__INT.snap │ │ ├── rusty__validation__tests__naming_validation_test__LD.snap │ │ ├── rusty__validation__tests__naming_validation_test__LDATE.snap │ │ ├── rusty__validation__tests__naming_validation_test__LDATE_AND_TIME.snap │ │ ├── rusty__validation__tests__naming_validation_test__LDT.snap │ │ ├── rusty__validation__tests__naming_validation_test__LINT.snap │ │ ├── rusty__validation__tests__naming_validation_test__LREAL.snap │ │ ├── rusty__validation__tests__naming_validation_test__LT.snap │ │ ├── rusty__validation__tests__naming_validation_test__LTIME.snap │ │ ├── rusty__validation__tests__naming_validation_test__LTIME_OF_DAY.snap │ │ ├── rusty__validation__tests__naming_validation_test__LTOD.snap │ │ ├── rusty__validation__tests__naming_validation_test__LWORD.snap │ │ ├── rusty__validation__tests__naming_validation_test__REAL.snap │ │ ├── rusty__validation__tests__naming_validation_test__SINT.snap │ │ ├── rusty__validation__tests__naming_validation_test__STRING.snap │ │ ├── rusty__validation__tests__naming_validation_test__T.snap │ │ ├── rusty__validation__tests__naming_validation_test__TIME.snap │ │ ├── rusty__validation__tests__naming_validation_test__TIME_OF_DAY.snap │ │ ├── rusty__validation__tests__naming_validation_test__TOD.snap │ │ ├── rusty__validation__tests__naming_validation_test__UDINT.snap │ │ ├── rusty__validation__tests__naming_validation_test__UINT.snap │ │ ├── rusty__validation__tests__naming_validation_test__ULINT.snap │ │ ├── rusty__validation__tests__naming_validation_test__USINT.snap │ │ ├── rusty__validation__tests__naming_validation_test__VOID.snap │ │ ├── rusty__validation__tests__naming_validation_test__WCHAR.snap │ │ ├── rusty__validation__tests__naming_validation_test__WORD.snap │ │ ├── rusty__validation__tests__naming_validation_test__WSTRING.snap │ │ ├── rusty__validation__tests__naming_validation_test____U1.snap │ │ ├── rusty__validation__tests__pou_validation_tests__actions_container_no_name.snap │ │ ├── rusty__validation__tests__pou_validation_tests__class_has_implementation.snap │ │ ├── rusty__validation__tests__pou_validation_tests__class_with_return_type.snap │ │ ├── rusty__validation__tests__pou_validation_tests__function_has_super_class.snap │ │ ├── rusty__validation__tests__pou_validation_tests__in_out_variable_not_allowed_in_class.snap │ │ ├── rusty__validation__tests__pou_validation_tests__in_out_variable_out_of_order.snap │ │ ├── rusty__validation__tests__pou_validation_tests__input_variable_not_allowed_in_class.snap │ │ ├── rusty__validation__tests__pou_validation_tests__local_variable_allowed_in_class.snap │ │ ├── rusty__validation__tests__pou_validation_tests__output_variable_not_allowed_in_class.snap │ │ ├── rusty__validation__tests__pou_validation_tests__program_has_super_class.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__arrays__one_cycle_aba_input.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__arrays__one_cycle_aba_output.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__arrays__one_cycle_bcb.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__arrays__one_cycle_with_multiple_identical_members_aba.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__arrays__two_cycles_aa_and_aba.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__arrays__two_cycles_with_branch_input.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__functionblocks__one_cycle_aba_input.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__functionblocks__one_cycle_aba_output.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__functionblocks__one_cycle_aba_var.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__functionblocks__two_cycles_with_branch_input.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__mixed_structs_and_functionblocks__one_cycle_aba_input.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__mixed_structs_and_functionblocks__one_cycle_aba_output.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__mixed_structs_and_functionblocks__two_cycles_with_branch_input.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__structs__one_cycle_aba.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__structs__one_cycle_abca.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__structs__one_cycle_bcb.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__structs__one_cycle_multiple_self_a.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__structs__one_cycle_self_a.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__structs__one_cycle_with_multiple_identical_members_aba.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__structs__two_cycles_aa_and_aba.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__structs__two_cycles_branch_cc_and_cec.snap │ │ ├── rusty__validation__tests__recursive_validation_tests__structs__two_cycles_with_branch.snap │ │ ├── rusty__validation__tests__reference_resolve_tests__reference_to_private_variable_in_intermediate_fb.snap │ │ ├── rusty__validation__tests__reference_resolve_tests__reference_to_private_variable_is_illegal.snap │ │ ├── rusty__validation__tests__reference_resolve_tests__resole_struct_member_access.snap │ │ ├── rusty__validation__tests__reference_resolve_tests__resolve_function_block_calls_in_structs_and_field_access.snap │ │ ├── rusty__validation__tests__reference_resolve_tests__resolve_function_calls_and_parameters.snap │ │ ├── rusty__validation__tests__reference_resolve_tests__resolve_function_members_via_qualifier.snap │ │ ├── rusty__validation__tests__reference_resolve_tests__resolve_simple_variable_references.snap │ │ ├── rusty__validation__tests__statement_validation_tests__action_implicit_downcast.snap │ │ ├── rusty__validation__tests__statement_validation_tests__address_of_operations.snap │ │ ├── rusty__validation__tests__statement_validation_tests__assign_pointer_to_too_small_type_result_in_an_error.snap │ │ ├── rusty__validation__tests__statement_validation_tests__assign_too_small_type_to_pointer_result_in_an_error.snap │ │ ├── rusty__validation__tests__statement_validation_tests__assigning_to_rvalue.snap │ │ ├── rusty__validation__tests__statement_validation_tests__assignment_of_incompatible_types_is_reported.snap │ │ ├── rusty__validation__tests__statement_validation_tests__assignment_to_constants_result_in_an_error.snap │ │ ├── rusty__validation__tests__statement_validation_tests__assignment_to_enum_literals_results_in_error.snap │ │ ├── rusty__validation__tests__statement_validation_tests__bit_access_with_incorrect_operator_causes_warning.snap │ │ ├── rusty__validation__tests__statement_validation_tests__case_condition_used_outside_case_statement.snap │ │ ├── rusty__validation__tests__statement_validation_tests__exlicit_param_different_casing.snap │ │ ├── rusty__validation__tests__statement_validation_tests__exlicit_param_unknown_reference.snap │ │ ├── rusty__validation__tests__statement_validation_tests__function_block_implicit_downcast.snap │ │ ├── rusty__validation__tests__statement_validation_tests__function_call_parameter_validation.snap │ │ ├── rusty__validation__tests__statement_validation_tests__implicit_param_downcast_in_function_call.snap │ │ ├── rusty__validation__tests__statement_validation_tests__invalid_cast_statement_causes_error.snap │ │ ├── rusty__validation__tests__statement_validation_tests__invalid_char_assignments.snap │ │ ├── rusty__validation__tests__statement_validation_tests__method_implicit_downcast.snap │ │ ├── rusty__validation__tests__statement_validation_tests__missing_string_compare_function_causes_error.snap │ │ ├── rusty__validation__tests__statement_validation_tests__missing_wstring_compare_function_causes_error.snap │ │ ├── rusty__validation__tests__statement_validation_tests__passing_compatible_numeric_types_to_functions_is_allowed.snap │ │ ├── rusty__validation__tests__statement_validation_tests__program_call_parameter_validation.snap │ │ ├── rusty__validation__tests__statement_validation_tests__program_implicit_downcast.snap │ │ ├── rusty__validation__tests__statement_validation_tests__program_missing_inout_assignment.snap │ │ ├── rusty__validation__tests__statement_validation_tests__ref_builtin_function_reports_invalid_param_count.snap │ │ ├── rusty__validation__tests__statement_validation_tests__reference_to_reference_assignments_in_function_arguments.snap │ │ ├── rusty__validation__tests__statement_validation_tests__string_compare_function_with_wrong_signature_causes_error.snap │ │ ├── rusty__validation__tests__statement_validation_tests__switch_case_duplicate_integer.snap │ │ ├── rusty__validation__tests__statement_validation_tests__switch_case_duplicate_integer_non_const_var_reference.snap │ │ ├── rusty__validation__tests__statement_validation_tests__switch_case_invalid_case_conditions.snap │ │ ├── rusty__validation__tests__statement_validation_tests__validate_array_elements_passed_to_functions_by_ref.snap │ │ ├── rusty__validation__tests__statement_validation_tests__validate_arrays_passed_to_functions.snap │ │ ├── rusty__validation__tests__statement_validation_tests__validate_call_by_ref.snap │ │ ├── rusty__validation__tests__statement_validation_tests__validate_call_by_ref_explicit.snap │ │ ├── rusty__validation__tests__variable_length_array_test__access__variable_length_array_access.snap │ │ ├── rusty__validation__tests__variable_length_array_test__access__variable_length_array_incompatible_datatypes.snap │ │ ├── rusty__validation__tests__variable_length_array_test__assignment__function_calls.snap │ │ ├── rusty__validation__tests__variable_length_array_test__builtins__builtins_called_with_aliased_type.snap │ │ ├── rusty__validation__tests__variable_length_array_test__builtins__builtins_called_with_invalid_index.snap │ │ ├── rusty__validation__tests__variable_length_array_test__builtins__builtins_called_with_invalid_number_of_params.snap │ │ ├── rusty__validation__tests__variable_length_array_test__builtins__builtins_called_with_invalid_type.snap │ │ ├── rusty__validation__tests__variable_length_array_test__functions__variable_length_array_function_input.snap │ │ ├── rusty__validation__tests__variable_length_array_test__naming__global_vla_does_not_cause_name_conflict.snap │ │ ├── rusty__validation__tests__variable_length_array_test__program__variable_length_array_program_inout.snap │ │ ├── rusty__validation__tests__variable_length_array_test__program__variable_length_array_program_input.snap │ │ ├── rusty__validation__tests__variable_length_array_test__program__variable_length_array_program_input_ref.snap │ │ ├── rusty__validation__tests__variable_length_array_test__program__variable_length_array_program_output.snap │ │ ├── rusty__validation__tests__variable_length_array_test__variable_length_array_defined_as_a_global_variable.snap │ │ ├── rusty__validation__tests__variable_validation_tests__assignment_suggestion_for_equal_operation_with_no_effect.snap │ │ ├── rusty__validation__tests__variable_validation_tests__constant_fb_instances_are_illegal.snap │ │ ├── rusty__validation__tests__variable_validation_tests__constant_on_illegal_var_blocks_cause_validation_issue.snap │ │ ├── rusty__validation__tests__variable_validation_tests__overflows__overflows_with_aliases.snap │ │ ├── rusty__validation__tests__variable_validation_tests__overflows__overflows_with_array_initializer.snap │ │ ├── rusty__validation__tests__variable_validation_tests__overflows__overflows_with_constants.snap │ │ ├── rusty__validation__tests__variable_validation_tests__overflows__overflows_with_expressions.snap │ │ ├── rusty__validation__tests__variable_validation_tests__overflows__overflows_with_globals.snap │ │ ├── rusty__validation__tests__variable_validation_tests__overflows__overflows_with_hex.snap │ │ ├── rusty__validation__tests__variable_validation_tests__overflows__overflows_with_literals.snap │ │ ├── rusty__validation__tests__variable_validation_tests__overflows__overflows_with_non_global_constants.snap │ │ ├── rusty__validation__tests__variable_validation_tests__overflows__overflows_with_not.snap │ │ ├── rusty__validation__tests__variable_validation_tests__sized_varargs_require_type.snap │ │ ├── rusty__validation__tests__variable_validation_tests__type_initializers_in_structs_are_validated.snap │ │ └── rusty__validation__tests__variable_validation_tests__unresolvable_variables_are_reported.snap │ ├── statement_validation_tests.rs │ ├── super_keyword_validation_tests.rs │ ├── this_keyword_validation_tests.rs │ ├── variable_length_array_test.rs │ └── variable_validation_tests.rs │ ├── types.rs │ └── variable.rs ├── tests ├── correctness │ ├── arithmetic_functions │ │ ├── addition.rs │ │ ├── division.rs │ │ ├── multiplication.rs │ │ └── substraction.rs │ ├── arrays.rs │ ├── bitaccess.rs │ ├── classes.rs │ ├── comparison_functions │ │ ├── equal.rs │ │ ├── greater_than.rs │ │ ├── greater_than_or_equal.rs │ │ ├── less_than.rs │ │ ├── less_than_or_equal.rs │ │ └── not_equal.rs │ ├── constants.rs │ ├── control_flow.rs │ ├── custom_datatypes.rs │ ├── datatypes.rs │ ├── expressions.rs │ ├── external_functions.rs │ ├── functions.rs │ ├── generic_functions.rs │ ├── global_variables.rs │ ├── initial_values.rs │ ├── math_operators │ │ ├── addition.rs │ │ ├── division.rs │ │ ├── mixed.rs │ │ ├── multiplication.rs │ │ └── substraction.rs │ ├── methods.rs │ ├── pointers.rs │ ├── pointers │ │ └── references.rs │ ├── strings.rs │ ├── sub_range_types.rs │ └── vla.rs ├── integration │ ├── build_description_tests.rs │ ├── cfc.rs │ ├── cfc │ │ ├── resolver_tests.rs │ │ ├── snapshots │ │ │ ├── tests__integration__cfc__resolver_tests__action_variables_annotated-2.snap │ │ │ ├── tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap │ │ │ ├── tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap │ │ │ ├── tests__integration__cfc__resolver_tests__action_variables_annotated.snap │ │ │ ├── tests__integration__cfc__resolver_tests__jumps_annotated_with_label_annoations.snap │ │ │ ├── tests__integration__cfc__resolver_tests__label_added_to_index_as_annotation.snap │ │ │ ├── tests__integration__cfc__validation_tests__duplicate_label_validation.snap │ │ │ └── tests__integration__cfc__validation_tests__jump_with_missing_label_validation.snap │ │ └── validation_tests.rs │ ├── command_line_compile.rs │ ├── data │ │ ├── cfc │ │ │ ├── actions.cfc │ │ │ ├── assigning.cfc │ │ │ ├── assigning.st │ │ │ ├── chained_calls.cfc │ │ │ ├── chained_calls.st │ │ │ ├── chained_calls_galore.cfc │ │ │ ├── chained_calls_galore.st │ │ │ ├── conditional_return.cfc │ │ │ ├── conditional_return_block.cfc │ │ │ ├── conditional_return_block_evaluating_false.st │ │ │ ├── conditional_return_block_evaluating_true.st │ │ │ ├── conditional_return_evaluating_false.st │ │ │ ├── conditional_return_evaluating_true.st │ │ │ ├── conditional_return_evaluating_true_negated.st │ │ │ ├── conditional_return_negated.cfc │ │ │ ├── conditional_return_simple.cfc │ │ │ ├── connection.st │ │ │ ├── connection_block_source_multi_sink.cfc │ │ │ ├── connection_var_source_multi_sink.cfc │ │ │ ├── duplicate_label.cfc │ │ │ ├── function_block_call_fb.cfc │ │ │ ├── function_block_call_main.cfc │ │ │ ├── function_returns.cfc │ │ │ ├── function_returns.st │ │ │ ├── jump_false.cfc │ │ │ ├── jump_missing_label.cfc │ │ │ ├── jump_no_label.cfc │ │ │ ├── jump_true.cfc │ │ │ ├── multi_labels.cfc │ │ │ ├── my_add.cfc │ │ │ ├── my_add.st │ │ │ ├── select.cfc │ │ │ ├── select.st │ │ │ ├── variable_assignment.cfc │ │ │ └── variable_assignment.st │ │ ├── command_line.st │ │ ├── empty_proj │ │ │ ├── conf │ │ │ │ ├── plc.json │ │ │ │ └── tasks │ │ │ │ │ └── mainTask.task.st │ │ │ └── src │ │ │ │ ├── globals.gvl │ │ │ │ └── mainProg.st │ │ ├── encoding_utf_16.st │ │ ├── encoding_win.st │ │ ├── io.st │ │ ├── json │ │ │ ├── build_cc_linker.json │ │ │ ├── build_clang_windows.json │ │ │ ├── build_to_temp.json │ │ │ ├── build_without_sysroot.json │ │ │ ├── libs │ │ │ │ ├── aarch64-linux-gnu │ │ │ │ │ ├── libcopy.so │ │ │ │ │ ├── libcopy2.so │ │ │ │ │ └── libnocopy.so │ │ │ │ ├── libcopy.so │ │ │ │ ├── libcopy2.so │ │ │ │ ├── libnocopy.so │ │ │ │ └── x86_64-linux-gnu │ │ │ │ │ ├── libcopy.so │ │ │ │ │ ├── libcopy2.so │ │ │ │ │ └── libnocopy.so │ │ │ ├── multi_target_and_sysroot.json │ │ │ ├── prog_with_globals.json │ │ │ ├── program_with_expressions.st │ │ │ ├── program_with_variables.st │ │ │ ├── separate_build_and_lib.json │ │ │ └── simple_program.st │ │ ├── linking │ │ │ ├── consts.dt │ │ │ ├── consts.st │ │ │ ├── file1.st │ │ │ ├── file2.st │ │ │ ├── folder1 │ │ │ │ └── vars.st │ │ │ ├── folder2 │ │ │ │ └── vars.st │ │ │ ├── init.st │ │ │ ├── init2.st │ │ │ ├── init3.st │ │ │ ├── lib.o │ │ │ └── relative.st │ │ ├── multi │ │ │ ├── concat_date.st │ │ │ ├── concat_date_prg1.st │ │ │ ├── concat_date_prg2.st │ │ │ ├── enum1.st │ │ │ ├── enum2.st │ │ │ ├── func.st │ │ │ └── prog.st │ │ └── test_file.st │ ├── external_files.rs │ ├── linking.rs │ ├── multi_files.rs │ └── snapshots │ │ ├── tests__integration__cfc__ir__actions_debug.snap │ │ ├── tests__integration__cfc__ir__conditional_return.snap │ │ ├── tests__integration__cfc__ir__conditional_return_debug.snap │ │ ├── tests__integration__cfc__ir__conditional_return_evaluating_true.snap │ │ ├── tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap │ │ ├── tests__integration__cfc__ir__jump_debug.snap │ │ ├── tests__integration__cfc__ir__jump_to_label_with_false.snap │ │ ├── tests__integration__cfc__ir__jump_to_label_with_true.snap │ │ ├── tests__integration__cfc__ir__sink_source_debug.snap │ │ ├── tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap │ │ ├── tests__integration__command_line_compile__hardware_conf_full_pass_json.snap │ │ ├── tests__integration__command_line_compile__hardware_conf_full_pass_toml.snap │ │ └── tests__integration__command_line_compile__ir_generation_full_pass.snap ├── lit │ ├── lit.cfg │ ├── multi │ │ ├── enum__month_to_int │ │ │ ├── month_to_int.st │ │ │ ├── month_to_int.test │ │ │ └── months.dt │ │ ├── extern_C_fb_init │ │ │ ├── extern_C_fb_init.test │ │ │ ├── foo.c │ │ │ ├── header.pli │ │ │ ├── lit.local.cfg │ │ │ └── main.st │ │ └── lit.local.cfg │ ├── single │ │ ├── address │ │ │ ├── hardware_reference_used.st │ │ │ └── reference_in_body.st │ │ ├── arithmetic │ │ │ ├── addition.st │ │ │ └── sqrt.st │ │ ├── complex_return_types │ │ │ ├── array_of_string_return.st │ │ │ ├── function_with_explicit_calls.st │ │ │ ├── nested_string_return_call_in_if_condition.st │ │ │ └── string_return_function_called_in_while_loop.st │ │ ├── conversion │ │ │ ├── real_trunc_int.st │ │ │ ├── to_bit.st │ │ │ ├── to_date_time.st │ │ │ ├── to_num.st │ │ │ ├── to_string.st │ │ │ └── trunc_int.st │ │ ├── functions │ │ │ ├── call_with_array_access_on_result.st │ │ │ └── segmented_variable_blocks_with_implicit_arguments_call.st │ │ ├── init │ │ │ ├── complex_initializers.ignore │ │ │ ├── config_variables.st │ │ │ ├── config_variables_dont_clash_with_globals.st │ │ │ ├── function_locals.st │ │ │ ├── global_struct_instances.st │ │ │ ├── global_variables.st │ │ │ ├── methods.st │ │ │ ├── nested_pous.st │ │ │ ├── program.st │ │ │ ├── structs.st │ │ │ ├── user_init.st │ │ │ └── user_init_for_stack_variable.st │ │ ├── lit.local.cfg │ │ ├── oop │ │ │ ├── aggregate_return_complex.st │ │ │ ├── aggregate_return_types.st │ │ │ ├── fb_access_members_from_base.st │ │ │ ├── fb_complex_access_of_super_members.st │ │ │ ├── fb_method_callled.st │ │ │ ├── fb_method_shadowing.st │ │ │ ├── fb_method_with_explicit_return.st │ │ │ ├── fb_with_super_class_method_calls.st │ │ │ ├── grandparent_access_through_super.st │ │ │ ├── method_initial_values.st │ │ │ ├── method_var_output.st │ │ │ ├── parent_variable_access_in_method.st │ │ │ ├── program_method_called.st │ │ │ ├── program_method_shadowing.st │ │ │ ├── super_basic_access.st │ │ │ ├── super_in_control_structures.st │ │ │ ├── super_keyword_overridden_method.st │ │ │ ├── super_multi_level_inheritance.st │ │ │ ├── super_with_parenthesized_expressions.st │ │ │ ├── super_without_deref.st │ │ │ ├── this_basic_access.st │ │ │ ├── this_in_control_structures.st │ │ │ ├── this_with_parenthesized_expressions.st │ │ │ └── this_without_deref.st │ │ ├── pointer │ │ │ ├── alias_array.ignore │ │ │ ├── alias_autoderef.ignore │ │ │ ├── alias_struct.ignore │ │ │ ├── ref_assignment_operator.st │ │ │ ├── referenceto_variable_autoderef.st │ │ │ ├── referenceto_variable_referencing_array.st │ │ │ ├── referenceto_variable_referencing_itself.st │ │ │ ├── referenceto_variable_referencing_other_referenceto_variable.st │ │ │ └── referenceto_variable_referencing_struct.st │ │ ├── property │ │ │ ├── called_inside_pou_where_defined.st │ │ │ ├── complex.st │ │ │ ├── getter_used_in_array_indexing.st │ │ │ ├── modify_array_value_with_get_and_set.st │ │ │ ├── multiply_properties_single_pou.st │ │ │ ├── nested.st │ │ │ ├── oop_extended_fb_calls_property_in_another_property.st │ │ │ ├── oop_extended_function_block.st │ │ │ ├── oop_inheritance.st │ │ │ ├── oop_interface_extension.st │ │ │ ├── oop_interface_extension_call_in_fb_body.st │ │ │ ├── property_used_in_action.st │ │ │ ├── property_with_local_variables.st │ │ │ ├── recursion.st │ │ │ ├── same_property_in_different_pous_called_in_method.st │ │ │ ├── simple.st │ │ │ └── struct_return_type.st │ │ ├── var_external │ │ │ ├── var_external.st │ │ │ └── var_external_initializer_has_no_effect.st │ │ └── variable │ │ │ └── global_namespace_operator.st │ └── util │ │ └── printf.pli ├── test_utils │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── tests.rs └── xtask ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md ├── migrations └── 20230620132156_benchmarks.sql ├── res ├── ARCH.drawio ├── ARCH.svg ├── combined.st ├── sieve.c └── sieve.st └── src ├── main.rs ├── reporter.rs ├── reporter ├── git.rs ├── sql.rs └── sysout.rs ├── task.rs └── task ├── compile.rs ├── lexer.rs └── run.rs /.config/nextest.toml: -------------------------------------------------------------------------------- 1 | [profile.ci.junit] 2 | path = "junit.xml" -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore target directory 2 | target/ 3 | 4 | # Ignore any build artifacts 5 | **/*.rs.bk 6 | 7 | # Ignore any generated files 8 | **/Cargo.lock 9 | **/Cargo.toml.orig 10 | **/Cargo.toml.bk 11 | 12 | # Ignore any IDE-specific files 13 | .vscode/ 14 | .idea/ 15 | 16 | # Ignore Dockerfile and dockerignore file 17 | Dockerfile 18 | .dockerignore 19 | 20 | # Workflow 21 | .github -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | charset = utf-8 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | indent_style = space 9 | indent_size = 4 10 | 11 | [*.{yaml,yml}] 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour to force line endings to LF. 2 | * text=auto eol=lf 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/refactoring.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Refactoring 3 | about: Improve code in this project 4 | title: Refactor [...] 5 | labels: refactor 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your refactor request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /target-watch 3 | /output 4 | /.idea 5 | **/*.rs.bk 6 | **/*.un~ 7 | **/*.toml~ 8 | *.ll 9 | *.o 10 | *.bc 11 | *.a 12 | *.elf 13 | *.out 14 | .env 15 | 16 | # Garbage generated by llvm-lit 17 | tests/lit/**/*.txt 18 | tests/lit/**/Output/ 19 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/plc-lang/rust-llvm:latest 2 | 3 | # Allow invoking `plc` from anywhere 4 | ENV PLCLOC="/opt/rusty" 5 | ENV STDLIBLOC="/opt/rusty/stdlib" 6 | ENV PATH="${PLCLOC}:${PATH}" 7 | 8 | # Install the local RuSTy version 9 | COPY artifacts/plc /opt/rusty 10 | # Make the binary executable 11 | RUN chmod +x /opt/rusty/plc 12 | # Copy the standard library 13 | COPY artifacts/stdlib /opt/rusty/stdlib 14 | 15 | ENTRYPOINT [ "/bin/bash", "-c" ] 16 | CMD ["plc", "--help"] 17 | -------------------------------------------------------------------------------- /book/.gitignore: -------------------------------------------------------------------------------- 1 | book 2 | -------------------------------------------------------------------------------- /book/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["Ghaith Hachem", "Mathias Rieder", "Alexander Ulmer"] 3 | language = "en" 4 | multilingual = false 5 | src = "src" 6 | title = "RuSTy User Documentation" 7 | [output.html] 8 | additional-js = ["iecst.min.js", "llvm.min.js", "custom.js", "highlight.js"] 9 | 10 | [output.html.fold] 11 | enable = true 12 | level = 0 13 | 14 | [preprocessor.errors] 15 | command = "../target/release/errorcode_book_generator" 16 | err_location = "../compiler/plc_diagnostics/src/diagnostics/error_codes" 17 | err_target = "using_rusty/error_configuration.md" 18 | -------------------------------------------------------------------------------- /book/custom.js: -------------------------------------------------------------------------------- 1 | //Initialize st highlight 2 | hljs.initHighlightingOnLoad(); 3 | -------------------------------------------------------------------------------- /book/src/cfc.md: -------------------------------------------------------------------------------- 1 | # CFC 2 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | # https://docs.codecov.com/docs/common-recipe-list 2 | coverage: 3 | status: 4 | project: 5 | default: 6 | informational: true #Ignore failed coverage 7 | patch: 8 | default: 9 | informational: true #Ignore failed coverage 10 | -------------------------------------------------------------------------------- /compiler/plc_ast/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plc_ast" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | plc_util = { path = "../plc_util" } 10 | plc_source = { path = "../plc_source" } 11 | chrono = { version = "0.4", default-features = false } 12 | serde = { version = "1.0", features = ["derive"] } 13 | derive_more = { version = "0.99.0", features = ["try_into"] } 14 | rustc-hash.workspace = true 15 | -------------------------------------------------------------------------------- /compiler/plc_ast/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! This crates represents the Abstract syntax tree (AST) 2 | //! It is currently only a re-export of the ast module from the root, but these should 3 | //! eventually move here 4 | 5 | pub mod ast; 6 | pub mod control_statements; 7 | pub mod literals; 8 | pub mod mut_visitor; 9 | mod pre_processor; 10 | pub mod provider; 11 | pub mod visitor; 12 | -------------------------------------------------------------------------------- /compiler/plc_derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plc_derive" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | syn = "0.15" 10 | quote = "0.6" 11 | 12 | [lib] 13 | proc-macro = true 14 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plc_diagnostics" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | codespan-reporting = "0.11.1" 10 | plc_ast = { path = "../plc_ast" } 11 | plc_source = { path = "../plc_source" } 12 | serde_json.workspace = true 13 | serde.workspace = true 14 | toml.workspace = true 15 | anyhow.workspace = true 16 | lazy_static.workspace = true 17 | log.workspace = true 18 | rustc-hash.workspace = true -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E001.md: -------------------------------------------------------------------------------- 1 | # General Error 2 | 3 | This error is a catch all error. It is usually thrown when no other error better matches the case. 4 | 5 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E002.md: -------------------------------------------------------------------------------- 1 | # General IO Error 2 | 3 | This error describes a problem during an IO operation such as reading or writing a file. 4 | It is usually accompanied by an internal error with further details. 5 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E003.md: -------------------------------------------------------------------------------- 1 | # Parameter Error 2 | 3 | This error describes a problem with the command parameters, such as a file required for the compilation not being found.: 4 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E004.md: -------------------------------------------------------------------------------- 1 | # Duplicate Symbol 2 | 3 | The marked symbol has been defined multiple times. 4 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E005.md: -------------------------------------------------------------------------------- 1 | # Generic LLVM Error 2 | 3 | An unexpected error occurred during the LLVM generation phase. 4 | This is usually a follow up problem from a different diagnostics. 5 | If it occurrs without a previous diagnostics please file a bug report. 6 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E007.md: -------------------------------------------------------------------------------- 1 | # Unexpected Token 2 | 3 | During parsing, a _Token_ (Element) was encountered in the wrong location. This could be an indication of a missused or misspelled keyword 4 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E008.md: -------------------------------------------------------------------------------- 1 | # Invalid Range 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E009.md: -------------------------------------------------------------------------------- 1 | # Mismatched Parantheses 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E010.md: -------------------------------------------------------------------------------- 1 | # Invalid time literal 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E011.md: -------------------------------------------------------------------------------- 1 | # Invalid Number 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E012.md: -------------------------------------------------------------------------------- 1 | # Missing Case Contition 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E013.md: -------------------------------------------------------------------------------- 1 | # Keywords should contain Underscores 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E014.md: -------------------------------------------------------------------------------- 1 | # Wrong paranthese for String delimiter 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E015.md: -------------------------------------------------------------------------------- 1 | # POINTER_TO is no standard keyword 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E016.md: -------------------------------------------------------------------------------- 1 | # Return types cannot have a default value 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E017.md: -------------------------------------------------------------------------------- 1 | # Classes cannot contain implementation 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E018.md: -------------------------------------------------------------------------------- 1 | # Duplicate Label 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E019.md: -------------------------------------------------------------------------------- 1 | # Classes cannot contain IN_OUT variables 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E020.md: -------------------------------------------------------------------------------- 1 | # Classes cannot contain a return type 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E021.md: -------------------------------------------------------------------------------- 1 | # Variable re-declatation in Subclasses is not allowed 2 | 3 | A variable already declared in a parent class cannot be re-declared in a subclass. 4 | 5 | Example: 6 | 7 | ```iecst 8 | FUNCTION_BLOCK FB 9 | VAR 10 | a : INT; 11 | END_VAR 12 | END_FUNCTION_BLOCK 13 | 14 | FUNCTION_BLOCK FB2 EXTENDS FB 15 | VAR 16 | a : INT; // Error: Variable 'a' is already declared in the parent class 17 | END_VAR 18 | END_FUNCTION_BLOCK 19 | ``` 20 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E022.md: -------------------------------------------------------------------------------- 1 | # Missing container name for action 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E023.md: -------------------------------------------------------------------------------- 1 | # Statement has no effect 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E024.md: -------------------------------------------------------------------------------- 1 | # Invalid Pragma Location 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E025.md: -------------------------------------------------------------------------------- 1 | # Missing return type 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E026.md: -------------------------------------------------------------------------------- 1 | # Unexpected return type 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E027.md: -------------------------------------------------------------------------------- 1 | # Unsupported return type 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E028.md: -------------------------------------------------------------------------------- 1 | # Empty variable block 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E029.md: -------------------------------------------------------------------------------- 1 | # Recursive data structure 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E030.md: -------------------------------------------------------------------------------- 1 | # Missing IN_OUT parameters 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E031.md: -------------------------------------------------------------------------------- 1 | # Invalid parameter type 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E033.md: -------------------------------------------------------------------------------- 1 | # Unresolved Constant 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E034.md: -------------------------------------------------------------------------------- 1 | # Invalid constant block 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E035.md: -------------------------------------------------------------------------------- 1 | # Invalid Constant 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E036.md: -------------------------------------------------------------------------------- 1 | # Cannot assign to constant 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E037.md: -------------------------------------------------------------------------------- 1 | # Invalid assignment 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E038.md: -------------------------------------------------------------------------------- 1 | # Missing type 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E039.md: -------------------------------------------------------------------------------- 1 | # Variable Overflow 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E040.md: -------------------------------------------------------------------------------- 1 | # Invalid Enum Variant 2 | 3 | This error indicates the right-hand side in an enum assignment is invalid. 4 | For example an enum such as `TYPE Color : (red := 0, green := 1, blue := 2); END_TYPE` can only take values 5 | which (internally) yield a literal integer 0, 1 or 2. -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E041.md: -------------------------------------------------------------------------------- 1 | # Invalid variable initializer 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E042.md: -------------------------------------------------------------------------------- 1 | # Assignment to Reference 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E043.md: -------------------------------------------------------------------------------- 1 | # Invalid array assignment 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E044.md: -------------------------------------------------------------------------------- 1 | # Invalid POU for VLA 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E045.md: -------------------------------------------------------------------------------- 1 | # Invalid VLA array access 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E046.md: -------------------------------------------------------------------------------- 1 | # VLA Dimension out of bounds 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E047.md: -------------------------------------------------------------------------------- 1 | # VLAs are always By Reference 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E048.md: -------------------------------------------------------------------------------- 1 | # Unresolved Reference 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E049.md: -------------------------------------------------------------------------------- 1 | # Illegal reference access 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E050.md: -------------------------------------------------------------------------------- 1 | # Expression is not assignable 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E051.md: -------------------------------------------------------------------------------- 1 | # Typecast error 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E052.md: -------------------------------------------------------------------------------- 1 | # Unknown type 2 | 3 | Use of undeclared type-identifier. -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E053.md: -------------------------------------------------------------------------------- 1 | # Literal out of range 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E054.md: -------------------------------------------------------------------------------- 1 | # Literal not compatible with type 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E055.md: -------------------------------------------------------------------------------- 1 | # Incompatible direct access 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E056.md: -------------------------------------------------------------------------------- 1 | # Incompatible variable for direct access 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E057.md: -------------------------------------------------------------------------------- 1 | # Invalid range for direct access 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E058.md: -------------------------------------------------------------------------------- 1 | # Invalid range for array access 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E059.md: -------------------------------------------------------------------------------- 1 | # Invalid variable for array access 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E060.md: -------------------------------------------------------------------------------- 1 | # Direct access to variable with % 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E061.md: -------------------------------------------------------------------------------- 1 | # Expected literal 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E062.md: -------------------------------------------------------------------------------- 1 | # Invalid Nature 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E063.md: -------------------------------------------------------------------------------- 1 | # Unknown Nature 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E064.md: -------------------------------------------------------------------------------- 1 | # Unresolved Generic 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E065.md: -------------------------------------------------------------------------------- 1 | # Incompatible size 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E066.md: -------------------------------------------------------------------------------- 1 | # Invalid operation 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E067.md: -------------------------------------------------------------------------------- 1 | # Implicit typecast 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E068.md: -------------------------------------------------------------------------------- 1 | # Pointer derefernce to non pointer 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E069.md: -------------------------------------------------------------------------------- 1 | # Array access to non array value 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E070.md: -------------------------------------------------------------------------------- 1 | # Address-of requires a value 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E071.md: -------------------------------------------------------------------------------- 1 | # General codegen error 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E072.md: -------------------------------------------------------------------------------- 1 | # Missing function 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E073.md: -------------------------------------------------------------------------------- 1 | # Missing compare function 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E074.md: -------------------------------------------------------------------------------- 1 | # Cannot generate string literal 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E075.md: -------------------------------------------------------------------------------- 1 | # Initial values were not generated 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E076.md: -------------------------------------------------------------------------------- 1 | # General debug error 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E077.md: -------------------------------------------------------------------------------- 1 | # Generic linker error 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E078.md: -------------------------------------------------------------------------------- 1 | # Duplicate case condition 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E079.md: -------------------------------------------------------------------------------- 1 | # Case condition outside of a case statement 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E080.md: -------------------------------------------------------------------------------- 1 | # Invalid case condition 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E081.md: -------------------------------------------------------------------------------- 1 | # Empty control statement 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E082.md: -------------------------------------------------------------------------------- 1 | # Undefined node 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E083.md: -------------------------------------------------------------------------------- 1 | # Unexpected node 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E084.md: -------------------------------------------------------------------------------- 1 | # Unconnected source 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E085.md: -------------------------------------------------------------------------------- 1 | # Cyclic connection 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E086.md: -------------------------------------------------------------------------------- 1 | # No associated connector 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E087.md: -------------------------------------------------------------------------------- 1 | # Unnamed control 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E088.md: -------------------------------------------------------------------------------- 1 | # Invalid PLC Json file 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E089.md: -------------------------------------------------------------------------------- 1 | # Invalid Call parameters -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E090.md: -------------------------------------------------------------------------------- 1 | # Incompatible reference assingment 2 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E091.md: -------------------------------------------------------------------------------- 1 | # Unsafe Enum Assignment 2 | 3 | At runtime there is no way to guarantee that a non-const reference will not change its value to something out-of-bounds for enums. For example consider the following 4 | ```iecst 5 | PROGRAM main 6 | VAR 7 | zero : DINT := 0; 8 | color : (red := 0, green := 1, blue := 2); 9 | END_VAR 10 | 11 | zero := 10; 12 | color := zero; // Invalid because `color` accepts values from 0 to 2, but we assigned 10 to it 13 | END_PROGRAM 14 | ``` 15 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E093.md: -------------------------------------------------------------------------------- 1 | # Return Value Of Void Functions 2 | 3 | Functions of type VOID can not have an explicit return value, e.g. `foo := 1` in the following example is invalid. 4 | 5 | ```iecstd 6 | FUNCTION foo 7 | foo := 1; 8 | END_FUNCTION 9 | ``` 10 | 11 | Choose a type for your function, if a value must be returned. 12 | -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E095.md: -------------------------------------------------------------------------------- 1 | # Action call without parentheses -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E096.md: -------------------------------------------------------------------------------- 1 | # Integer Condition 2 | 3 | This error is generated because an integer was used in a `IF` or `WHILE` statement, when a boolean was expected. 4 | 5 | See also `plc explain E094` -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E097.md: -------------------------------------------------------------------------------- 1 | # Invalid Array Range 2 | 3 | Ranges such as `ARRAY [0..-1]` are invalid in ST because end values of ranges must be greater than their start values. 4 | A valid range for the given statement would have been `ARRAY[-1..0]`. -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E099.md: -------------------------------------------------------------------------------- 1 | # Invalid `REFERENCE TO` declaration 2 | 3 | `REFERENCE TO` variable declarations are considered valid if the referenced type is not of the following form 4 | * `foo : REFERENCE TO REFERENCE TO (* ... *)` 5 | * `foo : ARRAY[...] OF REFERENCE TO (* ... *)` 6 | * `foo : REF_TO REFERENCE TO (* ... *)` -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E100.md: -------------------------------------------------------------------------------- 1 | # Immutable Variable Address 2 | 3 | Alias variables are immutable with regards to their pointer address, thus re-assigning an address will return an error. For example the following code will not compile 4 | ```iecst 5 | FUNCTION main 6 | VAR 7 | foo AT bar : DINT; 8 | bar : DINT; 9 | baz : DINT; 10 | END_VAR 11 | 12 | foo := baz; // Valid, because we are changing the pointers dereferenced value 13 | foo REF= baz; // Invalid, `foo` is immutable with regards to it's pointer address 14 | END_FUNCTION 15 | ``` -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E104.md: -------------------------------------------------------------------------------- 1 | # Config Variable With Incomplete Address 2 | 3 | Variables defined in a `VAR_CONFIG` block, i.e. config variables, must specify a complete address. 4 | 5 | Erroneous code example: 6 | ```iecst 7 | VAR_CONFIG 8 | main.foo.bar AT %I* : BOOL; 9 | END_VAR 10 | ``` 11 | 12 | In this example `main.foo.bar` has specified a placeholder hardware address. 13 | For the example to be considered valid, a specific address such as `%IX1.0` should have been declared. -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E105.md: -------------------------------------------------------------------------------- 1 | # CONSTANT keyword in POU 2 | 3 | The `CONSTANT` keyword is not allowed for POU declarations, only variables can be `CONSTANT` 4 | 5 | Erroneous code example: 6 | ```iecst 7 | FUNCTION FOO : BOOL CONSTANT 8 | VAR_INPUT 9 | END_VAR 10 | // ... 11 | END_FUNCTION 12 | ``` -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E109.md: -------------------------------------------------------------------------------- 1 | # Stateful member variable initialized with temporary reference 2 | 3 | Stack-local variables do not yet exist at the time of initialization. Additionally, pointing to a temporary variable will lead to a dangling pointer 4 | as soon as it goes out of scope - potential use after free. 5 | 6 | Erroneous code example: 7 | ```iecst 8 | FUNCTION_BLOCK foo 9 | VAR 10 | a : REF_TO BOOL := REF(b); 11 | END_VAR 12 | VAR_TEMP 13 | b : BOOL; 14 | END_VAR 15 | END_FUNCTION_BLOCK 16 | ``` -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E110.md: -------------------------------------------------------------------------------- 1 | # Invalid POU Type for Inheritance 2 | 3 | Base Classes and Interfaces can only be used on `CLASS`es and `FUNCTION_BLOCK`s, any other POU type is invalid and will 4 | result in this error. 5 | 6 | Errouneus code example: 7 | ```iecst 8 | INTERFACE interfaceA 9 | /* ... */ 10 | END_INTERFACE 11 | 12 | FUNCTION_BLOCK fb 13 | END_FUNCTION_BLOCK 14 | 15 | FUNCTION foo EXTENDS fb IMPLEMENTS interfaceA 16 | /* ... */ 17 | END_FUNCTION_BLOCK 18 | ``` 19 | In the example above, the POU type of `foo` should have been `CLASS` or `FUNCTION_BLOCK`. -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E113.md: -------------------------------------------------------------------------------- 1 | # Interface default method implementation 2 | 3 | Methods defined in interfaces must not have an implementation. While the compiler parses them, they are not 4 | used to validate and/or generate code and thus will have no effect. This may change in the future but as of 5 | now is not supported. 6 | 7 | Erreneous code example: 8 | ```iecst 9 | INTERFACE interfaceA 10 | METHOD methodA : INT 11 | methodA := 5; // This counts as a default implementation and hence will return a warning 12 | END_METHOD 13 | END_INTERFACE 14 | ``` -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E114.md: -------------------------------------------------------------------------------- 1 | # Cannot extend a POU multiple times 2 | 3 | Multiple `EXTENDS` keywords are not allowed 4 | 5 | Erreneous code example: 6 | ```iecst 7 | FUNCTION_BLOCK foo EXTENDS bar EXTENDS baz 8 | // ... 9 | END_FUNCTION_BLOCK 10 | ``` -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E115.md: -------------------------------------------------------------------------------- 1 | # Property defined in non-stateful POU type 2 | 3 | Properties may only be defined in stateful POUs such as a `PROGRAM`,`CLASS` or `FUNCTION_BLOCK`. 4 | 5 | Errouneus code example: 6 | ``` 7 | FUNCTION foo 8 | // Invalid definition 9 | PROPERTY bar : DINT 10 | GET 11 | bar := 42; 12 | END_GET 13 | END_PROPERTY 14 | END_FUNCTION -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E116.md: -------------------------------------------------------------------------------- 1 | # Property defined in unsupported variable block 2 | 3 | Properties only allow for variable blocks of type `VAR`. 4 | 5 | Errouneus code example: 6 | ``` 7 | FUNCTION foo 8 | PROPERTY bar : DINT 9 | GET 10 | VAR /* ... */ END_VAR 11 | VAR_INPUT /* ... */ END_VAR // Invalid 12 | END_GET 13 | END_PROPERTY 14 | END_FUNCTION 15 | ``` -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/diagnostics/error_codes/E118.md: -------------------------------------------------------------------------------- 1 | # Signature mismatch 2 | 3 | This error is generally a follow-up error to "E112" to give more detailed information about why the error occured. Please use `plc explain E112` get more information about the general causes of these errors. -------------------------------------------------------------------------------- /compiler/plc_diagnostics/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! This crates handles diagnostics, from creation to reporting. 2 | 3 | pub mod diagnostician; 4 | pub mod diagnostics; 5 | pub mod reporter; 6 | -------------------------------------------------------------------------------- /compiler/plc_driver/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | 3 | fn main() { 4 | //Initialize the logging 5 | env_logger::init(); 6 | let args: Vec = env::args().collect(); 7 | if let Err(e) = plc_driver::compile(&args) { 8 | eprintln!("{e}"); 9 | std::process::exit(1) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__calling_external_file_function_without_including_file_results_in_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_driver/./src/tests/external_files.rs 3 | expression: msg.to_string() 4 | --- 5 | cannot generate call statement for ReferenceExpr { kind: Member(Identifier { name: "external" }), base: None } at: external_file.st:2:8:{2:8-2:16}: 6 | -------------------------------------------------------------------------------- /compiler/plc_index/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plc_index" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | plc_ast = { path = "../plc_ast" } 10 | plc_source = { path = "../plc_source" } 11 | plc_diagnostics = { path = "../plc_diagnostics" } 12 | #plc_project = { path = "../plc_project" } # TODO: This will create a circular dependency 13 | rustc-hash.workspace = true 14 | annotate-snippets = "0.11.5" 15 | 16 | encoding_rs = "0.8" 17 | -------------------------------------------------------------------------------- /compiler/plc_lowering/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plc_lowering" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | plc = { path = "../..", package = "rusty" } 8 | plc_ast = { path = "../plc_ast" } 9 | plc_source = { path = "../plc_source" } 10 | log.workspace = true 11 | 12 | [dev-dependencies] 13 | plc_driver = { path = "../plc_driver" } 14 | insta = "1.31.0" -------------------------------------------------------------------------------- /compiler/plc_lowering/src/tests.rs: -------------------------------------------------------------------------------- 1 | mod inheritance_tests; 2 | mod super_tests; 3 | -------------------------------------------------------------------------------- /compiler/plc_project/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! This crate discribes the project management aspect of the build 2 | //! It handles the creation of a `Project` by either parsing the `build_config` or from parameters 3 | //! This crate is also responsible for `SourceCode`, that is how a source code is read from disk 4 | //! and handled 5 | mod build_config; 6 | pub mod object; 7 | pub mod project; 8 | -------------------------------------------------------------------------------- /compiler/plc_project/src/snapshots/plc_project__build_config__tests__json_with_additional_fields_reports_unexpected_fields.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_project/src/build_config.rs 3 | expression: diag.to_string() 4 | --- 5 | unknown field `additional_field`, expected one of `name`, `files`, `compile_type`, `output`, `libraries`, `package_commands`, `version`, `format-version`, `format_version` at: :9:27:{9:27-9:215}: 6 | -------------------------------------------------------------------------------- /compiler/plc_project/src/snapshots/plc_project__build_config__tests__json_with_empty_files_array_reports_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_project/src/build_config.rs 3 | expression: diag.to_string() 4 | --- 5 | plc.json could not be validated due to the following errors: 6 | files[] has less than 1 item 7 | 8 | -------------------------------------------------------------------------------- /compiler/plc_project/src/snapshots/plc_project__build_config__tests__json_with_invalid_enum_variants_reports_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_project/src/build_config.rs 3 | expression: diag.to_string() 4 | --- 5 | unknown variant `Interpreted`, expected one of `Object`, `Static`, `PIC`, `Shared`, `NoPIC`, `Relocatable`, `Bitcode`, `IR` at: :7:38:{7:38-7:168}: 6 | -------------------------------------------------------------------------------- /compiler/plc_project/src/snapshots/plc_project__build_config__tests__json_with_missing_required_properties_reports_error-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_project/src/build_config.rs 3 | expression: diag.to_string() 4 | --- 5 | missing field `path` at: :16:13:{16:13-16:391}: 6 | -------------------------------------------------------------------------------- /compiler/plc_project/src/snapshots/plc_project__build_config__tests__json_with_missing_required_properties_reports_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_project/src/build_config.rs 3 | expression: diag.to_string() 4 | --- 5 | missing field `name` at: :6:9:{6:9-6:100}: 6 | -------------------------------------------------------------------------------- /compiler/plc_project/src/snapshots/plc_project__build_config__tests__json_with_optional_properties_is_valid.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_project/src/build_config.rs 3 | expression: "&format!(\"{:#?}\", cfg)" 4 | --- 5 | ProjectConfig { 6 | name: "MyProject", 7 | files: [ 8 | "file.st", 9 | ], 10 | compile_type: Shared, 11 | output: Some( 12 | "proj.so", 13 | ), 14 | libraries: [], 15 | package_commands: [], 16 | version: Some( 17 | "0.1", 18 | ), 19 | format_version: Some( 20 | "0.2", 21 | ), 22 | } 23 | -------------------------------------------------------------------------------- /compiler/plc_source/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plc_source" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | encoding_rs.workspace = true 10 | encoding_rs_io.workspace = true 11 | 12 | [dev-dependencies] 13 | insta = "1.31.0" 14 | 15 | [lib] 16 | name = "plc_source" 17 | path = "./src/lib.rs" 18 | -------------------------------------------------------------------------------- /compiler/plc_source/src/snapshots/plc_source__source_location__tests__span_id_and_range.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_source/./src/source_location.rs 3 | expression: loc1.span(&loc2) 4 | --- 5 | SourceLocation { 6 | span: Block { 7 | local_id: 1, 8 | execution_order: Some( 9 | 1, 10 | ), 11 | inner_range: Some( 12 | 0..4, 13 | ), 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /compiler/plc_source/src/snapshots/plc_source__source_location__tests__span_none.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_source/./src/source_location.rs 3 | expression: loc1.span(&loc2) 4 | --- 5 | SourceLocation { 6 | span: None, 7 | } 8 | -------------------------------------------------------------------------------- /compiler/plc_source/src/snapshots/plc_source__source_location__tests__span_two_blocks_with_same_id.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_source/./src/source_location.rs 3 | expression: loc1.span(&loc2) 4 | --- 5 | SourceLocation { 6 | span: Block { 7 | local_id: 1, 8 | execution_order: Some( 9 | 1, 10 | ), 11 | inner_range: None, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /compiler/plc_source/src/snapshots/plc_source__source_location__tests__span_two_ranges.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_source/src/source_location.rs 3 | expression: loc1.span(&loc2) 4 | --- 5 | SourceLocation { 6 | span: Range(1:0 - 5:30), 7 | } 8 | -------------------------------------------------------------------------------- /compiler/plc_util/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "plc_util" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /compiler/plc_xml/README.md: -------------------------------------------------------------------------------- 1 | # plc_xml 2 | 3 | This crate contains the CFC implementation of RuSTy, for more information refer to the [book](https://plc-lang.github.io/rusty/cfc/cfc.html). 4 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/lib.rs: -------------------------------------------------------------------------------- 1 | // TODO: Remove 2 | #![allow(dead_code)] 3 | 4 | pub mod error; 5 | mod extensions; 6 | pub mod xml_parser; 7 | pub(crate) mod model { 8 | pub mod action; 9 | pub mod block; 10 | pub mod body; 11 | pub mod connector; 12 | pub mod control; 13 | pub mod fbd; 14 | pub mod interface; 15 | pub mod pou; 16 | pub mod project; 17 | pub mod variables; 18 | } 19 | mod reader; 20 | pub mod serializer; 21 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/model/snapshots/plc_xml__model__body__tests__empty.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/model/body.rs 3 | expression: "Body::visit(&mut reader, None).unwrap()" 4 | --- 5 | Body { 6 | function_block_diagram: FunctionBlockDiagram { 7 | nodes: {}, 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/model/snapshots/plc_xml__model__pou__tests__poutype_function.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/model/pou.rs 3 | expression: "Pou::visit(&mut reader, tag)" 4 | --- 5 | Ok( 6 | Pou { 7 | name: "foo", 8 | pou_type: Function, 9 | body: Body { 10 | function_block_diagram: FunctionBlockDiagram { 11 | nodes: {}, 12 | }, 13 | }, 14 | actions: [], 15 | interface: Some( 16 | Interface { 17 | add_data: None, 18 | }, 19 | ), 20 | }, 21 | ) 22 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/model/snapshots/plc_xml__model__pou__tests__poutype_function_block.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/model/pou.rs 3 | expression: "Pou::visit(&mut reader, tag)" 4 | --- 5 | Ok( 6 | Pou { 7 | name: "foo", 8 | pou_type: FunctionBlock, 9 | body: Body { 10 | function_block_diagram: FunctionBlockDiagram { 11 | nodes: {}, 12 | }, 13 | }, 14 | actions: [], 15 | interface: Some( 16 | Interface { 17 | add_data: None, 18 | }, 19 | ), 20 | }, 21 | ) 22 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/model/snapshots/plc_xml__model__pou__tests__poutype_program.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/model/pou.rs 3 | expression: "Pou::visit(&mut reader, tag)" 4 | --- 5 | Ok( 6 | Pou { 7 | name: "foo", 8 | pou_type: Program, 9 | body: Body { 10 | function_block_diagram: FunctionBlockDiagram { 11 | nodes: {}, 12 | }, 13 | }, 14 | actions: [], 15 | interface: Some( 16 | Interface { 17 | add_data: None, 18 | }, 19 | ), 20 | }, 21 | ) 22 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/model/snapshots/plc_xml__model__variables__tests__block_inout_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/model/variables.rs 3 | expression: "BlockVariable::visit(&mut reader)" 4 | --- 5 | Ok( 6 | [ 7 | BlockVariable { 8 | kind: InOut, 9 | formal_parameter: "", 10 | negated: false, 11 | ref_local_id: None, 12 | edge: None, 13 | storage: None, 14 | enable: None, 15 | }, 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/model/snapshots/plc_xml__model__variables__tests__block_input_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/model/variables.rs 3 | expression: "BlockVariable::visit(&mut reader)" 4 | --- 5 | Ok( 6 | [ 7 | BlockVariable { 8 | kind: Input, 9 | formal_parameter: "", 10 | negated: false, 11 | ref_local_id: None, 12 | edge: None, 13 | storage: None, 14 | enable: None, 15 | }, 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/model/snapshots/plc_xml__model__variables__tests__block_output_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/model/variables.rs 3 | expression: "BlockVariable::visit(&mut reader)" 4 | --- 5 | Ok( 6 | [ 7 | BlockVariable { 8 | kind: Output, 9 | formal_parameter: "", 10 | negated: false, 11 | ref_local_id: None, 12 | edge: None, 13 | storage: None, 14 | enable: None, 15 | }, 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/model/snapshots/plc_xml__model__variables__tests__fbd_in_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/model/variables.rs 3 | expression: "FunctionBlockVariable::visit(&mut reader)" 4 | --- 5 | Ok( 6 | FunctionBlockVariable { 7 | kind: Input, 8 | local_id: 0, 9 | negated: false, 10 | expression: "a", 11 | execution_order_id: None, 12 | ref_local_id: None, 13 | }, 14 | ) 15 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/model/snapshots/plc_xml__model__variables__tests__fbd_out_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/model/variables.rs 3 | expression: "FunctionBlockVariable::visit(&mut reader)" 4 | --- 5 | Ok( 6 | FunctionBlockVariable { 7 | kind: Output, 8 | local_id: 0, 9 | negated: false, 10 | expression: "a", 11 | execution_order_id: None, 12 | ref_local_id: None, 13 | }, 14 | ) 15 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__control__tests__label_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/control.rs 3 | expression: "Control::visit(reader).unwrap()" 4 | --- 5 | Control { 6 | kind: Label, 7 | name: None, 8 | local_id: 1, 9 | ref_local_id: None, 10 | execution_order_id: Some( 11 | 2, 12 | ), 13 | negated: false, 14 | } 15 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__control__tests__simple_negated_return.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/control.rs 3 | expression: "Control::visit(reader).unwrap()" 4 | --- 5 | Control { 6 | kind: Return, 7 | name: None, 8 | local_id: 1, 9 | ref_local_id: Some( 10 | 3, 11 | ), 12 | execution_order_id: Some( 13 | 2, 14 | ), 15 | negated: true, 16 | } 17 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__control__tests__simple_return.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/control.rs 3 | expression: "Control::visit(reader).unwrap()" 4 | --- 5 | Control { 6 | kind: Return, 7 | name: None, 8 | local_id: 1, 9 | ref_local_id: Some( 10 | 3, 11 | ), 12 | execution_order_id: Some( 13 | 2, 14 | ), 15 | negated: false, 16 | } 17 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__control__tests__unconnected_jump_to_label.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/control.rs 3 | expression: "Control::visit(reader).unwrap()" 4 | --- 5 | Control { 6 | kind: Jump, 7 | name: None, 8 | local_id: 1, 9 | ref_local_id: None, 10 | execution_order_id: Some( 11 | 2, 12 | ), 13 | negated: false, 14 | } 15 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__tests__ast_generates_locations-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/tests.rs 3 | expression: right.get_location() 4 | --- 5 | SourceLocation { 6 | span: Block { 7 | local_id: 1, 8 | execution_order: None, 9 | inner_range: Some( 10 | 0..1, 11 | ), 12 | }, 13 | file: Some( 14 | ".cfc", 15 | ), 16 | } 17 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__tests__ast_generates_locations-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/tests.rs 3 | expression: location 4 | --- 5 | SourceLocation { 6 | span: Block { 7 | local_id: 3, 8 | execution_order: Some( 9 | 1, 10 | ), 11 | inner_range: None, 12 | }, 13 | file: Some( 14 | ".cfc", 15 | ), 16 | } 17 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__tests__ast_generates_locations-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/tests.rs 3 | expression: operator.get_location() 4 | --- 5 | SourceLocation { 6 | span: Block { 7 | local_id: 3, 8 | execution_order: Some( 9 | 1, 10 | ), 11 | inner_range: None, 12 | }, 13 | file: Some( 14 | ".cfc", 15 | ), 16 | } 17 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__tests__ast_generates_locations-5.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/tests.rs 3 | expression: param.get_location() 4 | --- 5 | SourceLocation { 6 | span: Block { 7 | local_id: 4, 8 | execution_order: None, 9 | inner_range: Some( 10 | 0..1, 11 | ), 12 | }, 13 | file: Some( 14 | ".cfc", 15 | ), 16 | } 17 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__tests__ast_generates_locations-6.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/tests.rs 3 | expression: param.get_location() 4 | --- 5 | SourceLocation { 6 | span: Block { 7 | local_id: 5, 8 | execution_order: None, 9 | inner_range: Some( 10 | 0..1, 11 | ), 12 | }, 13 | file: Some( 14 | ".cfc", 15 | ), 16 | } 17 | -------------------------------------------------------------------------------- /compiler/plc_xml/src/xml_parser/snapshots/plc_xml__xml_parser__tests__ast_generates_locations.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: compiler/plc_xml/src/xml_parser/tests.rs 3 | expression: left.get_location() 4 | --- 5 | SourceLocation { 6 | span: Block { 7 | local_id: 2, 8 | execution_order: Some( 9 | 0, 10 | ), 11 | inner_range: Some( 12 | 0..1, 13 | ), 14 | }, 15 | file: Some( 16 | ".cfc", 17 | ), 18 | } 19 | -------------------------------------------------------------------------------- /compiler/section_mangler/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "section_mangler" 3 | version = "0.0.1" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | nom = "7.1" 8 | -------------------------------------------------------------------------------- /errorcode_book_generator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "errorcode_book_generator" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | clap = "4.5.4" 10 | mdbook = "0.4.37" 11 | semver = "1.0.22" 12 | serde_json.workspace = true 13 | toml.workspace = true 14 | -------------------------------------------------------------------------------- /examples/ExternalFunctions.st: -------------------------------------------------------------------------------- 1 | @EXTERNAL FUNCTION LOG : DINT 2 | VAR_INPUT 3 | x : DINT; 4 | END_VAR 5 | END_FUNCTION 6 | 7 | @EXTERNAL FUNCTION PRINTF : DINT 8 | VAR_INPUT 9 | text : STRING; 10 | value : DINT; 11 | END_VAR 12 | END_FUNCTION 13 | 14 | 15 | FUNCTION main : DINT 16 | main := LOG(100); 17 | PRINTF('Log value %d\n', main); 18 | END_FUNCTION 19 | -------------------------------------------------------------------------------- /examples/actions.st: -------------------------------------------------------------------------------- 1 | PROGRAM main 2 | VAR 3 | a,b : DINT; 4 | END_VAR 5 | 6 | action1(); 7 | action2(); 8 | 9 | END_PROGRAM 10 | 11 | ACTIONS 12 | ACTION action1 13 | a := a + 1; 14 | END_ACTION 15 | ACTION action2 16 | b := b + 2; 17 | END_ACTION 18 | END_ACTIONS 19 | -------------------------------------------------------------------------------- /examples/class_method.st: -------------------------------------------------------------------------------- 1 | CLASS MyClass 2 | VAR 3 | x, y : INT; 4 | END_VAR 5 | 6 | METHOD testMethod 7 | VAR_INPUT myMethodArg : INT; END_VAR 8 | VAR myMethodLocalVar : INT; END_VAR 9 | 10 | x := myMethodArg; 11 | END_METHOD 12 | END_CLASS 13 | -------------------------------------------------------------------------------- /examples/function_with_return.st: -------------------------------------------------------------------------------- 1 | FUNCTION smaller_than_ten: BOOL 2 | VAR_INPUT 3 | n : INT; 4 | END_VAR 5 | 6 | IF n < 10 THEN 7 | smaller_than_ten := TRUE; 8 | RETURN; 9 | END_IF; 10 | smaller_than_ten := FALSE; 11 | END_FUNCTION 12 | -------------------------------------------------------------------------------- /examples/hello_world.st: -------------------------------------------------------------------------------- 1 | {external} 2 | FUNCTION puts : DINT 3 | VAR_INPUT {ref} 4 | text : STRING; 5 | END_VAR 6 | END_FUNCTION 7 | 8 | FUNCTION main : DINT 9 | puts('hello, world!$N'); 10 | END_FUNCTION 11 | -------------------------------------------------------------------------------- /examples/lt.st: -------------------------------------------------------------------------------- 1 | FUNCTION a : DINT END_FUNCTION 2 | PROGRAM main 3 | VAR 4 | x : ARRAY[0..1] OF INT; 5 | y : REF_TO INT; 6 | z : REF_TO ARRAY[0..1] OF INT; 7 | END_VAR 8 | x[0] := 1; 9 | y^ := 2; 10 | y^.1 := 3; 11 | z^[0] := 4; 12 | z^[1].1 := 5; 13 | a() := 5; 14 | END_PROGRAM 15 | -------------------------------------------------------------------------------- /examples/math_st.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | typedef struct LOG_interface { 5 | int x; 6 | } LOG_interface; 7 | 8 | typedef struct PRINT_interface { 9 | char text[81]; 10 | int value; 11 | } PRINT_interface; 12 | 13 | int LOG(LOG_interface* param) { 14 | printf("Calling log with %d\n", param->x); 15 | int res = (int) log10(param->x); 16 | printf("result : %d\n", res); 17 | return res; 18 | } 19 | 20 | int PRINTF(PRINT_interface* param) { 21 | return printf(param->text, param->value); 22 | } 23 | -------------------------------------------------------------------------------- /examples/pointer.st: -------------------------------------------------------------------------------- 1 | TYPE MyStruct: STRUCT x: DINT; y: DINT; END_STRUCT END_TYPE 2 | 3 | FUNCTION main : DINT 4 | main := foo(); 5 | END_FUNCTION 6 | 7 | FUNCTION foo : DINT 8 | VAR 9 | x : DINT; 10 | s : MyStruct; 11 | u,y : REF_TO DINT; 12 | z : REF_TO REF_TO DINT; 13 | END_VAR 14 | 15 | u := NULL; 16 | u := &s.x; 17 | y := u; 18 | z := &y; 19 | s.x := 9; 20 | z^^ := y^*2; 21 | y^ := z^^*2; 22 | 23 | foo := y^; 24 | END_FUNCTION 25 | -------------------------------------------------------------------------------- /examples/program_with_expressions.st: -------------------------------------------------------------------------------- 1 | PROGRAM name 2 | (1 + 2) * (3 + 4); 3 | END_PROGRAM 4 | -------------------------------------------------------------------------------- /examples/program_with_references.st: -------------------------------------------------------------------------------- 1 | PROGRAM exp a AND NOT b OR c XOR d; END_PROGRAM 2 | -------------------------------------------------------------------------------- /examples/program_with_variable_and_operation.st: -------------------------------------------------------------------------------- 1 | PROGRAM hello 2 | VAR 3 | x : INT; 4 | y : INT; 5 | z : INT; 6 | END_VAR 7 | 8 | 9 | IF Condition THEN 10 | 11 | ELSIF 12 | 13 | END_IF; 14 | 15 | 1 + 2 + 3 + 4; 16 | END_PROGRAM 17 | -------------------------------------------------------------------------------- /examples/program_with_variables.st: -------------------------------------------------------------------------------- 1 | PROGRAM hello 2 | VAR 3 | x : INT 4 | y : BOOL; 5 | END_VAR 6 | IF x = 2 THEN 7 | x := 3 8 | END_PROGRAM 9 | -------------------------------------------------------------------------------- /examples/simple_program.st: -------------------------------------------------------------------------------- 1 | PROGRAM prg 2 | VAR 3 | a : INT; 4 | b : REAL; 5 | END_VAR 6 | 7 | b := 1.5; 8 | a := b; 9 | END_PROGRAM 10 | -------------------------------------------------------------------------------- /examples/while_loop_with_continue.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | main := 1; 3 | WHILE main < 10 DO 4 | main := main + 1; 5 | CONTINUE; 6 | main := 200; 7 | END_WHILE 8 | END_FUNCTION 9 | -------------------------------------------------------------------------------- /libs/stdlib/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | jobs = 4 #Limit t 4 jobs as the tests are sometimes taking up all system resources 3 | -------------------------------------------------------------------------------- /libs/stdlib/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /target-watch 3 | /.idea 4 | **/*.rs.bk 5 | **/*.un~ 6 | **/*.toml~ 7 | *.ll 8 | *.o 9 | *.bc 10 | *.a 11 | *.elf 12 | -------------------------------------------------------------------------------- /libs/stdlib/iec61131-st/README.md: -------------------------------------------------------------------------------- 1 | # IEC61131-3 Standard Libs 2 | ST definitions of the IEC61131 standard libraries 3 | 4 | Depends on the core module for OS specific implementation 5 | -------------------------------------------------------------------------------- /libs/stdlib/iec61131-st/real_trunc_int.py: -------------------------------------------------------------------------------- 1 | f = open("real_trunc_int.st", "w") 2 | 3 | types_real = ["REAL", "LREAL"] 4 | types_int = ["SINT", "USINT", "INT", "UINT", "DINT", "UDINT", "LINT", "ULINT"] 5 | 6 | template = """ 7 | (******************** 8 | * 9 | * Converts {0} to {1} 10 | * 11 | ********************) 12 | FUNCTION {0}_TRUNC_{1} : {1} 13 | VAR_INPUT 14 | in : {0}; 15 | END_VAR 16 | 17 | {0}_TRUNC_{1} := in; 18 | END_FUNCTION 19 | """ 20 | 21 | for real in types_real: 22 | for int in types_int: 23 | f.write(template.format(real, int)) 24 | f.write("\n") -------------------------------------------------------------------------------- /libs/stdlib/src/numerical_functions.rs: -------------------------------------------------------------------------------- 1 | /// . 2 | /// Rounds a REAL (f32) value 3 | /// 4 | #[allow(non_snake_case)] 5 | #[no_mangle] 6 | pub extern "C" fn ROUND__REAL(input: f32) -> f32 { 7 | input.round() 8 | } 9 | 10 | /// . 11 | /// Rounds a LREAL (f64) value 12 | /// 13 | #[allow(non_snake_case)] 14 | #[no_mangle] 15 | pub extern "C" fn ROUND__LREAL(input: f64) -> f64 { 16 | input.round() 17 | } 18 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 110 2 | use_small_heuristics = "Max" 3 | -------------------------------------------------------------------------------- /scripts/cargo_watch.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/bash 3 | 4 | if [ ! -z "$1" ] && [ $1 == '--container' ] 5 | then 6 | cargo watch -x 'test --target-dir /tmp/target' 7 | else 8 | cargo watch -x test 9 | fi 10 | -------------------------------------------------------------------------------- /scripts/data/offline.toml: -------------------------------------------------------------------------------- 1 | [source.crates-io] 2 | replace-with = "vendored-sources" 3 | 4 | [source."https://github.com/TheDan64/inkwell"] 5 | git = "https://github.com/TheDan64/inkwell" 6 | branch = "master" 7 | replace-with = "vendored-sources" 8 | 9 | [source.vendored-sources] 10 | directory = "../3rd-party" 11 | -------------------------------------------------------------------------------- /src/codegen/generators.rs: -------------------------------------------------------------------------------- 1 | pub mod data_type_generator; 2 | pub mod expression_generator; 3 | pub mod llvm; 4 | pub mod pou_generator; 5 | pub mod section_names; 6 | pub mod statement_generator; 7 | pub mod variable_generator; 8 | 9 | // See 10 | // - https://llvm.org/docs/LangRef.html#data-layout 11 | // - https://llvm.org/doxygen/NVPTXBaseInfo_8h_source.html 12 | pub const ADDRESS_SPACE_GENERIC: u16 = 0; 13 | pub const ADDRESS_SPACE_GLOBAL: u16 = 1; 14 | pub const ADDRESS_SPACE_CONST: u16 = 4; 15 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test.rs: -------------------------------------------------------------------------------- 1 | mod complex_initializers; 2 | mod global_initializers; 3 | mod pou_initializers; 4 | mod type_initializers; 5 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/global_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @x = global i16 7 12 | @y = global i8 1 13 | @z = global float 0x400921CAC0000000 14 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__uninitialized_global_array.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/global_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @a = global [2 x i8] zeroinitializer 12 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_array_of_array_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/pou_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @a = global [2 x [2 x i8]] [[2 x i8] c"\01\02", [2 x i8] c"\03\04"] 12 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__alias_chain_with_lots_of_initializers.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @x0 = global i32 1 12 | @x1 = global i32 1 13 | @x2 = global i32 2 14 | @x3 = global i32 3 15 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 0, i16 0, i16 0] 12 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization_with_custom_init_value.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 7, i16 7, i16 7] 12 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_multi_dimension_array_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @a = global [4 x i8] c"\01\02\03\04" 12 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_type.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @x = global [3 x i16] [i16 1, i16 2, i16 3] 12 | @__MyArray__init = unnamed_addr constant [3 x i16] [i16 1, i16 2, i16 3] 13 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %MyStruct = type { i32, i32 } 12 | 13 | @a = global %MyStruct { i32 3, i32 5 } 14 | @__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer 15 | @b = global %MyStruct { i32 5, i32 3 } 16 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_sub_range_type.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @x = global i16 7 12 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_type_alias.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @x = global i16 7 12 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initialization_uses_types_default_if_not_provided.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %Point = type { i32, i32, i32 } 12 | 13 | @x = global %Point { i32 1, i32 2, i32 7 } 14 | @__Point__init = unnamed_addr constant %Point { i32 0, i32 0, i32 7 } 15 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initializer_needs_assignments.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: msg 4 | --- 5 | error[E071]: struct literal must consist of explicit assignments in the form of member := value 6 | ┌─ :9:39 7 | │ 8 | 9 │ x : Point := (x := 1, 2); 9 | │ ^ struct literal must consist of explicit assignments in the form of member := value 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initializer_uses_fallback_to_field_default.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %Point = type { i32, i32, i32 } 12 | 13 | @x = global %Point { i32 1, i32 2, i32 3 } 14 | @__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 } 15 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_with_one_field_can_be_initialized.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %MyPoint = type { i32 } 12 | 13 | @a = global %MyPoint { i32 7 } 14 | @__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer 15 | -------------------------------------------------------------------------------- /src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__type_defaults_are_used_for_uninitialized_constants.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/initialization_test/type_initializers.rs 3 | expression: result.unwrap() 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @a = unnamed_addr constant i16 7 12 | @b = unnamed_addr constant i16 21 13 | @c = unnamed_addr constant i32 2 14 | @d = unnamed_addr constant i32 30 15 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %main = type {} 12 | 13 | @gX = global i16 0 14 | @gY = global i8 0 15 | @main_instance = global %main zeroinitializer 16 | 17 | define void @main(%main* %0) { 18 | entry: 19 | ret void 20 | } 21 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type { [11 x i16] } 12 | 13 | @prg_instance = global %prg zeroinitializer 14 | 15 | define void @prg(%prg* %0) { 16 | entry: 17 | %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 18 | ret void 19 | } 20 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type { [31 x i16] } 12 | 13 | @prg_instance = global %prg zeroinitializer 14 | 15 | define void @prg(%prg* %0) { 16 | entry: 17 | %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 18 | ret void 19 | } 20 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type { [11 x i16] } 12 | 13 | @prg_instance = global %prg zeroinitializer 14 | 15 | define void @prg(%prg* %0) { 16 | entry: 17 | %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 18 | ret void 19 | } 20 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type { [11 x i16] } 12 | 13 | @prg_instance = global %prg zeroinitializer 14 | 15 | define void @prg(%prg* %0) { 16 | entry: 17 | %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 18 | ret void 19 | } 20 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__arrays_are_generated.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @x = global [10 x i16] zeroinitializer 12 | @y = global [6 x float] zeroinitializer 13 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | define i16 @foo() { 12 | entry: 13 | %foo = alloca i16, align 2 14 | store i16 0, i16* %foo, align 2 15 | %foo_ret = load i16, i16* %foo, align 2 16 | ret i16 %foo_ret 17 | } 18 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %main = type {} 12 | 13 | @main_instance = global %main zeroinitializer 14 | 15 | define void @main(%main* %0) { 16 | entry: 17 | ret void 18 | } 19 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type {} 12 | 13 | @prg_instance = global %prg zeroinitializer 14 | 15 | define void @prg(%prg* %0) { 16 | entry: 17 | ret void 18 | } 19 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_are_generated.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @x = global i32 0 12 | @MyEnum.red = unnamed_addr constant i32 0 13 | @MyEnum.yellow = unnamed_addr constant i32 1 14 | @MyEnum.green = unnamed_addr constant i32 2 15 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type {} 12 | 13 | @prg_instance = global %prg zeroinitializer 14 | 15 | declare i32 @foo() 16 | 17 | define void @prg(%prg* %0) { 18 | entry: 19 | %call = call i32 @foo() 20 | ret void 21 | } 22 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %main = type {} 12 | 13 | @gX = external global i16 14 | @gY = external global i8 15 | @main_instance = global %main zeroinitializer 16 | 17 | define void @main(%main* %0) { 18 | entry: 19 | ret void 20 | } 21 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type { i32, i32 } 12 | 13 | @prg_instance = external global %prg 14 | 15 | declare void @prg(%prg*) 16 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_enums_are_generated.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @x = global i32 0 12 | @__global_x.red = unnamed_addr constant i32 0 13 | @__global_x.yellow = unnamed_addr constant i32 1 14 | @__global_x.green = unnamed_addr constant i32 2 15 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_structs_are_generated.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %__global_x = type { i32, i32 } 12 | 13 | @x = global %__global_x zeroinitializer 14 | @____global_x__init = unnamed_addr constant %__global_x zeroinitializer 15 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type { [6 x i16] } 12 | 13 | @prg_instance = global %prg zeroinitializer 14 | 15 | define void @prg(%prg* %0) { 16 | entry: 17 | %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 18 | ret void 19 | } 20 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type { [3 x [2 x i16]] } 12 | 13 | @prg_instance = global %prg zeroinitializer 14 | 15 | define void @prg(%prg* %0) { 16 | entry: 17 | %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 18 | ret void 19 | } 20 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %main = type {} 12 | 13 | @gX = global i16 0 14 | @gY = global i8 0 15 | @gA = global i16 0 16 | @main_instance = global %main zeroinitializer 17 | 18 | define void @main(%main* %0) { 19 | entry: 20 | ret void 21 | } 22 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/code_gen_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | %prg = type { [14 x i16] } 12 | 13 | @prg_instance = global %prg zeroinitializer 14 | 15 | define void @prg(%prg* %0) { 16 | entry: 17 | %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 18 | ret void 19 | } 20 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__assigning_empty_string_literal_to_char_results_in_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: Cannot generate CHAR from empty literal 6 | ┌─ :6:14 7 | │ 8 | 6 │ x := ''; 9 | │ ^^ Cannot generate CHAR from empty literal 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__assigning_empty_string_literal_to_wide_char_results_in_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: Cannot generate WCHAR from empty literal 6 | ┌─ :6:14 7 | │ 8 | 6 │ x := ""; 9 | │ ^^ Cannot generate WCHAR from empty literal 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__assigning_string_literal_to_int_variable_results_in_casting_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E074]: Cannot generate String-Literal for type INT 6 | ┌─ :6:14 7 | │ 8 | 6 │ x := 'A'; 9 | │ ^^^ Cannot generate String-Literal for type INT 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__assigning_to_rvalue.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E050]: Expression is not assignable 6 | ┌─ :9:18 7 | │ 8 | 9 │ func(1 := 1); 9 | │ ^^^^^^ Expression is not assignable 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__continue_not_in_loop.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: Cannot continue loop when not inside a loop 6 | ┌─ :6:13 7 | │ 8 | 6 │ CONTINUE; 9 | │ ^^^^^^^^ Cannot continue loop when not inside a loop 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__exit_not_in_loop.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: Cannot break out of loop when not inside a loop 6 | ┌─ :6:13 7 | │ 8 | 6 │ EXIT; 9 | │ ^^^^ Cannot break out of loop when not inside a loop 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__invalid_array_access_in_struct_should_be_reported_with_line_number.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: Invalid array access 6 | ┌─ :13:24 7 | │ 8 | 13 │ x.a := x.b[3]; 9 | │ ^ Invalid array access 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__invalid_array_access_should_be_reported_with_line_number.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: Invalid array access 6 | ┌─ :6:15 7 | │ 8 | 6 │ x[3] := 3; 9 | │ ^ Invalid array access 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__pointer_binary_expression_adding_two_pointers.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: '+' operation must contain one int type 6 | ┌─ :8:16 7 | │ 8 | 8 │ ptr := ptr + ptr; 9 | │ ^^^^^^^^^ '+' operation must contain one int type 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__pointer_binary_expression_division.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: Operator '/' unimplemented for pointers 6 | ┌─ :8:16 7 | │ 8 | 8 │ ptr := ptr / ptr; 9 | │ ^^^^^^^^^ Operator '/' unimplemented for pointers 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__pointer_binary_expression_modulo.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: Operator 'MOD' unimplemented for pointers 6 | ┌─ :8:16 7 | │ 8 | 8 │ ptr := ptr MOD ptr; 9 | │ ^^^^^^^^^^^ Operator 'MOD' unimplemented for pointers 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__pointer_binary_expression_multiplication.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E071]: Operator '*' unimplemented for pointers 6 | ┌─ :8:16 7 | │ 8 | 8 │ ptr := ptr * ptr; 9 | │ ^^^^^^^^^ Operator '*' unimplemented for pointers 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__recursive_initial_constant_values.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: result 4 | --- 5 | error[E041]: Cannot generate literal initializer for `a`. 6 | 7 | error[E048]: Could not resolve reference to b 8 | ┌─ :3:24 9 | │ 10 | 3 │ a : INT := b; 11 | │ ^ Could not resolve reference to b 12 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__codegen_error_messages_tests__unknown_reference_should_be_reported_with_line_number.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/codegen_error_messages_tests.rs 3 | expression: msg 4 | --- 5 | error[E048]: Could not resolve reference to y 6 | ┌─ :6:18 7 | │ 8 | 6 │ x := y; 9 | │ ^ Could not resolve reference to y 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/expression_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | define i16* @func() { 12 | entry: 13 | %func = alloca i16*, align 8 14 | store i16* null, i16** %func, align 8 15 | %func_ret = load i16*, i16** %func, align 8 16 | ret i16* %func_ret 17 | } 18 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_has_no_declaration.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/generics_test.rs 3 | expression: prg 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__generate_with_invalid_casted_string_assignment.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/string_tests.rs 3 | expression: result 4 | --- 5 | error[E074]: Cannot generate String-Literal for type INT 6 | ┌─ :5:10 7 | │ 8 | 5 │ y := INT#"seven"; 9 | │ ^^^^^^^ Cannot generate String-Literal for type INT 10 | -------------------------------------------------------------------------------- /src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__simple_string_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/codegen/tests/string_tests.rs 3 | expression: result 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @str = global [21 x i8] zeroinitializer 12 | @wstr = global [21 x i16] zeroinitializer 13 | -------------------------------------------------------------------------------- /src/index/tests.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder 2 | mod builtin_tests; 3 | mod generic_tests; 4 | mod index_tests; 5 | mod instance_resolver_tests; 6 | mod interface_tests; 7 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_array_of_array-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: var_data_type 4 | --- 5 | DataTypeReference { 6 | referenced_type: "__foo_inline_array", 7 | } 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_array_of_array_of_array-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: var_data_type 4 | --- 5 | DataTypeReference { 6 | referenced_type: "__foo_inline_array", 7 | } 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_arrays-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: var_data_type 4 | --- 5 | DataTypeReference { 6 | referenced_type: "__foo_inline_array", 7 | } 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_enums.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: var_data_type 4 | --- 5 | DataTypeReference { 6 | referenced_type: "__foo_inline_enum", 7 | } 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_enums_global-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: var_data_type 4 | --- 5 | DataTypeReference { 6 | referenced_type: "__global_inline_enum", 7 | } 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: new_pointer_type 4 | --- 5 | UserTypeDeclaration { 6 | data_type: PointerType { 7 | name: Some( 8 | "__foo_inline_pointer", 9 | ), 10 | referenced_type: DataTypeReference { 11 | referenced_type: "__foo_inline_pointer_", 12 | }, 13 | auto_deref: None, 14 | }, 15 | initializer: None, 16 | scope: Some( 17 | "foo", 18 | ), 19 | } 20 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: var_data_type 4 | --- 5 | DataTypeReference { 6 | referenced_type: "__foo_inline_pointer", 7 | } 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: new_pointer_type 4 | --- 5 | UserTypeDeclaration { 6 | data_type: PointerType { 7 | name: Some( 8 | "__foo_inline_pointer_", 9 | ), 10 | referenced_type: DataTypeReference { 11 | referenced_type: "INT", 12 | }, 13 | auto_deref: None, 14 | }, 15 | initializer: None, 16 | scope: Some( 17 | "foo", 18 | ), 19 | } 20 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: var_data_type 4 | --- 5 | DataTypeReference { 6 | referenced_type: "__foo_inline_pointer", 7 | } 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: new_pointer_type 4 | --- 5 | UserTypeDeclaration { 6 | data_type: PointerType { 7 | name: Some( 8 | "__foo_inline_pointer", 9 | ), 10 | referenced_type: DataTypeReference { 11 | referenced_type: "INT", 12 | }, 13 | auto_deref: None, 14 | }, 15 | initializer: None, 16 | scope: Some( 17 | "foo", 18 | ), 19 | } 20 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_structs-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: var_data_type 4 | --- 5 | DataTypeReference { 6 | referenced_type: "__foo_inline_struct", 7 | } 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_structs.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: new_struct_type 4 | --- 5 | StructType { 6 | name: Some( 7 | "__foo_inline_struct", 8 | ), 9 | variables: [ 10 | Variable { 11 | name: "a", 12 | data_type: DataTypeReference { 13 | referenced_type: "INT", 14 | }, 15 | }, 16 | ], 17 | } 18 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_structs_global-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: var_data_type 4 | --- 5 | DataTypeReference { 6 | referenced_type: "__global_inline_struct", 7 | } 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_structs_global.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: new_struct_type 4 | --- 5 | StructType { 6 | name: Some( 7 | "__global_inline_struct", 8 | ), 9 | variables: [ 10 | Variable { 11 | name: "a", 12 | data_type: DataTypeReference { 13 | referenced_type: "INT", 14 | }, 15 | }, 16 | ], 17 | } 18 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: original 4 | --- 5 | UserTypeDeclaration { 6 | data_type: PointerType { 7 | name: Some( 8 | "pointer_to_pointer", 9 | ), 10 | referenced_type: DataTypeReference { 11 | referenced_type: "__pointer_to_pointer", 12 | }, 13 | auto_deref: None, 14 | }, 15 | initializer: None, 16 | scope: None, 17 | } 18 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/index_tests.rs 3 | expression: new_pointer_type 4 | --- 5 | UserTypeDeclaration { 6 | data_type: PointerType { 7 | name: Some( 8 | "__pointer_to_pointer", 9 | ), 10 | referenced_type: DataTypeReference { 11 | referenced_type: "INT", 12 | }, 13 | auto_deref: None, 14 | }, 15 | initializer: None, 16 | scope: None, 17 | } 18 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__instance_resolver_tests__functions_are_not_retrieved.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/instance_resolver_tests.rs 3 | assertion_line: 29 4 | expression: "index.find_instances().collect::>>()" 5 | 6 | --- 7 | [] 8 | -------------------------------------------------------------------------------- /src/index/tests/snapshots/rusty__index__tests__instance_resolver_tests__functions_blocks_are_not_retrieved.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/index/tests/instance_resolver_tests.rs 3 | assertion_line: 45 4 | expression: "index.find_instances().collect::>>()" 5 | 6 | --- 7 | [] 8 | -------------------------------------------------------------------------------- /src/lexer/tests.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder 2 | #[cfg(test)] 3 | mod lexer_tests; 4 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors.rs: -------------------------------------------------------------------------------- 1 | mod parse_error_classes_tests; 2 | mod parse_error_containers_tests; 3 | mod parse_error_literals_tests; 4 | mod parse_error_messages_test; 5 | mod parse_error_statements_tests; 6 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_classes_tests__simple_class_without_name.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_classes_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected Identifier but found END_CLASS 6 | ┌─ :1:7 7 | │ 8 | 1 │ CLASS END_CLASS 9 | │ ^^^^^^^^^ Unexpected token: expected Identifier but found END_CLASS 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__a_program_needs_to_end_with_end_program.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordEndProgram but found '' 6 | ┌─ :1:13 7 | │ 8 | 1 │ PROGRAM buz 9 | │ ^ Unexpected token: expected KeywordEndProgram but found '' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__function_return_type_with_initializer-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: pou.statements 4 | --- 5 | [ 6 | ReferenceExpr { 7 | kind: Member( 8 | Identifier { 9 | name: "a", 10 | }, 11 | ), 12 | base: None, 13 | }, 14 | ] 15 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__function_return_type_with_initializer.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: diagnostics 4 | --- 5 | warning[E016]: Return types cannot have a default value, the value will be ignored 6 | ┌─ :2:35 7 | │ 8 | 2 │ FUNCTION foo : INT := 3 9 | │ ^ Return types cannot have a default value, the value will be ignored 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__function_with_illegal_return_variable_declaration-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: pou.statements 4 | --- 5 | [ 6 | ReferenceExpr { 7 | kind: Member( 8 | Identifier { 9 | name: "a", 10 | }, 11 | ), 12 | base: None, 13 | }, 14 | ] 15 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__illegal_end_pou_keyword-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: pou.statements 4 | --- 5 | [ 6 | ReferenceExpr { 7 | kind: Member( 8 | Identifier { 9 | name: "b", 10 | }, 11 | ), 12 | base: None, 13 | }, 14 | ] 15 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__illegal_end_pou_keyword.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordEndProgram but found END_FUNCTION 6 | ┌─ :4:13 7 | │ 8 | 4 │ END_FUNCTION 9 | │ ^^^^^^^^^^^^ Unexpected token: expected KeywordEndProgram but found END_FUNCTION 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__missing_pou_name-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: pou.statements 4 | --- 5 | [ 6 | ReferenceExpr { 7 | kind: Member( 8 | Identifier { 9 | name: "a", 10 | }, 11 | ), 12 | base: None, 13 | }, 14 | ] 15 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__missing_pou_name.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected Identifier but found VAR 6 | ┌─ :3:13 7 | │ 8 | 3 │ VAR END_VAR 9 | │ ^^^ Unexpected token: expected Identifier but found VAR 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__missing_pou_name_2-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: pou.statements 4 | --- 5 | [ 6 | EmptyStatement, 7 | ReferenceExpr { 8 | kind: Member( 9 | Identifier { 10 | name: "x", 11 | }, 12 | ), 13 | base: None, 14 | }, 15 | ] 16 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__unclosed_var_container-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: var_block 4 | --- 5 | VariableBlock { 6 | variables: [ 7 | Variable { 8 | name: "a", 9 | data_type: DataTypeReference { 10 | referenced_type: "INT", 11 | }, 12 | }, 13 | ], 14 | variable_block_type: Local, 15 | } 16 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_containers_tests__unclosed_var_container.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_containers_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordEndVar but found 'VAR b : INT;' 6 | ┌─ :4:21 7 | │ 8 | 4 │ VAR b : INT; END_VAR 9 | │ ^^^^^^^^^^^^ Unexpected token: expected KeywordEndVar but found 'VAR b : INT;' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_literals_tests__illegal_literal_time_double_segments_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_literals_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E010]: Invalid TIME Literal: segments must be unique 6 | ┌─ :3:13 7 | │ 8 | 3 │ T#1d4d2h3m; 9 | │ ^^^^^^^^^^ Invalid TIME Literal: segments must be unique 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_literals_tests__illegal_literal_time_missing_segments_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_literals_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected Literal but found ; 6 | ┌─ :3:15 7 | │ 8 | 3 │ T#; 9 | │ ^ Unexpected token: expected Literal but found ; 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_literals_tests__illegal_literal_time_out_of_order_segments_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_literals_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E010]: Invalid TIME Literal: segments out of order, use d-h-m-s-ms 6 | ┌─ :3:13 7 | │ 8 | 3 │ T#1s2h3d; 9 | │ ^^^^^^^^ Invalid TIME Literal: segments out of order, use d-h-m-s-ms 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_literals_tests__literal_bin_number_with_double_underscores.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_literals_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordSemicolon but found '__001_101_01' 6 | ┌─ :1:17 7 | │ 8 | 1 │ PROGRAM exp 2#01__001_101_01; END_PROGRAM 9 | │ ^^^^^^^^^^^^ Unexpected token: expected KeywordSemicolon but found '__001_101_01' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_literals_tests__literal_dec_number_with_double_underscores.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_literals_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordSemicolon but found '__000' 6 | ┌─ :1:15 7 | │ 8 | 1 │ PROGRAM exp 43__000; END_PROGRAM 9 | │ ^^^^^ Unexpected token: expected KeywordSemicolon but found '__000' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_literals_tests__literal_hex_number_with_double_underscores.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_literals_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordSemicolon but found '__beef' 6 | ┌─ :1:20 7 | │ 8 | 1 │ PROGRAM exp 16#DEAD__beef; END_PROGRAM 9 | │ ^^^^^^ Unexpected token: expected KeywordSemicolon but found '__beef' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_literals_tests__literal_oct_number_with_double_underscores.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_literals_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordSemicolon but found '__7' 6 | ┌─ :1:16 7 | │ 8 | 1 │ PROGRAM exp 8#7__7; END_PROGRAM 9 | │ ^^^ Unexpected token: expected KeywordSemicolon but found '__7' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_literals_tests__time_literal_problems_can_be_recovered_from_during_parsing.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_literals_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E010]: Invalid TIME Literal: segments must be unique 6 | ┌─ :3:13 7 | │ 8 | 3 │ T#1d4d2h3m; 9 | │ ^^^^^^^^^^ Invalid TIME Literal: segments must be unique 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_messages_test__unclosed_body_error_message.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_messages_test.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordEndProgram but found '' 6 | ┌─ :5:5 7 | │ 8 | 5 │ 9 | │ ^ Unexpected token: expected KeywordEndProgram but found '' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_messages_test__unexpected_token_error_message.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_messages_test.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordEndVar but found ';' 6 | ┌─ :2:21 7 | │ 8 | 2 │ VAR ; 9 | │ ^ Unexpected token: expected KeywordEndVar but found ';' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_statements_tests__case_without_condition.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_statements_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected Literal but found : 6 | ┌─ :4:21 7 | │ 8 | 4 │ : x := 3; 9 | │ ^ Unexpected token: expected Literal but found : 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_statements_tests__incomplete_statement_in_parantheses_recovery_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_statements_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected Literal but found ) 6 | ┌─ :3:22 7 | │ 8 | 3 │ (1 + 2 - ) + 3; 9 | │ ^ Unexpected token: expected Literal but found ) 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_statements_tests__incomplete_statement_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_statements_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected Literal but found ; 6 | ┌─ :3:20 7 | │ 8 | 3 │ 1 + 2 +; 9 | │ ^ Unexpected token: expected Literal but found ; 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_statements_tests__invalid_variable_name_error_recovery.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_statements_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordEndVar but found '4 : INT;' 6 | ┌─ :5:17 7 | │ 8 | 5 │ 4 : INT; 9 | │ ^^^^^^^^ Unexpected token: expected KeywordEndVar but found '4 : INT;' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_statements_tests__missing_comma_in_call_parameters.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_statements_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordParensClose but found 'c' 6 | ┌─ :3:29 7 | │ 8 | 3 │ buz(a,b c); 9 | │ ^ Unexpected token: expected KeywordParensClose but found 'c' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_statements_tests__missing_semicolon_after_call-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_statements_tests.rs 3 | expression: pou.statements 4 | --- 5 | [ 6 | CallStatement { 7 | operator: ReferenceExpr { 8 | kind: Member( 9 | Identifier { 10 | name: "buz", 11 | }, 12 | ), 13 | base: None, 14 | }, 15 | parameters: None, 16 | }, 17 | ] 18 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_statements_tests__missing_semicolon_after_call.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_statements_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E007]: Unexpected token: expected KeywordSemicolon but found 'foo()' 6 | ┌─ :4:21 7 | │ 8 | 4 │ foo(); 9 | │ ^^^^^ Unexpected token: expected KeywordSemicolon but found 'foo()' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/parse_errors/snapshots/rusty__parser__tests__parse_errors__parse_error_statements_tests__while_with_missing_do.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_errors/parse_error_statements_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E006]: Missing expected Token KeywordDo 6 | ┌─ :3:17 7 | │ 8 | 3 │ y := x; 9 | │ ^ Missing expected Token KeywordDo 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__container_parser_tests__actions_with_invalid_token.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/container_parser_tests.rs 3 | expression: errors.first().unwrap() 4 | --- 5 | Diagnostic { 6 | message: "Unexpected token: expected KeywordAction but found BRAVO", 7 | primary_location: SourceLocation { 8 | span: Range(0:13 - 0:18), 9 | }, 10 | secondary_locations: None, 11 | error_code: "E007", 12 | sub_diagnostics: [], 13 | internal_error: None, 14 | } 15 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__control_parser_tests__case_statement_with_else_and_no_condition.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/control_parser_tests.rs 3 | expression: statement 4 | --- 5 | CaseStatement { 6 | selector: ReferenceExpr { 7 | kind: Member( 8 | Identifier { 9 | name: "StateMachine", 10 | }, 11 | ), 12 | base: None, 13 | }, 14 | case_blocks: [], 15 | else_block: [], 16 | } 17 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__control_parser_tests__case_statement_with_no_conditions.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/control_parser_tests.rs 3 | expression: statement 4 | --- 5 | CaseStatement { 6 | selector: ReferenceExpr { 7 | kind: Member( 8 | Identifier { 9 | name: "StateMachine", 10 | }, 11 | ), 12 | base: None, 13 | }, 14 | case_blocks: [], 15 | else_block: [], 16 | } 17 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__control_parser_tests__repeat_with_expression.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/control_parser_tests.rs 3 | expression: statement 4 | --- 5 | RepeatLoopStatement { 6 | condition: BinaryExpression { 7 | operator: Greater, 8 | left: ReferenceExpr { 9 | kind: Member( 10 | Identifier { 11 | name: "x", 12 | }, 13 | ), 14 | base: None, 15 | }, 16 | right: LiteralInteger { 17 | value: 7, 18 | }, 19 | }, 20 | body: [], 21 | } 22 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__control_parser_tests__while_with_expression.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/control_parser_tests.rs 3 | expression: statement 4 | --- 5 | WhileLoopStatement { 6 | condition: BinaryExpression { 7 | operator: Less, 8 | left: ReferenceExpr { 9 | kind: Member( 10 | Identifier { 11 | name: "x", 12 | }, 13 | ), 14 | base: None, 15 | }, 16 | right: LiteralInteger { 17 | value: 7, 18 | }, 19 | }, 20 | body: [], 21 | } 22 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__addition_ast_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | BinaryExpression { 6 | operator: Plus, 7 | left: LiteralInteger { 8 | value: 1, 9 | }, 10 | right: LiteralInteger { 11 | value: 2, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__and_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | BinaryExpression { 6 | operator: And, 7 | left: ReferenceExpr { 8 | kind: Member( 9 | Identifier { 10 | name: "b", 11 | }, 12 | ), 13 | base: None, 14 | }, 15 | right: ReferenceExpr { 16 | kind: Member( 17 | Identifier { 18 | name: "c", 19 | }, 20 | ), 21 | base: None, 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__assignment_to_null.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | Assignment { 6 | left: ReferenceExpr { 7 | kind: Member( 8 | Identifier { 9 | name: "x", 10 | }, 11 | ), 12 | base: None, 13 | }, 14 | right: LiteralNull, 15 | } 16 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__boolean_literals_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | BinaryExpression { 6 | operator: Or, 7 | left: LiteralBool { 8 | value: true, 9 | }, 10 | right: LiteralBool { 11 | value: false, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__expression_list.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | ExpressionList { 6 | expressions: [ 7 | LiteralInteger { 8 | value: 1, 9 | }, 10 | LiteralInteger { 11 | value: 2, 12 | }, 13 | LiteralInteger { 14 | value: 3, 15 | }, 16 | ], 17 | } 18 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__function_call_no_params.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | CallStatement { 6 | operator: ReferenceExpr { 7 | kind: Member( 8 | Identifier { 9 | name: "fn", 10 | }, 11 | ), 12 | base: None, 13 | }, 14 | parameters: None, 15 | } 16 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__literal_binary_with_underscore_number_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | LiteralInteger { 6 | value: 45, 7 | } 8 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__literal_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: "&prg.statements[0]" 4 | --- 5 | LiteralInteger { 6 | value: 7, 7 | } 8 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__literal_dec_number_with_underscores_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | LiteralInteger { 6 | value: 43000, 7 | } 8 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__literal_hex_number_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | LiteralInteger { 6 | value: 3735928559, 7 | } 8 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__literal_hex_number_with_underscores_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | LiteralInteger { 6 | value: 3735928559, 7 | } 8 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__literal_oct_number_with_underscore_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | LiteralInteger { 6 | value: 63, 7 | } 8 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__literal_oct_number_with_underscores_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | LiteralInteger { 6 | value: 63, 7 | } 8 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__module_expression_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | BinaryExpression { 6 | operator: Modulo, 7 | left: LiteralInteger { 8 | value: 5, 9 | }, 10 | right: LiteralInteger { 11 | value: 2, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__multiplication_ast_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | BinaryExpression { 6 | operator: Plus, 7 | left: LiteralInteger { 8 | value: 1, 9 | }, 10 | right: BinaryExpression { 11 | operator: Multiplication, 12 | left: LiteralInteger { 13 | value: 2, 14 | }, 15 | right: LiteralInteger { 16 | value: 3, 17 | }, 18 | }, 19 | } 20 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__multiplication_expressions_parse.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | BinaryExpression { 6 | operator: Division, 7 | left: BinaryExpression { 8 | operator: Multiplication, 9 | left: LiteralInteger { 10 | value: 1, 11 | }, 12 | right: LiteralInteger { 13 | value: 2, 14 | }, 15 | }, 16 | right: LiteralInteger { 17 | value: 7, 18 | }, 19 | } 20 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__pointer_dereference_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | ReferenceExpr { 6 | kind: Deref, 7 | base: Some( 8 | ReferenceExpr { 9 | kind: Member( 10 | Identifier { 11 | name: "x", 12 | }, 13 | ), 14 | base: None, 15 | }, 16 | ), 17 | } 18 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__qualified_reference_statement_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: "&prg.statements[0]" 4 | --- 5 | ReferenceExpr { 6 | kind: Member( 7 | Identifier { 8 | name: "x", 9 | }, 10 | ), 11 | base: Some( 12 | ReferenceExpr { 13 | kind: Member( 14 | Identifier { 15 | name: "a", 16 | }, 17 | ), 18 | base: None, 19 | }, 20 | ), 21 | } 22 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__signed_literal_expression_reversed_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | BinaryExpression { 6 | operator: Plus, 7 | left: LiteralInteger { 8 | value: -4, 9 | }, 10 | right: LiteralInteger { 11 | value: 5, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__signed_literal_minus_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: statement 4 | --- 5 | LiteralInteger { 6 | value: -1, 7 | } 8 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__expressions_parser_tests__single_statement_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/expressions_parser_tests.rs 3 | expression: "&prg.statements[0]" 4 | --- 5 | ReferenceExpr { 6 | kind: Member( 7 | Identifier { 8 | name: "x", 9 | }, 10 | ), 11 | base: None, 12 | } 13 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__function_parser_tests__function_inline_enum_return_unsupported.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/function_parser_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E027]: Data Type (green, yellow, red) not supported as a function return type! 6 | ┌─ :1:16 7 | │ 8 | 1 │ FUNCTION foo : (green, yellow, red) VAR_INPUT END_VAR END_FUNCTION 9 | │ ^^^^^^^^^^^^^^^^^^^^ Data Type (green, yellow, red) not supported as a function return type! 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__function_parser_tests__simple_foo_function_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/function_parser_tests.rs 3 | expression: prg.return_type.as_ref().unwrap() 4 | --- 5 | DataTypeReference { 6 | referenced_type: "INT", 7 | } 8 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__parse_generics__generic_method_parameters_are_datatypes.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_generics.rs 3 | expression: variables 4 | --- 5 | [ 6 | Variable { 7 | name: "x", 8 | data_type: DataTypeReference { 9 | referenced_type: "T", 10 | }, 11 | }, 12 | Variable { 13 | name: "y", 14 | data_type: DataTypeReference { 15 | referenced_type: "R", 16 | }, 17 | }, 18 | ] 19 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__parse_generics__generic_parameters_are_datatypes.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/parse_generics.rs 3 | expression: variables 4 | --- 5 | [ 6 | Variable { 7 | name: "x", 8 | data_type: DataTypeReference { 9 | referenced_type: "T", 10 | }, 11 | }, 12 | Variable { 13 | name: "y", 14 | data_type: DataTypeReference { 15 | referenced_type: "R", 16 | }, 17 | }, 18 | ] 19 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/type_parser_tests.rs 3 | expression: pointer_type 4 | --- 5 | Variable { 6 | name: "SamplePointer", 7 | data_type: DataTypeDefinition { 8 | data_type: PointerType { 9 | name: None, 10 | referenced_type: DataTypeReference { 11 | referenced_type: "INT", 12 | }, 13 | auto_deref: None, 14 | }, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/type_parser_tests.rs 3 | expression: diagnostics 4 | --- 5 | warning[E015]: `POINTER TO` is not a standard keyword, use `REF_TO` instead 6 | ┌─ :4:29 7 | │ 8 | 4 │ SamplePointer : POINTER TO INT; 9 | │ ^^^^^^^ `POINTER TO` is not a standard keyword, use `REF_TO` instead 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/type_parser_tests.rs 3 | expression: reference_type 4 | --- 5 | Variable { 6 | name: "SampleReference", 7 | data_type: DataTypeDefinition { 8 | data_type: PointerType { 9 | name: None, 10 | referenced_type: DataTypeReference { 11 | referenced_type: "INT", 12 | }, 13 | auto_deref: None, 14 | }, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__pointer_type_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/type_parser_tests.rs 3 | expression: "result.user_types[0]" 4 | --- 5 | UserTypeDeclaration { 6 | data_type: PointerType { 7 | name: Some( 8 | "SamplePointer", 9 | ), 10 | referenced_type: DataTypeReference { 11 | referenced_type: "INT", 12 | }, 13 | auto_deref: None, 14 | }, 15 | initializer: None, 16 | scope: None, 17 | } 18 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__ref_type_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/type_parser_tests.rs 3 | expression: "result.user_types[0]" 4 | --- 5 | UserTypeDeclaration { 6 | data_type: PointerType { 7 | name: Some( 8 | "SampleReference", 9 | ), 10 | referenced_type: DataTypeReference { 11 | referenced_type: "INT", 12 | }, 13 | auto_deref: None, 14 | }, 15 | initializer: None, 16 | scope: None, 17 | } 18 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__variable_length_array_can_be_parsed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/type_parser_tests.rs 3 | expression: x 4 | --- 5 | Variable { 6 | name: "x", 7 | data_type: DataTypeDefinition { 8 | data_type: ArrayType { 9 | name: None, 10 | bounds: VlaRangeStatement, 11 | referenced_type: DataTypeReference { 12 | referenced_type: "INT", 13 | }, 14 | is_variable_length: true, 15 | }, 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__wide_string_type_can_be_parsed_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/parser/tests/type_parser_tests.rs 3 | expression: "result.user_types[0]" 4 | --- 5 | UserTypeDeclaration { 6 | data_type: StringType { 7 | name: Some( 8 | "MyString", 9 | ), 10 | is_wide: true, 11 | size: Some( 12 | LiteralInteger { 13 | value: 253, 14 | }, 15 | ), 16 | }, 17 | initializer: None, 18 | scope: None, 19 | } 20 | -------------------------------------------------------------------------------- /src/resolver/tests.rs: -------------------------------------------------------------------------------- 1 | mod const_resolver_tests; 2 | mod lowering; 3 | mod resolve_and_lower_init_functions; 4 | mod resolve_config_variables; 5 | mod resolve_control_statments; 6 | mod resolve_declarations; 7 | mod resolve_expressions_tests; 8 | mod resolve_generic_calls; 9 | mod resolve_literals_tests; 10 | mod resolver_dependency_resolution; 11 | -------------------------------------------------------------------------------- /src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_enum_variable_default_value_compile_time_evaluation.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/resolver/tests/const_resolver_tests.rs 3 | expression: ir 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @me = unnamed_addr constant i32 3 12 | @THREE = unnamed_addr constant i16 3 13 | @MyEnum.a = unnamed_addr constant i32 3 14 | @MyEnum.b = unnamed_addr constant i32 4 15 | @MyEnum.c = unnamed_addr constant i32 5 16 | -------------------------------------------------------------------------------- /src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__default_values_are_transitive_for_range_types.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/resolver/tests/const_resolver_tests.rs 3 | expression: src 4 | snapshot_kind: text 5 | --- 6 | ; ModuleID = '' 7 | source_filename = "" 8 | target datalayout = "[filtered]" 9 | target triple = "[filtered]" 10 | 11 | @a = global i16 7 12 | @b = global i16 7 13 | @aa = unnamed_addr constant i16 7 14 | @bb = unnamed_addr constant i16 7 15 | @cc = unnamed_addr constant i16 14 16 | -------------------------------------------------------------------------------- /src/resolver/tests/snapshots/rusty__resolver__tests__resolve_generic_calls__generic_function_with_aggregate_return.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/resolver/tests/resolve_generic_calls.rs 3 | expression: annotations.get(operator).unwrap() 4 | --- 5 | Function { 6 | return_type: "__TO_STRING__WSTRING_return", 7 | qualified_name: "TO_STRING__WSTRING", 8 | generic_name: None, 9 | call_name: None, 10 | } 11 | -------------------------------------------------------------------------------- /src/tests/adr.rs: -------------------------------------------------------------------------------- 1 | /// tests for Architecture Design Records (ADR) 2 | mod annotated_ast_adr; 3 | mod arrays_adr; 4 | mod enum_adr; 5 | mod initializer_functions_adr; 6 | mod pou_adr; 7 | mod reference_expressions_adr; 8 | mod strings_adr; 9 | mod structs_adr; 10 | mod util_macros; 11 | mod vla_adr; 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__action_call_parameters_are_only_validated_outside_of_parent_pou_contexts.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/assignment_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E030]: Argument `arr` is missing 6 | ┌─ :33:13 7 | │ 8 | 33 │ fb.bar(); // INVALID - we are not in the parent context and while we use a qualified call, we don't know if the variable has been initialized 9 | │ ^^^^^^ Argument `arr` is missing 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__call_results_are_validated_for_downcasts.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/assignment_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | warning[E067]: Implicit downcast from 'DINT' to 'INT'. 6 | ┌─ :9:18 7 | │ 8 | 9 │ a := FOO(); 9 | │ ^^^^^^ Implicit downcast from 'DINT' to 'INT'. 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__constant_assignment_validation.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/assignment_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E036]: Cannot assign to CONSTANT 'v_global' 6 | ┌─ :8:5 7 | │ 8 | 8 │ v_global := TRUE; // INVALID 9 | │ ^^^^^^^^ Cannot assign to CONSTANT 'v_global' 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__modulo_operation_validates_if_the_left_hand_type_fits_into_the_target_type.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/assignment_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | warning[E067]: Implicit downcast from 'DINT' to 'INT'. 6 | ┌─ :7:23 7 | │ 8 | 7 │ a := a + (d MOD a); 9 | │ ^ Implicit downcast from 'DINT' to 'INT'. 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__bitaccess_validation_test__dwordaccess_range_test.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/bitaccess_validation_test.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E057]: DWord-Wise access for type LWORD must be in range 0..1 6 | ┌─ :6:19 7 | │ 8 | 6 │ d.%D2; 9 | │ ^^^ DWord-Wise access for type LWORD must be in range 0..1 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__enum_validation_test__enum_mismatch_error_with_many_variants_truncates_values_for_better_readability.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/enum_validation_test.rs 3 | expression: diagnostics 4 | --- 5 | error[E040]: Invalid enum value `1000` for `Color` 6 | ┌─ :7:24 7 | │ 8 | 2 │ TYPE Color : (red, green, blue, yellow, cyan, orange, purple, violet); END_TYPE 9 | │ ----- see also 10 | · 11 | 7 │ myColor := 1000; 12 | │ ^^^^ Invalid enum value `1000` for `Color` 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__generic_validation_tests__non_resolved_generics_reported.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/generic_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E064]: Could not resolve generic type T with ANY_STRING 6 | ┌─ :3:31 7 | │ 8 | 3 │ FUNCTION func : INT test(); END_FUNCTION 9 | │ ^^^^^^^ Could not resolve generic type T with ANY_STRING 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__literals_validation_tests__char_cast_validate.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/literals_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E053]: Literal "XY" out of range (CHAR) 6 | ┌─ :7:13 7 | │ 8 | 7 │ CHAR#"XY"; 9 | │ ^^^^^^^^^ Literal "XY" out of range (CHAR) 10 | 11 | error[E053]: Literal 'YZ' out of range (WCHAR) 12 | ┌─ :8:13 13 | │ 14 | 8 │ WCHAR#'YZ'; 15 | │ ^^^^^^^^^^ Literal 'YZ' out of range (WCHAR) 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__literals_validation_tests__literal_cast_with_non_literal.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/literals_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E061]: Cannot cast into [x], only elementary types are allowed 6 | ┌─ :2:13 7 | │ 8 | 2 │ INT#[x]; 9 | │ ^^^^^^^ Cannot cast into [x], only elementary types are allowed 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__naming_validation_test__D.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/naming_validation_test.rs 3 | expression: "&result" 4 | --- 5 | error[E004]: D can not be used as a name because it is a built-in datatype 6 | ┌─ :1:6 7 | │ 8 | 1 │ TYPE D : STRUCT x : DINT; END_STRUCT END_TYPE 9 | │ ^ D can not be used as a name because it is a built-in datatype 10 | 11 | error[E004]: D: Ambiguous datatype. 12 | ┌─ :1:6 13 | │ 14 | 1 │ TYPE D : STRUCT x : DINT; END_STRUCT END_TYPE 15 | │ ^ D: Ambiguous datatype. 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__naming_validation_test__DT.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/naming_validation_test.rs 3 | expression: "&result" 4 | --- 5 | error[E004]: DT can not be used as a name because it is a built-in datatype 6 | ┌─ :1:6 7 | │ 8 | 1 │ TYPE DT : STRUCT x : DINT; END_STRUCT END_TYPE 9 | │ ^^ DT can not be used as a name because it is a built-in datatype 10 | 11 | error[E004]: DT: Ambiguous datatype. 12 | ┌─ :1:6 13 | │ 14 | 1 │ TYPE DT : STRUCT x : DINT; END_STRUCT END_TYPE 15 | │ ^^ DT: Ambiguous datatype. 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__naming_validation_test__LD.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/naming_validation_test.rs 3 | expression: "&result" 4 | --- 5 | error[E004]: LD can not be used as a name because it is a built-in datatype 6 | ┌─ :1:6 7 | │ 8 | 1 │ TYPE LD : STRUCT x : DINT; END_STRUCT END_TYPE 9 | │ ^^ LD can not be used as a name because it is a built-in datatype 10 | 11 | error[E004]: LD: Ambiguous datatype. 12 | ┌─ :1:6 13 | │ 14 | 1 │ TYPE LD : STRUCT x : DINT; END_STRUCT END_TYPE 15 | │ ^^ LD: Ambiguous datatype. 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__naming_validation_test__LT.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/naming_validation_test.rs 3 | expression: "&result" 4 | --- 5 | error[E004]: LT can not be used as a name because it is a built-in datatype 6 | ┌─ :1:6 7 | │ 8 | 1 │ TYPE LT : STRUCT x : DINT; END_STRUCT END_TYPE 9 | │ ^^ LT can not be used as a name because it is a built-in datatype 10 | 11 | error[E004]: LT: Ambiguous datatype. 12 | ┌─ :1:6 13 | │ 14 | 1 │ TYPE LT : STRUCT x : DINT; END_STRUCT END_TYPE 15 | │ ^^ LT: Ambiguous datatype. 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__naming_validation_test__T.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/naming_validation_test.rs 3 | expression: "&result" 4 | --- 5 | error[E004]: T can not be used as a name because it is a built-in datatype 6 | ┌─ :1:6 7 | │ 8 | 1 │ TYPE T : STRUCT x : DINT; END_STRUCT END_TYPE 9 | │ ^ T can not be used as a name because it is a built-in datatype 10 | 11 | error[E004]: T: Ambiguous datatype. 12 | ┌─ :1:6 13 | │ 14 | 1 │ TYPE T : STRUCT x : DINT; END_STRUCT END_TYPE 15 | │ ^ T: Ambiguous datatype. 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__naming_validation_test__VOID.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/naming_validation_test.rs 3 | expression: res 4 | --- 5 | 6 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__pou_validation_tests__actions_container_no_name.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/pou_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | warning[E022]: Missing Actions Container Name 6 | ┌─ :1:25 7 | │ 8 | 1 │ ACTIONS ACTION myAction END_ACTION END_ACTIONS 9 | │ ^ Missing Actions Container Name 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__pou_validation_tests__class_has_implementation.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/pou_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E017]: A class cannot have an implementation 6 | ┌─ :6:13 7 | │ 8 | 6 │ LIGHT := TRUE; 9 | │ ^^^^^^^^^^^^^^ A class cannot have an implementation 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__pou_validation_tests__class_with_return_type.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/pou_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E026]: POU Type Class does not support a return type 6 | ┌─ :2:21 7 | │ 8 | 2 │ CLASS cls : INT 9 | │ ^^^ POU Type Class does not support a return type 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__pou_validation_tests__function_has_super_class.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/pou_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E110]: Subclassing is only allowed in `CLASS` and `FUNCTION_BLOCK` 6 | ┌─ :5:18 7 | │ 8 | 5 │ FUNCTION func EXTENDS cls 9 | │ ^^^^ Subclassing is only allowed in `CLASS` and `FUNCTION_BLOCK` 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__pou_validation_tests__in_out_variable_not_allowed_in_class.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/pou_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E019]: A class cannot contain `VAR_INPUT`, `VAR_IN_OUT`, or `VAR_OUTPUT` blocks 6 | ┌─ :2:15 7 | │ 8 | 2 │ CLASS cls 9 | │ ^^^ A class cannot contain `VAR_INPUT`, `VAR_IN_OUT`, or `VAR_OUTPUT` blocks 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__pou_validation_tests__input_variable_not_allowed_in_class.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/pou_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E019]: A class cannot contain `VAR_INPUT`, `VAR_IN_OUT`, or `VAR_OUTPUT` blocks 6 | ┌─ :2:15 7 | │ 8 | 2 │ CLASS cls 9 | │ ^^^ A class cannot contain `VAR_INPUT`, `VAR_IN_OUT`, or `VAR_OUTPUT` blocks 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__pou_validation_tests__local_variable_allowed_in_class.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/pou_validation_tests.rs 3 | expression: res 4 | --- 5 | 6 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__pou_validation_tests__output_variable_not_allowed_in_class.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/pou_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E019]: A class cannot contain `VAR_INPUT`, `VAR_IN_OUT`, or `VAR_OUTPUT` blocks 6 | ┌─ :2:15 7 | │ 8 | 2 │ CLASS cls 9 | │ ^^^ A class cannot contain `VAR_INPUT`, `VAR_IN_OUT`, or `VAR_OUTPUT` blocks 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__pou_validation_tests__program_has_super_class.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/pou_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E110]: Subclassing is only allowed in `CLASS` and `FUNCTION_BLOCK` 6 | ┌─ :5:17 7 | │ 8 | 5 │ PROGRAM prog EXTENDS cls 9 | │ ^^^^ Subclassing is only allowed in `CLASS` and `FUNCTION_BLOCK` 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__recursive_validation_tests__structs__one_cycle_multiple_self_a.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/recursive_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E029]: Recursive data structure `A -> A` has infinite size 6 | ┌─ :2:18 7 | │ 8 | 2 │ TYPE A : STRUCT 9 | │ ^ Recursive data structure `A -> A` has infinite size 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__recursive_validation_tests__structs__one_cycle_self_a.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/recursive_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E029]: Recursive data structure `A -> A` has infinite size 6 | ┌─ :2:18 7 | │ 8 | 2 │ TYPE A : STRUCT 9 | │ ^ Recursive data structure `A -> A` has infinite size 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__reference_resolve_tests__reference_to_private_variable_in_intermediate_fb.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/reference_resolve_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | warning[E049]: Illegal access to private member fb1.f 6 | ┌─ :19:19 7 | │ 8 | 19 │ a.f.x := 7; 9 | │ ^ Illegal access to private member fb1.f 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__reference_resolve_tests__reference_to_private_variable_is_illegal.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/reference_resolve_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | warning[E049]: Illegal access to private member prg.s 6 | ┌─ :9:21 7 | │ 8 | 9 │ prg.s := 7; 9 | │ ^ Illegal access to private member prg.s 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__reference_resolve_tests__resolve_simple_variable_references.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/reference_resolve_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E048]: Could not resolve reference to b 6 | ┌─ :10:17 7 | │ 8 | 10 │ b; 9 | │ ^ Could not resolve reference to b 10 | 11 | error[E048]: Could not resolve reference to gb 12 | ┌─ :12:17 13 | │ 14 | 12 │ gb; 15 | │ ^^ Could not resolve reference to gb 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__address_of_operations.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/statement_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | 6 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__assignment_to_constants_result_in_an_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/statement_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E036]: Cannot assign to CONSTANT 'prg.cl' 6 | ┌─ :20:13 7 | │ 8 | 20 │ cl := 4; 9 | │ ^^ Cannot assign to CONSTANT 'prg.cl' 10 | 11 | error[E036]: Cannot assign to CONSTANT 'ci' 12 | ┌─ :22:13 13 | │ 14 | 22 │ ci := 4; 15 | │ ^^ Cannot assign to CONSTANT 'ci' 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__exlicit_param_different_casing.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/statement_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | 6 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__invalid_cast_statement_causes_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/statement_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E048]: Could not resolve reference to var1 6 | ┌─ :7:28 7 | │ 8 | 7 │ i := INT#s.var1; // illegal, var1 cannot be found in INT 9 | │ ^^^^ Could not resolve reference to var1 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__passing_compatible_numeric_types_to_functions_is_allowed.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/statement_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | warning[E067]: Implicit downcast from 'LREAL' to 'LINT'. 6 | ┌─ :8:13 7 | │ 8 | 8 │ bar(lreal_); 9 | │ ^^^^^^ Implicit downcast from 'LREAL' to 'LINT'. 10 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__string_compare_function_with_wrong_signature_causes_error.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/statement_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E073]: Missing compare function 'FUNCTION STRING_EQUAL : BOOL VAR_INPUT a,b : STRING; END_VAR ...'. 6 | ┌─ :5:13 7 | │ 8 | 5 │ 'a' = 'b'; // missing compare function :-( 9 | │ ^^^^^^^^^^ Missing compare function 'FUNCTION STRING_EQUAL : BOOL VAR_INPUT a,b : STRING; END_VAR ...'. 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__variable_length_array_test__builtins__builtins_called_with_aliased_type.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/variable_length_array_test.rs 3 | expression: res 4 | --- 5 | 6 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__variable_length_array_test__functions__variable_length_array_function_input.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/variable_length_array_test.rs 3 | expression: "parse_and_validate_buffered(&function.replace(\"\", \"INPUT\"))" 4 | --- 5 | warning[E047]: Variable Length Arrays are always by-ref, even when declared in a by-value block 6 | ┌─ :4:13 7 | │ 8 | 4 │ arr : ARRAY[*] OF DINT; 9 | │ ^^^ Variable Length Arrays are always by-ref, even when declared in a by-value block 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__variable_length_array_test__naming__global_vla_does_not_cause_name_conflict.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/variable_length_array_test.rs 3 | expression: diag 4 | --- 5 | error[E044]: VLAs can not be defined as global variables 6 | ┌─ :3:13 7 | │ 8 | 3 │ vla : ARRAY[*, *] OF DINT; 9 | │ ^^^ VLAs can not be defined as global variables 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__variable_length_array_test__variable_length_array_defined_as_a_global_variable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/variable_length_array_test.rs 3 | expression: parse_and_validate_buffered(src) 4 | --- 5 | error[E044]: VLAs can not be defined as global variables 6 | ┌─ :3:13 7 | │ 8 | 3 │ arr : ARRAY[*] OF DINT; 9 | │ ^^^ VLAs can not be defined as global variables 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__variable_validation_tests__overflows__overflows_with_array_initializer.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/variable_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | warning[E039]: This will overflow for type UINT 6 | ┌─ :3:46 7 | │ 8 | 3 │ arr : ARRAY[0..5] OF UINT := [0, -1, -2, -3, -4, -5]; 9 | │ ^^ This will overflow for type UINT 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__variable_validation_tests__overflows__overflows_with_constants.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/variable_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | warning[E039]: This will overflow for type INT 6 | ┌─ :3:24 7 | │ 8 | 3 │ a : INT := 16384; // OK 9 | │ ╭────────────────────────^ 10 | 4 │ │ b : INT := 16384; // OK 11 | │ ╰────────────────────────────^ This will overflow for type INT 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__variable_validation_tests__overflows__overflows_with_non_global_constants.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/variable_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | error[E033]: Unresolved constant `c` variable: `a` is no const reference 6 | ┌─ :5:24 7 | │ 8 | 5 │ c : INT := a + b; // Will overflow 9 | │ ^^^^^ Unresolved constant `c` variable: `a` is no const reference 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__variable_validation_tests__overflows__overflows_with_not.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/variable_validation_tests.rs 3 | expression: diagnostics 4 | --- 5 | warning[E039]: This will overflow for type UINT 6 | ┌─ :4:25 7 | │ 8 | 4 │ y : UINT := NOT -1234; // Not OK (because of -1234) 9 | │ ^^^^^^^^^ This will overflow for type UINT 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/validation/tests/snapshots/rusty__validation__tests__variable_validation_tests__sized_varargs_require_type.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/validation/tests/variable_validation_tests.rs 3 | expression: "&diagnostics" 4 | --- 5 | error[E038]: Missing datatype: Sized Variadics require a known datatype. 6 | ┌─ :5:27 7 | │ 8 | 5 │ args : {sized}...; 9 | │ ^^^ Missing datatype: Sized Variadics require a known datatype. 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/integration/cfc/resolver_tests.rs 3 | expression: annotations.get(act2) 4 | --- 5 | Some( 6 | Program { 7 | qualified_name: "main.newAction2", 8 | }, 9 | ) 10 | -------------------------------------------------------------------------------- /tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/integration/cfc/resolver_tests.rs 3 | expression: annotations.get(left) 4 | --- 5 | Some( 6 | Variable { 7 | resulting_type: "DINT", 8 | qualified_name: "main.a", 9 | constant: false, 10 | argument_type: ByVal( 11 | Local, 12 | ), 13 | auto_deref: None, 14 | }, 15 | ) 16 | -------------------------------------------------------------------------------- /tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/integration/cfc/resolver_tests.rs 3 | expression: annotations.get(left) 4 | --- 5 | Some( 6 | Variable { 7 | resulting_type: "DINT", 8 | qualified_name: "main.b", 9 | constant: false, 10 | argument_type: ByVal( 11 | Local, 12 | ), 13 | auto_deref: None, 14 | }, 15 | ) 16 | -------------------------------------------------------------------------------- /tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/integration/cfc/resolver_tests.rs 3 | expression: annotations.get(act1) 4 | --- 5 | Some( 6 | Program { 7 | qualified_name: "main.newAction", 8 | }, 9 | ) 10 | -------------------------------------------------------------------------------- /tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__jumps_annotated_with_label_annoations.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/integration/cfc/resolver_tests.rs 3 | expression: annotations.get(&jump) 4 | --- 5 | Some( 6 | Label { 7 | name: "lbl", 8 | }, 9 | ) 10 | -------------------------------------------------------------------------------- /tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__label_added_to_index_as_annotation.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/integration/cfc/resolver_tests.rs 3 | expression: "index.get_label(\"main\", \"lbl\").unwrap()" 4 | --- 5 | Label { 6 | id: 27, 7 | name: "lbl", 8 | location: SourceLocation { 9 | span: Block { 10 | local_id: 2, 11 | execution_order: Some( 12 | 5, 13 | ), 14 | inner_range: None, 15 | }, 16 | file: Some( 17 | ".cfc", 18 | ), 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /tests/integration/cfc/snapshots/tests__integration__cfc__validation_tests__duplicate_label_validation.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/integration/cfc/validation_tests.rs 3 | expression: diagnostician.buffer().unwrap() 4 | --- 5 | error[E018]: lbl: Duplicate label. 6 | ┌─ .cfc:1:1 7 | │ 8 | 1 │ 9 | │ ^ 10 | │ 11 | │ lbl: Duplicate label. 12 | │ see also 13 | │ see also 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/integration/cfc/snapshots/tests__integration__cfc__validation_tests__jump_with_missing_label_validation.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: tests/integration/cfc/validation_tests.rs 3 | expression: diagnostician.buffer().unwrap() 4 | --- 5 | error[E048]: Could not resolve reference to lbl_x 6 | ┌─ .cfc:1:1 7 | │ 8 | 1 │ 9 | │ ^ Could not resolve reference to lbl_x 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/assigning.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | x : DINT := 200; 4 | y : DINT := 100; 5 | pt : pass_through; 6 | END_VAR 7 | pt.a := x; 8 | pt.b := y; 9 | main := pt.a + pt.b; 10 | END_FUNCTION 11 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/chained_calls.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | x : DINT := 2; 4 | y : DINT := 1; 5 | adder : myAdder; 6 | END_VAR 7 | adder.x := x; 8 | adder.y := y; 9 | 10 | // temp1 := x + y + 1; 11 | // temp2 := temp1 + y + 1; 12 | // x := temp1 + temp2 = 2*temp1 + y + 1 = 2x + 2y + 2 + y + 1 13 | // x := 2x + 3y + 3 14 | adder(); 15 | main := adder.x; 16 | END_FUNCTION 17 | 18 | FUNCTION myAdd : DINT 19 | VAR_INPUT 20 | a, b : DINT; 21 | END_VAR 22 | myAdd := a + b; 23 | END_FUNCTION 24 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/chained_calls_galore.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | x : DINT := 2; 4 | y : DINT := 2; 5 | chainer : ridiculous_chaining; 6 | END_VAR 7 | chainer(x, y); 8 | 9 | main := chainer.z; 10 | END_FUNCTION 11 | 12 | FUNCTION myAdd : DINT 13 | VAR_INPUT 14 | a, b : DINT; 15 | END_VAR 16 | myAdd := a + b; 17 | END_FUNCTION 18 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/conditional_return_block_evaluating_false.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | conditional : conditional_return; 4 | END_VAR 5 | 6 | conditional.a := 0; 7 | conditional.b := 1; 8 | conditional.res := 5; 9 | conditional(); 10 | 11 | main := conditional.res; 12 | END_FUNCTION 13 | 14 | FUNCTION MyGT : BOOL 15 | VAR_INPUT 16 | a, b : DINT; 17 | END_VAR 18 | 19 | IF a > b THEN 20 | MyGT := TRUE; 21 | ELSE 22 | MyGT := FALSE; 23 | END_IF 24 | END_FUNCTION 25 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/conditional_return_block_evaluating_true.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | conditional : conditional_return; 4 | END_VAR 5 | 6 | conditional.a := 1; 7 | conditional.b := 0; 8 | conditional.res := 5; 9 | conditional(); 10 | 11 | main := conditional.res; 12 | END_FUNCTION 13 | 14 | FUNCTION MyGT : BOOL 15 | VAR_INPUT 16 | a, b : DINT; 17 | END_VAR 18 | 19 | IF a > b THEN 20 | MyGT := TRUE; 21 | ELSE 22 | MyGT := FALSE; 23 | END_IF 24 | END_FUNCTION 25 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/conditional_return_evaluating_false.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | my_val : DINT := 0; 4 | conditional : conditional_return; 5 | END_VAR 6 | 7 | conditional.val := my_val; 8 | conditional(); 9 | 10 | main := conditional.val; 11 | END_FUNCTION 12 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/conditional_return_evaluating_true.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | my_val : DINT := 5; 4 | conditional : conditional_return; 5 | END_VAR 6 | 7 | conditional.val := my_val; 8 | conditional(); 9 | 10 | main := conditional.val; 11 | END_FUNCTION 12 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/conditional_return_evaluating_true_negated.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | my_val : DINT := 5; 4 | conditional : conditional_return; 5 | END_VAR 6 | 7 | conditional.val := my_val; 8 | conditional(); 9 | 10 | main := conditional.val; 11 | END_FUNCTION 12 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/connection.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | value : DINT := 2; 4 | END_VAR 5 | main := myConnection(value); 6 | ; 7 | END_FUNCTION 8 | 9 | FUNCTION myAdd : DINT 10 | VAR_INPUT 11 | a, b : DINT; 12 | END_VAR 13 | myAdd := a + b; 14 | END_FUNCTION 15 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/function_returns.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | main := FuncyReturn(111); 3 | END_FUNCTION 4 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/my_add.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | x : DINT := 2; 4 | y : DINT := 1; 5 | adder : myAdder; 6 | END_VAR 7 | adder.x := x; 8 | adder.y := y; 9 | 10 | // x := x + y + 1 11 | adder(); 12 | main := adder.x; 13 | END_FUNCTION 14 | 15 | FUNCTION myAdd : DINT 16 | VAR_INPUT 17 | a, b : DINT; 18 | END_VAR 19 | myAdd := a + b; 20 | END_FUNCTION 21 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/select.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | x : DINT := 2; 4 | y : DINT := 1; 5 | selector : select; 6 | END_VAR 7 | // x > y ? y : x 8 | selector(x, y); 9 | // expecting y 10 | main := selector.selected; 11 | END_FUNCTION 12 | -------------------------------------------------------------------------------- /tests/integration/data/cfc/variable_assignment.st: -------------------------------------------------------------------------------- 1 | FUNCTION main : DINT 2 | VAR 3 | x : DINT := 10; 4 | y : DINT := 33333; 5 | assign : assignment; 6 | END_VAR 7 | assign.a := x; 8 | assign.b := y; 9 | assign(); 10 | // b := a 11 | main := assign.b; 12 | END_FUNCTION 13 | -------------------------------------------------------------------------------- /tests/integration/data/command_line.st: -------------------------------------------------------------------------------- 1 | FUNCTION myFunc : DINT 2 | VAR_INPUT 3 | a,b,c : DINT; 4 | END_VAR 5 | END_FUNCTION 6 | -------------------------------------------------------------------------------- /tests/integration/data/empty_proj/conf/plc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "EmptyProject", 3 | "files" : [ 4 | "../src/**/*.st", 5 | "../src/**/*.gvl", 6 | "../conf/tasks/*.st" 7 | ], 8 | "compile_type" : "Shared", 9 | "output" : "prog.so", 10 | "libraries" : [ 11 | ] 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/integration/data/empty_proj/conf/tasks/mainTask.task.st: -------------------------------------------------------------------------------- 1 | FUNCTION mainTask : DINT 2 | mainProg(); 3 | END_FUNCTION 4 | -------------------------------------------------------------------------------- /tests/integration/data/empty_proj/src/globals.gvl: -------------------------------------------------------------------------------- 1 | VAR_GLOBAL 2 | END_VAR 3 | -------------------------------------------------------------------------------- /tests/integration/data/empty_proj/src/mainProg.st: -------------------------------------------------------------------------------- 1 | PROGRAM mainProg 2 | VAR 3 | 4 | END_VAR 5 | 6 | ; 7 | END_PROGRAM 8 | -------------------------------------------------------------------------------- /tests/integration/data/encoding_utf_16.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/encoding_utf_16.st -------------------------------------------------------------------------------- /tests/integration/data/encoding_win.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/encoding_win.st -------------------------------------------------------------------------------- /tests/integration/data/json/build_cc_linker.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cc_proj", 3 | "files": [ 4 | "simple_program.st" 5 | ], 6 | "compile_type": "Shared" 7 | } 8 | -------------------------------------------------------------------------------- /tests/integration/data/json/build_clang_windows.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clang_proj", 3 | "files": [ 4 | "program_with_variables.st" 5 | ], 6 | "compile_type": "Shared", 7 | "libraries": [ 8 | { 9 | "name": "test", 10 | "path": ".", 11 | "package": "System", 12 | "include_path": [ 13 | "program_with_expressions.st" 14 | ] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tests/integration/data/json/build_without_sysroot.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "proj", 3 | "files": [ 4 | "simple_program.st" 5 | ], 6 | "compile_type": "Shared", 7 | "output": "proj.so" 8 | } 9 | -------------------------------------------------------------------------------- /tests/integration/data/json/libs/aarch64-linux-gnu/libcopy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/json/libs/aarch64-linux-gnu/libcopy.so -------------------------------------------------------------------------------- /tests/integration/data/json/libs/aarch64-linux-gnu/libcopy2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/json/libs/aarch64-linux-gnu/libcopy2.so -------------------------------------------------------------------------------- /tests/integration/data/json/libs/aarch64-linux-gnu/libnocopy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/json/libs/aarch64-linux-gnu/libnocopy.so -------------------------------------------------------------------------------- /tests/integration/data/json/libs/libcopy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/json/libs/libcopy.so -------------------------------------------------------------------------------- /tests/integration/data/json/libs/libcopy2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/json/libs/libcopy2.so -------------------------------------------------------------------------------- /tests/integration/data/json/libs/libnocopy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/json/libs/libnocopy.so -------------------------------------------------------------------------------- /tests/integration/data/json/libs/x86_64-linux-gnu/libcopy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/json/libs/x86_64-linux-gnu/libcopy.so -------------------------------------------------------------------------------- /tests/integration/data/json/libs/x86_64-linux-gnu/libcopy2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/json/libs/x86_64-linux-gnu/libcopy2.so -------------------------------------------------------------------------------- /tests/integration/data/json/libs/x86_64-linux-gnu/libnocopy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/json/libs/x86_64-linux-gnu/libnocopy.so -------------------------------------------------------------------------------- /tests/integration/data/json/multi_target_and_sysroot.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "proj", 3 | "files": [ 4 | "simple_program.st" 5 | ], 6 | "compile_type": "Shared", 7 | "output": "proj.so" 8 | } 9 | -------------------------------------------------------------------------------- /tests/integration/data/json/prog_with_globals.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "proj", 3 | "files": [ 4 | "mainProg.st", 5 | "globals.st" 6 | ], 7 | "compile_type": "Shared", 8 | "libraries": [ 9 | ], 10 | "output": "proj.so" 11 | } 12 | -------------------------------------------------------------------------------- /tests/integration/data/json/program_with_expressions.st: -------------------------------------------------------------------------------- 1 | PROGRAM name 2 | (1 + 2) * (3 + 4); 3 | END_PROGRAM 4 | -------------------------------------------------------------------------------- /tests/integration/data/json/program_with_variables.st: -------------------------------------------------------------------------------- 1 | PROGRAM hello 2 | VAR 3 | x : INT; 4 | y : BOOL; 5 | END_VAR 6 | IF x = 2 THEN 7 | x := 3; 8 | END_IF 9 | END_PROGRAM 10 | -------------------------------------------------------------------------------- /tests/integration/data/json/simple_program.st: -------------------------------------------------------------------------------- 1 | PROGRAM prg 2 | VAR 3 | a : INT; 4 | b : REAL; 5 | END_VAR 6 | b := 1.5; 7 | a := INT#b; 8 | END_PROGRAM 9 | -------------------------------------------------------------------------------- /tests/integration/data/linking/consts.dt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PLC-lang/rusty/502608f8fff85798ff3db24cf59d6819d2964b13/tests/integration/data/linking/consts.dt -------------------------------------------------------------------------------- /tests/integration/data/linking/consts.st: -------------------------------------------------------------------------------- 1 | VAR_GLOBAL CONSTANT 2 | myValue : BOOL := TRUE; 3 | END_VAR 4 | 5 | FUNCTION main : DINT 6 | END_FUNCTION 7 | -------------------------------------------------------------------------------- /tests/integration/data/linking/file1.st: -------------------------------------------------------------------------------- 1 | {external} 2 | FUNCTION func2 : DINT 3 | END_FUNCTION 4 | 5 | FUNCTION func1 : DINT 6 | func2(); 7 | END_FUNCTION 8 | -------------------------------------------------------------------------------- /tests/integration/data/linking/file2.st: -------------------------------------------------------------------------------- 1 | {external} 2 | FUNCTION func1 : DINT 3 | END_FUNCTION 4 | 5 | FUNCTION func2 : DINT 6 | func1(); 7 | END_FUNCTION 8 | -------------------------------------------------------------------------------- /tests/integration/data/linking/folder1/vars.st: -------------------------------------------------------------------------------- 1 | VAR_GLOBAL CONSTANT 2 | myValue : BOOL := TRUE; 3 | END_VAR 4 | -------------------------------------------------------------------------------- /tests/integration/data/linking/folder2/vars.st: -------------------------------------------------------------------------------- 1 | VAR_GLOBAL CONSTANT 2 | myValue2 : BOOL := TRUE; 3 | END_VAR 4 | -------------------------------------------------------------------------------- /tests/integration/data/linking/init.st: -------------------------------------------------------------------------------- 1 | TYPE myStruct : STRUCT 2 | a : INT := 5; 3 | b : DINT := 6; 4 | END_STRUCT 5 | END_TYPE 6 | -------------------------------------------------------------------------------- /tests/integration/data/linking/init2.st: -------------------------------------------------------------------------------- 1 | FUNCTION_BLOCK myFB 2 | VAR 3 | myS : myStruct := (a := 2); 4 | END_VAR 5 | END_FUNCTION_BLOCK 6 | -------------------------------------------------------------------------------- /tests/integration/data/linking/init3.st: -------------------------------------------------------------------------------- 1 | FUNCTION_BLOCK myFb2 2 | VAR 3 | fb : myFb; 4 | END_VAR 5 | END_FUNCTION_BLOCK 6 | -------------------------------------------------------------------------------- /tests/integration/data/linking/lib.o: -------------------------------------------------------------------------------- 1 | THIS FILE JUST HAS THE .O extenstion to be used in the test, do not delete 2 | -------------------------------------------------------------------------------- /tests/integration/data/linking/relative.st: -------------------------------------------------------------------------------- 1 | FUNCTION relative : DINT 2 | END_FUNCTION 3 | -------------------------------------------------------------------------------- /tests/integration/data/multi/concat_date.st: -------------------------------------------------------------------------------- 1 | {external} 2 | FUNCTION CONCAT_DATE : DATE 3 | VAR_INPUT 4 | year : T; 5 | month : T; 6 | day : T; 7 | END_VAR 8 | END_FUNCTION 9 | -------------------------------------------------------------------------------- /tests/integration/data/multi/concat_date_prg1.st: -------------------------------------------------------------------------------- 1 | FUNCTION foo1 : LINT 2 | foo1 := CONCAT_DATE(INT#1, SINT#2, SINT#3); 3 | END_FUNCTION 4 | -------------------------------------------------------------------------------- /tests/integration/data/multi/concat_date_prg2.st: -------------------------------------------------------------------------------- 1 | FUNCTION foo2 : LINT 2 | foo2 := CONCAT_DATE(INT#4, SINT#5, SINT#6); 3 | END_FUNCTION 4 | -------------------------------------------------------------------------------- /tests/integration/data/multi/enum1.st: -------------------------------------------------------------------------------- 1 | FUNCTION_BLOCK FOO 2 | VAR 3 | foo_enum : (stop, go) := go; 4 | END_VAR 5 | END_FUNCTION_BLOCK 6 | -------------------------------------------------------------------------------- /tests/integration/data/multi/enum2.st: -------------------------------------------------------------------------------- 1 | FUNCTION_BLOCK BAR 2 | VAR 3 | bar_enum : (stop, go) := go; 4 | END_VAR 5 | END_FUNCTION_BLOCK 6 | -------------------------------------------------------------------------------- /tests/integration/data/multi/func.st: -------------------------------------------------------------------------------- 1 | 2 | 3 | FUNCTION main : INT 4 | VAR_INPUT 5 | 6 | END_VAR 7 | 8 | VAR 9 | 10 | END_VAR 11 | mainProg(); 12 | main := mainProg.a; 13 | 14 | END_FUNCTION 15 | -------------------------------------------------------------------------------- /tests/integration/data/multi/prog.st: -------------------------------------------------------------------------------- 1 | PROGRAM mainProg 2 | VAR 3 | a: DINT := 0; 4 | END_VAR 5 | a := 42; 6 | END_PROGRAM 7 | -------------------------------------------------------------------------------- /tests/integration/data/test_file.st: -------------------------------------------------------------------------------- 1 | PROGRAM a 2 | (* Cömment *) 3 | END_PROGRAM 4 | -------------------------------------------------------------------------------- /tests/lit/multi/enum__month_to_int/month_to_int.test: -------------------------------------------------------------------------------- 1 | RUN: %COMPILE %S/month_to_int.st %S/months.dt && %RUN | %CHECK %s 2 | CHECK:6 -------------------------------------------------------------------------------- /tests/lit/multi/enum__month_to_int/months.dt: -------------------------------------------------------------------------------- 1 | TYPE 2 | MONTH: (January, February, March, April, May, June, July, August, September, October, November, December); 3 | END_TYPE -------------------------------------------------------------------------------- /tests/lit/multi/extern_C_fb_init/extern_C_fb_init.test: -------------------------------------------------------------------------------- 1 | RUN: %COMPILE %S/main.st && %RUN | %CHECK %s 2 | CHECK: myFunctionBlock initialized with a = 1, b = 2 3 | CHECK: 1 4 | CHECK: 2 -------------------------------------------------------------------------------- /tests/lit/multi/extern_C_fb_init/foo.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef struct { 4 | int a; 5 | int b; 6 | } myFunctionBlock; 7 | 8 | myFunctionBlock __myFunctionBlock__init = { 0 }; 9 | 10 | void myFunctionBlock__FB_INIT(myFunctionBlock* fb_instance) { 11 | fb_instance->a = 1; 12 | fb_instance->b = 2; 13 | printf("myFunctionBlock initialized with a = %d, b = %d\n", fb_instance->a, fb_instance->b); 14 | } -------------------------------------------------------------------------------- /tests/lit/multi/extern_C_fb_init/header.pli: -------------------------------------------------------------------------------- 1 | {external} 2 | FUNCTION_BLOCK myFunctionBlock 3 | VAR 4 | a : DINT; 5 | b : DINT; 6 | END_VAR 7 | METHOD FB_INIT 8 | END_METHOD 9 | END_FUNCTION_BLOCK -------------------------------------------------------------------------------- /tests/lit/multi/extern_C_fb_init/main.st: -------------------------------------------------------------------------------- 1 | FUNCTION main 2 | VAR 3 | f: myFunctionBlock; 4 | END_VAR 5 | printf('%d$N', f.a); 6 | printf('%d$N', f.b); 7 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/multi/lit.local.cfg: -------------------------------------------------------------------------------- 1 | config.suffixes = ['.test'] -------------------------------------------------------------------------------- /tests/lit/single/address/hardware_reference_used.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | VAR_GLOBAL 3 | a AT %IX1.2.1 : BOOL; 4 | b AT %QX1.2.2 : BOOL; 5 | c AT %ID1.2.3 : DWORD; 6 | d AT %ID1.2.4 : DWORD; 7 | END_VAR 8 | 9 | FUNCTION main : DINT 10 | __init___hardware_reference_used_st(); 11 | 12 | a := TRUE; 13 | printf('%u$N', a); //CHECK: 1 14 | b := TRUE; 15 | printf('%u$N', b); //CHECK: 1 16 | c := 1337; 17 | printf('%d$N', c); //CHECK: 1337 18 | d := 98765; 19 | printf('%d$N', d); //CHECK: 98765 20 | END_FUNCTION 21 | -------------------------------------------------------------------------------- /tests/lit/single/address/reference_in_body.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | VAR_GLOBAL 3 | a AT %IX1.2.1 : BOOL; 4 | b AT %QX1.2.2 : BOOL; 5 | c AT %ID1.2.3 : DWORD; 6 | d AT %ID1.2.4 : DWORD; 7 | END_VAR 8 | 9 | FUNCTION main : DINT 10 | __init___reference_in_body_st(); 11 | 12 | %IX1.2.1 := TRUE; 13 | printf('%u$N', a); //CHECK: 1 14 | b := TRUE; 15 | printf('%u$N', %QX1.2.2); //CHECK: 1 16 | %IX1.2.3 := 1337; 17 | printf('%d$N', c); //CHECK: 1337 18 | d := 98765; 19 | printf('%d$N', %QX1.2.4); //CHECK: 98765 20 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/arithmetic/addition.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | // CHECK: 10 3 | FUNCTION main 4 | VAR 5 | x : DINT; 6 | y : DINT; 7 | END_VAR 8 | 9 | x := 5; 10 | y := 5; 11 | printf('%d$N', x + y); 12 | END_FUNCTION 13 | -------------------------------------------------------------------------------- /tests/lit/single/arithmetic/sqrt.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | // CHECK: 2 3 | FUNCTION main 4 | VAR 5 | res : LREAL; 6 | END_VAR 7 | printf('%d$N', REAL_TO_DINT(SQRT(4.0))); 8 | END_FUNCTION 9 | -------------------------------------------------------------------------------- /tests/lit/single/complex_return_types/function_with_explicit_calls.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION foo : STRING 3 | VAR_INPUT 4 | x : DINT; 5 | END_VAR 6 | foo := 'hello'; 7 | END_FUNCTION 8 | FUNCTION main : DINT 9 | VAR 10 | res : STRING; 11 | END_VAR 12 | res := foo(x := 1); 13 | printf('%s$N', ADR(res)); // CHECK: hello 14 | END_FUNCTION 15 | -------------------------------------------------------------------------------- /tests/lit/single/init/global_struct_instances.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | VAR_GLOBAL 3 | arr : ARRAY[1..3] OF DINT := [3, 2, 1]; 4 | foo: foo_t; 5 | END_VAR 6 | 7 | FUNCTION_BLOCK foo_t 8 | VAR 9 | refArr AT arr : ARRAY[1..3] OF DINT; 10 | END_VAR 11 | // CHECK: 1, 2, 3 12 | printf('%d, %d, %d$N', refArr[3], refArr[2], refArr[1]); 13 | END_FUNCTION_BLOCK 14 | 15 | FUNCTION main: DINT 16 | foo(); 17 | END_FUNCTION 18 | -------------------------------------------------------------------------------- /tests/lit/single/init/global_variables.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | VAR_GLOBAL 3 | arr : ARRAY[0..3] OF STRING := ['a', 'b', 'c', 'd']; 4 | alias AT arr : ARRAY[0..3] OF STRING; 5 | END_VAR 6 | 7 | FUNCTION main: DINT 8 | // CHECK: a, b, c, d 9 | printf('%s, %s, %s, %s$N', REF(alias[0]), REF(alias[1]), REF(alias[2]), REF(alias[3])); 10 | END_FUNCTION 11 | -------------------------------------------------------------------------------- /tests/lit/single/init/program.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | VAR_GLOBAL 3 | gs: STRING; 4 | END_VAR 5 | 6 | PROGRAM prog 7 | VAR 8 | s AT gs: STRING; 9 | END_VAR 10 | s := 'Hello world!'; 11 | 12 | // CHECK: Hello world! 13 | printf('%s$N', REF(gs)); 14 | END_PROGRAM 15 | 16 | FUNCTION main: DINT 17 | prog(); 18 | END_FUNCTION 19 | -------------------------------------------------------------------------------- /tests/lit/single/init/user_init.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | TYPE 3 | bar : STRUCT 4 | f: foo; 5 | END_STRUCT; 6 | END_TYPE 7 | 8 | FUNCTION_BLOCK foo 9 | VAR 10 | x : INT := 0; 11 | y : INT := 0; 12 | END_VAR 13 | METHOD FB_INIT 14 | x := 1; 15 | y := 2; 16 | END_METHOD 17 | END_FUNCTION_BLOCK 18 | 19 | PROGRAM prog 20 | VAR 21 | str: bar; 22 | END_VAR 23 | printf('%d$N', str.f.x); // CHECK: 1 24 | printf('%d$N', str.f.y); // CHECK: 2 25 | END_PROGRAM 26 | 27 | FUNCTION main: DINT 28 | prog(); 29 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/init/user_init_for_stack_variable.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION_BLOCK foo 3 | METHOD FB_INIT 4 | printf('FB_INIT called$N'); 5 | END_METHOD 6 | END_FUNCTION_BLOCK 7 | 8 | FUNCTION main 9 | VAR 10 | fb: foo; 11 | END_VAR 12 | // CHECK: FB_INIT called 13 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/lit.local.cfg: -------------------------------------------------------------------------------- 1 | # Declare any *.st file as a standlone test file 2 | config.suffixes = ['.st'] -------------------------------------------------------------------------------- /tests/lit/single/oop/fb_access_members_from_base.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION_BLOCK fb 3 | VAR 4 | x : INT; 5 | y : INT; 6 | END_VAR 7 | END_FUNCTION_BLOCK 8 | 9 | FUNCTION_BLOCK fb2 EXTENDS fb 10 | END_FUNCTION_BLOCK 11 | 12 | FUNCTION_BLOCK foo 13 | VAR 14 | myFb : fb2; 15 | END_VAR 16 | myFb.x := 1; 17 | printf('%d$N', myFb.x); //CHECK: 1 18 | END_FUNCTION_BLOCK 19 | 20 | FUNCTION main : DINT 21 | VAR 22 | fb :foo; 23 | END_VAR 24 | fb(); 25 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/oop/fb_method_callled.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION_BLOCK foo 3 | VAR 4 | bar: DINT := 42; 5 | END_VAR 6 | METHOD addToBar: DINT 7 | VAR_INPUT 8 | in: INT; 9 | END_VAR 10 | bar := in + bar; 11 | addToBar := bar; 12 | END_METHOD 13 | 14 | addToBar(3); 15 | printf('%d$N', bar); // CHECK: 45 16 | END_FUNCTION_BLOCK 17 | 18 | FUNCTION main 19 | VAR 20 | fb: foo; 21 | x: DINT; 22 | END_VAR 23 | fb(); 24 | x := fb.addToBar(3); 25 | printf('%d$N', x); // CHECK: 48 26 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/oop/fb_method_with_explicit_return.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION_BLOCK fb 3 | METHOD foo : STRING 4 | VAR_INPUT 5 | x : DINT; 6 | END_VAR 7 | foo := 'hello'; 8 | END_METHOD 9 | END_FUNCTION_BLOCK 10 | FUNCTION main : DINT 11 | VAR 12 | my_fb : fb; 13 | res : STRING; 14 | END_VAR 15 | res := my_fb.foo(x := 1); 16 | printf('%s$N', ADR(res)); // CHECK: hello 17 | END_FUNCTION 18 | -------------------------------------------------------------------------------- /tests/lit/single/oop/fb_with_super_class_method_calls.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION_BLOCK foo 3 | VAR 4 | s : STRING; 5 | END_VAR 6 | METHOD baz 7 | s := 'hello'; 8 | END_METHOD 9 | END_FUNCTION_BLOCK 10 | 11 | FUNCTION_BLOCK bar EXTENDS foo 12 | s := 'world'; 13 | END_FUNCTION_BLOCK 14 | 15 | FUNCTION main: DINT 16 | VAR 17 | fb: bar; 18 | END_VAR 19 | fb.baz(); 20 | printf('%s$N', REF(fb.s)); // CHECK: hello 21 | fb(); 22 | printf('%s$N', REF(fb.s)); // CHECK: world 23 | END_FUNCTION 24 | -------------------------------------------------------------------------------- /tests/lit/single/oop/method_initial_values.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION_BLOCK MyClass 3 | VAR 4 | x, y : INT; 5 | END_VAR 6 | 7 | METHOD testMethod 8 | VAR_INPUT 9 | myMethodArg : INT := 3; 10 | END_VAR 11 | x := myMethodArg; 12 | END_METHOD 13 | END_FUNCTION_BLOCK 14 | 15 | FUNCTION main 16 | VAR 17 | cl : MyClass; 18 | END_VAR 19 | cl.testMethod(); 20 | printf('%d$N', cl.x); // CHECK: 3 21 | END_FUNCTION 22 | -------------------------------------------------------------------------------- /tests/lit/single/oop/method_var_output.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION_BLOCK foo 3 | METHOD baz 4 | VAR_OUTPUT 5 | out : STRING; 6 | END_VAR 7 | out := 'hello'; 8 | END_METHOD 9 | END_FUNCTION_BLOCK 10 | 11 | 12 | FUNCTION main 13 | VAR 14 | s: STRING; 15 | fb: foo; 16 | END_VAR 17 | fb.baz(out => s); 18 | printf('%s$n', REF(s)); // CHECK: hello 19 | s := 'reset'; 20 | printf('%s$n', REF(s)); // CHECK: reset 21 | fb.baz(s); 22 | printf('%s$n', REF(s)); // CHECK: hello 23 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/oop/program_method_called.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | PROGRAM foo 3 | VAR 4 | bar: DINT := 42; 5 | END_VAR 6 | METHOD addToBar: DINT 7 | VAR_INPUT 8 | in: INT; 9 | END_VAR 10 | bar := in + bar; 11 | addToBar := bar; 12 | END_METHOD 13 | 14 | addToBar(3); 15 | printf('%d$N', bar); // CHECK: 45 16 | END_PROGRAM 17 | 18 | FUNCTION main 19 | VAR 20 | x: DINT; 21 | END_VAR 22 | foo(); 23 | x := foo.addToBar(3); 24 | printf('%d$N', x); // CHECK: 48 25 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/pointer/alias_array.ignore: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION main: DINT 3 | VAR 4 | refArr AT arr : ARRAY[1..3] OF DINT; 5 | arr : ARRAY[1..3] OF DINT; 6 | END_VAR 7 | 8 | arr[1] := 3; 9 | arr[2] := 2; 10 | arr[3] := 1; 11 | 12 | // CHECK: 1, 2, 3 13 | printf('%d, %d, %d$N', refArr[3], refArr[2], refArr[1]); 14 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/pointer/alias_autoderef.ignore: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION main: DINT 3 | VAR 4 | foo AT bar : DINT; 5 | bar : DINT; 6 | END_VAR 7 | 8 | bar := 1; 9 | 10 | // CHECK: 2 11 | bar := bar + foo; // bar + bar => 1 + 1 12 | printf('%d$N', foo); 13 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/pointer/alias_struct.ignore: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | TYPE Transaction : STRUCT 3 | id : DINT; 4 | amount : DINT; 5 | message : STRING; 6 | END_STRUCT END_TYPE 7 | 8 | FUNCTION main : DINT 9 | VAR 10 | txn : Transaction := (id := 1, amount := 5, message := 'whats up'); 11 | refTxn AT txn : Transaction; 12 | END_VAR 13 | 14 | // CHECK: 1 15 | printf('%d$N', refTxn.id); 16 | 17 | // CHECK: 5 18 | printf('%d$N', refTxn.amount); 19 | 20 | // CHECK: whats up 21 | printf('%s$N', REF(refTxn.message)); 22 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/pointer/ref_assignment_operator.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION main : DINT 3 | VAR 4 | a : REF_TO DINT; 5 | b : DINT := 5; 6 | END_VAR 7 | a REF= b; 8 | 9 | // CHECK: 5 10 | printf('%d$N', a^); 11 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/pointer/referenceto_variable_referencing_array.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION main: DINT 3 | VAR 4 | arr : ARRAY[1..3] OF DINT; 5 | refArr : REFERENCE TO ARRAY[1..3] OF DINT; 6 | END_VAR 7 | 8 | refArr REF= arr; 9 | arr[1] := 3; 10 | arr[2] := 2; 11 | arr[3] := 1; 12 | 13 | // CHECK: 1, 2, 3 14 | printf('%d, %d, %d$N', refArr[3], refArr[2], refArr[1]); 15 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/pointer/referenceto_variable_referencing_itself.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION main : DINT 3 | VAR 4 | foo : REFERENCE TO DINT; 5 | bar : REFERENCE TO DINT; 6 | qux : DINT; 7 | END_VAR 8 | 9 | foo REF= bar; 10 | bar REF= qux; 11 | 12 | bar REF= bar; 13 | qux := 5; 14 | 15 | // CHECK: 5 16 | printf('%d$N', bar); // bar (-> bar) -> qux 17 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/pointer/referenceto_variable_referencing_other_referenceto_variable.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | FUNCTION main : DINT 3 | VAR 4 | foo : REFERENCE TO DINT; 5 | bar : REFERENCE TO DINT; 6 | qux : DINT; 7 | END_VAR 8 | 9 | bar REF= qux; 10 | foo REF= bar; 11 | qux := 5; 12 | 13 | // CHECK: 5 14 | printf('%d$N', foo); // foo -> bar -> qux 15 | END_FUNCTION 16 | -------------------------------------------------------------------------------- /tests/lit/single/property/called_inside_pou_where_defined.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | 3 | FUNCTION_BLOCK A 4 | PROPERTY sayCheese : DINT 5 | GET 6 | printf('Cheese'); 7 | END_GET 8 | END_PROPERTY 9 | 10 | sayCheese; 11 | END_FUNCTION_BLOCK 12 | 13 | FUNCTION main 14 | VAR 15 | instanceA : A; 16 | END_VAR 17 | 18 | // CHECK: Cheese 19 | instanceA(); 20 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/property/oop_extended_fb_calls_property_in_another_property.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | 3 | FUNCTION_BLOCK fb 4 | PROPERTY foo: DINT 5 | GET 6 | foo := 69; 7 | END_GET 8 | END_PROPERTY 9 | END_FUNCTION_BLOCK 10 | 11 | FUNCTION_BLOCK fb2 EXTENDS fb 12 | PROPERTY bar: DINT 13 | GET 14 | bar := foo; 15 | END_GET 16 | END_PROPERTY 17 | END_FUNCTION_BLOCK 18 | 19 | FUNCTION main 20 | VAR 21 | fbInstance: fb2; 22 | END_VAR 23 | 24 | printf('%d$N', fbInstance.bar); // CHECK: 69 25 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/single/var_external/var_external_initializer_has_no_effect.st: -------------------------------------------------------------------------------- 1 | // RUN: (%COMPILE %s && %RUN) | %CHECK %s 2 | VAR_GLOBAL 3 | i: DINT := 42; 4 | END_VAR 5 | 6 | FUNCTION main: DINT 7 | VAR_EXTERNAL 8 | i : DINT := 1337; 9 | END_VAR 10 | printf('%d$N', i); // CHECK: 42 11 | END_FUNCTION -------------------------------------------------------------------------------- /tests/lit/util/printf.pli: -------------------------------------------------------------------------------- 1 | {external} 2 | FUNCTION printf: DINT 3 | VAR_INPUT {ref} 4 | str : STRING; 5 | END_VAR 6 | VAR_INPUT 7 | args: ...; 8 | END_VAR 9 | END_FUNCTION -------------------------------------------------------------------------------- /xtask/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .env 3 | -------------------------------------------------------------------------------- /xtask/README.md: -------------------------------------------------------------------------------- 1 | # RuSTy xtasks 2 | 3 | This directory contains the following [xtasks](https://github.com/matklad/cargo-xtask): 4 | 5 | - `metrics`: Runs various benchmarks, collects them and (if ran by a CI) appends the collected data to 6 | the [`metrics.json`](https://github.com/PLC-lang/rusty/blob/metrics-data/metrics.json) file. 7 | The given JSON file is then used by our [metrics dashboard](https://plc-lang.github.io/metrics/) to track and display 8 | RuSTys performance over time. Graphically the workflow looks as follows: 9 | 10 |
11 | 12 |
13 | --------------------------------------------------------------------------------