From 189c2108f06b60f5d125c41259021712204a74bd Mon Sep 17 00:00:00 2001 From: Brian Luft Date: Tue, 2 Jan 2024 05:11:11 +0000 Subject: [PATCH] Don't use special directives to separate top-level definitions in a file --- src/compiler/SourceProgram.cpp | 98 ++++++++++--------- .../programs/assignments/assign_dotted_1.bas | 1 - .../programs/assignments/assign_dotted_2.bas | 1 - .../programs/assignments/assign_dotted_3.bas | 1 - .../programs/assignments/assign_dotted_4.bas | 2 - .../programs/assignments/assign_dotted_5.bas | 2 - src/test/programs/assignments/assign_list.bas | 1 - .../programs/assignments/assign_string.bas | 1 - .../variable_shadowing_function.bas | 2 - .../programs/assignments/variable_string.bas | 1 - .../booleans/and_or_short_circuit.bas | 2 - .../booleans/binary_operators_boolean.bas | 1 - .../programs/booleans/boolean_literal.bas | 1 - src/test/programs/booleans/if_false.bas | 1 - src/test/programs/booleans/not_Boolean.bas | 1 - .../console/print_anonymous_record.bas | 1 - src/test/programs/console/print_boolean.bas | 1 - src/test/programs/console/print_date.bas | 1 - src/test/programs/console/print_datetime.bas | 1 - .../programs/console/print_datetimeoffset.bas | 1 - .../programs/console/print_list_number.bas | 1 - .../console/print_map_number_to_number.bas | 1 - .../programs/console/print_named_record.bas | 2 - src/test/programs/console/print_number.bas | 1 - .../console/print_optional_number.bas | 1 - .../programs/console/print_set_number.bas | 1 - src/test/programs/console/print_string.bas | 1 - .../programs/constants/built_in_constants.bas | 1 - src/test/programs/constants/const_global.bas | 4 - .../constants/const_global_cannot_assign.bas | 2 - src/test/programs/constants/const_local.bas | 1 - .../constants/const_local_cannot_assign.bas | 1 - src/test/programs/dates/DateFromParts.bas | 1 - src/test/programs/dates/DateTimeFromParts.bas | 1 - .../dates/DateTimeOffsetFromParts.bas | 1 - src/test/programs/dates/Day_Date.bas | 1 - src/test/programs/dates/Day_DateTime.bas | 1 - .../programs/dates/Day_DateTimeOffset.bas | 1 - src/test/programs/dates/Days.bas | 1 - src/test/programs/dates/Hour_DateTime.bas | 1 - .../programs/dates/Hour_DateTimeOffset.bas | 1 - src/test/programs/dates/Hours.bas | 1 - .../programs/dates/Millisecond_DateTime.bas | 1 - .../dates/Millisecond_DateTimeOffset.bas | 1 - src/test/programs/dates/Milliseconds.bas | 1 - src/test/programs/dates/Minute_DateTime.bas | 1 - .../programs/dates/Minute_DateTimeOffset.bas | 1 - src/test/programs/dates/Minutes.bas | 1 - src/test/programs/dates/Month_Date.bas | 1 - src/test/programs/dates/Month_DateTime.bas | 1 - .../programs/dates/Month_DateTimeOffset.bas | 1 - src/test/programs/dates/Second_DateTime.bas | 1 - src/test/programs/dates/Seconds.bas | 1 - src/test/programs/dates/TimeZoneFromName.bas | 1 - .../programs/dates/TotalDays_and_friends.bas | 1 - src/test/programs/dates/Year_Date.bas | 1 - src/test/programs/dates/Year_DateTime.bas | 1 - .../programs/dates/Year_DateTimeOffset.bas | 1 - .../dates/convert_date_as_datetime.bas | 1 - .../dates/convert_datetime_as_date.bas | 1 - .../dates/convert_datetimeoffset_as_date.bas | 1 - .../convert_datetimeoffset_as_datetime.bas | 1 - src/test/programs/disk/FileExists.bas | 1 - src/test/programs/disk/PathCombine.bas | 1 - .../disk/PathDirectoryName_PathFileName.bas | 1 - .../disk/ReadFileBytes_WriteFileBytes.bas | 1 - .../disk/ReadFileLines_WriteFileLines.bas | 1 - .../ReadFileText_WriteFileText_DeleteFile.bas | 1 - src/test/programs/disk/directories.bas | 1 - .../errors/ErrorCode_ErrorMessage.bas | 1 - src/test/programs/errors/rethrow.bas | 1 - .../errors/throw_caught_in_same_sub.bas | 1 - .../errors/throw_from_catch_block.bas | 1 - .../programs/errors/throw_from_function.bas | 2 - src/test/programs/errors/throw_from_sub.bas | 2 - src/test/programs/errors/throw_nested.bas | 1 - src/test/programs/errors/throw_uncaught.bas | 1 - .../errors/throw_uncaught_without_code.bas | 1 - src/test/programs/forms/ControlBounds_1.bas | 1 - src/test/programs/forms/ControlBounds_2.bas | 1 - src/test/programs/forms/ControlBounds_3.bas | 1 - src/test/programs/forms/Rectangle_1.bas | 1 - src/test/programs/forms/Rectangle_2.bas | 1 - src/test/programs/if/if_else_if.bas | 1 - src/test/programs/if/if_else_if_else.bas | 1 - src/test/programs/if/if_only.bas | 1 - src/test/programs/if/if_short_form.bas | 1 - src/test/programs/input/input_date.bas | 1 - src/test/programs/input/input_number_1.bas | 1 - src/test/programs/input/input_number_2.bas | 1 - src/test/programs/input/input_string_1.bas | 1 - src/test/programs/input/input_string_2.bas | 1 - src/test/programs/lists/Concat.bas | 1 - src/test/programs/lists/First_doc.bas | 2 - src/test/programs/lists/First_number_1.bas | 1 - src/test/programs/lists/First_number_2.bas | 1 - src/test/programs/lists/First_string_1.bas | 1 - src/test/programs/lists/First_string_2.bas | 1 - src/test/programs/lists/Last_number_1.bas | 1 - src/test/programs/lists/Last_number_2.bas | 1 - src/test/programs/lists/Last_string_1.bas | 1 - src/test/programs/lists/Last_string_2.bas | 1 - src/test/programs/lists/Len_list.bas | 1 - src/test/programs/lists/ListFill_doc.bas | 1 - src/test/programs/lists/ListFill_number_1.bas | 1 - src/test/programs/lists/ListFill_number_2.bas | 1 - src/test/programs/lists/ListFill_number_3.bas | 1 - src/test/programs/lists/ListFill_string_1.bas | 1 - src/test/programs/lists/ListFill_string_2.bas | 1 - src/test/programs/lists/ListFill_string_3.bas | 1 - src/test/programs/lists/Mid_doc.bas | 1 - src/test/programs/lists/Mid_number_1.bas | 1 - src/test/programs/lists/Mid_number_2.bas | 1 - src/test/programs/lists/Mid_number_3.bas | 1 - src/test/programs/lists/Mid_number_4.bas | 1 - src/test/programs/lists/Mid_number_5.bas | 1 - src/test/programs/lists/Mid_string_1.bas | 1 - src/test/programs/lists/Mid_string_2.bas | 1 - src/test/programs/lists/Mid_string_3.bas | 1 - src/test/programs/lists/Mid_string_4.bas | 1 - src/test/programs/lists/Mid_string_5.bas | 1 - .../programs/lists/RemoveAt_multiple_1.bas | 1 - .../programs/lists/RemoveAt_multiple_2.bas | 1 - .../programs/lists/RemoveAt_multiple_3.bas | 1 - .../programs/lists/RemoveAt_multiple_4.bas | 1 - src/test/programs/lists/RemoveAt_single_1.bas | 1 - src/test/programs/lists/RemoveAt_single_2.bas | 1 - src/test/programs/lists/RemoveAt_single_3.bas | 1 - src/test/programs/lists/Skip_doc.bas | 1 - src/test/programs/lists/Skip_number_1.bas | 1 - src/test/programs/lists/Skip_number_2.bas | 1 - src/test/programs/lists/Skip_number_3.bas | 1 - src/test/programs/lists/Skip_string_1.bas | 1 - src/test/programs/lists/Skip_string_2.bas | 1 - src/test/programs/lists/Skip_string_3.bas | 1 - src/test/programs/lists/Take_doc.bas | 1 - .../lists/dim_list_mismatched_yield_types.bas | 1 - .../programs/lists/dim_list_no_yields.bas | 1 - src/test/programs/lists/dim_list_number.bas | 1 - src/test/programs/lists/dim_list_string.bas | 1 - .../lists/dim_list_with_yield_map.bas | 1 - src/test/programs/lists/list_add_element.bas | 1 - src/test/programs/lists/list_add_list.bas | 1 - .../lists/list_add_mismatched_list.bas | 1 - src/test/programs/lists/list_index.bas | 1 - .../programs/lists/list_of_list_of_number.bas | 1 - src/test/programs/lists/list_set_1.bas | 1 - src/test/programs/lists/list_set_2.bas | 1 - .../plus_operator_list_of_list_of_number.bas | 1 - .../plus_operator_list_of_list_of_string.bas | 1 - .../lists/plus_operator_list_of_string.bas | 1 - .../programs/lists/yield_number_and_print.bas | 1 - .../programs/lists/yield_outside_dim_list.bas | 2 - src/test/programs/loops/continue_mismatch.bas | 1 - .../programs/loops/continue_outside_loop.bas | 1 - src/test/programs/loops/do.bas | 1 - src/test/programs/loops/do_continue.bas | 1 - src/test/programs/loops/do_exit.bas | 1 - .../loops/do_invalid_condition_type.bas | 1 - src/test/programs/loops/exit_mismatch.bas | 1 - src/test/programs/loops/exit_outside_loop.bas | 1 - src/test/programs/loops/for_continue.bas | 1 - .../programs/loops/for_each_early_return.bas | 1 - .../programs/loops/for_each_object_list.bas | 1 - src/test/programs/loops/for_each_string.bas | 1 - .../programs/loops/for_each_value_list.bas | 1 - src/test/programs/loops/for_exit.bas | 1 - src/test/programs/loops/for_loop.bas | 1 - src/test/programs/loops/while_continue.bas | 1 - src/test/programs/loops/while_exit.bas | 1 - src/test/programs/loops/while_loop.bas | 1 - src/test/programs/maps/ContainsKey_doc_1.bas | 1 - .../ContainsKey_map_number_to_number_1.bas | 1 - .../ContainsKey_map_number_to_number_2.bas | 1 - .../ContainsKey_map_number_to_number_3.bas | 1 - .../ContainsKey_map_string_to_number_1.bas | 1 - .../ContainsKey_map_string_to_number_2.bas | 1 - .../ContainsKey_map_string_to_number_3.bas | 1 - .../maps/Find_map_number_to_number_1.bas | 1 - .../maps/Find_map_number_to_number_2.bas | 1 - .../maps/Find_map_number_to_string_1.bas | 1 - .../maps/Find_map_number_to_string_2.bas | 1 - .../maps/Find_map_string_to_number_1.bas | 1 - .../maps/Find_map_string_to_number_2.bas | 1 - .../maps/Find_map_string_to_string_1.bas | 1 - .../maps/Find_map_string_to_string_2.bas | 1 - src/test/programs/maps/Len_map.bas | 1 - .../programs/maps/Map_minus_operator_1.bas | 1 - .../programs/maps/Map_minus_operator_2.bas | 1 - .../programs/maps/Map_plus_operator_1.bas | 1 - .../programs/maps/Map_plus_operator_2.bas | 1 - .../programs/maps/Map_plus_operator_3.bas | 1 - .../programs/maps/dim_map_with_yield_list.bas | 1 - .../maps/map_number_number_not_found.bas | 1 - .../programs/maps/map_number_number_set.bas | 1 - .../maps/map_number_record_not_found.bas | 1 - .../programs/maps/map_number_record_set_1.bas | 1 - .../programs/maps/map_number_record_set_2.bas | 1 - .../programs/maps/map_number_record_set_3.bas | 1 - .../maps/map_number_string_not_found.bas | 1 - .../programs/maps/map_number_string_set.bas | 1 - .../maps/map_record_record_not_found.bas | 1 - .../programs/maps/map_record_record_set_1.bas | 1 - .../programs/maps/map_record_record_set_2.bas | 1 - .../programs/maps/map_record_record_set_3.bas | 1 - .../maps/map_string_number_not_found.bas | 1 - .../programs/maps/map_string_number_set.bas | 1 - .../maps/map_string_record_not_found.bas | 1 - .../programs/maps/map_string_record_set_1.bas | 1 - .../programs/maps/map_string_record_set_2.bas | 1 - .../programs/maps/map_string_record_set_3.bas | 1 - .../maps/map_string_string_not_found.bas | 1 - .../programs/maps/map_string_string_set.bas | 1 - .../programs/misc/comment_after_global.bas | 2 - src/test/programs/misc/comment_after_sub.bas | 1 - .../programs/misc/comment_before_global.bas | 2 - src/test/programs/misc/comment_before_sub.bas | 1 - src/test/programs/misc/empty_main.bas | 1 - .../programs/misc/global_value_number.bas | 2 - .../programs/misc/global_value_string.bas | 2 - src/test/programs/misc/hello_world.bas | 1 - src/test/programs/misc/input_string.bas | 1 - .../misc/main_not_first_in_program.bas | 2 - src/test/programs/misc/pascal_triangle.bas | 1 - src/test/programs/numbers/Ceil.bas | 1 - src/test/programs/numbers/Floor.bas | 1 - .../numbers/convert_number_as_string.bas | 1 - src/test/programs/numbers/math_functions.bas | 1 - src/test/programs/numbers/not_Number.bas | 1 - .../programs/numbers/number_comparison.bas | 1 - .../programs/optionals/HasValue_number_1.bas | 1 - .../programs/optionals/HasValue_number_2.bas | 1 - .../programs/optionals/HasValue_string_1.bas | 1 - .../programs/optionals/HasValue_string_2.bas | 1 - .../programs/optionals/Value_number_1.bas | 1 - .../programs/optionals/Value_number_2.bas | 1 - .../programs/optionals/Value_string_1.bas | 1 - .../programs/optionals/Value_string_2.bas | 1 - .../optionals/convert_number_as_optional.bas | 1 - .../programs/optionals/optional_assign.bas | 1 - .../programs/optionals/optional_parameter.bas | 2 - src/test/programs/print/print.bas | 1 - src/test/programs/print/print_number.bas | 1 - .../procedure_calls/call_function_one_arg.bas | 2 - .../procedure_calls/call_function_two_arg.bas | 2 - .../call_function_zero_arg.bas | 2 - .../programs/procedure_calls/call_sub.bas | 2 - .../programs/procedure_calls/call_sub_arg.bas | 2 - .../early_return_dim_list_1.bas | 2 - .../early_return_dim_list_2.bas | 2 - .../early_return_dim_list_3.bas | 2 - .../early_return_dim_map_1.bas | 2 - .../early_return_dim_map_2.bas | 2 - .../early_return_dim_map_3.bas | 2 - .../early_return_dim_set_1.bas | 2 - .../early_return_dim_set_2.bas | 2 - .../early_return_dim_set_3.bas | 2 - .../procedure_calls/early_return_do_1.bas | 2 - .../procedure_calls/early_return_do_2.bas | 2 - .../procedure_calls/early_return_do_3.bas | 2 - .../procedure_calls/early_return_do_4.bas | 2 - .../procedure_calls/early_return_do_5.bas | 2 - .../early_return_do_exit_1.bas | 2 - .../early_return_do_exit_2.bas | 2 - .../early_return_do_exit_3.bas | 2 - .../early_return_do_exit_4.bas | 2 - .../early_return_do_exit_5.bas | 2 - .../procedure_calls/early_return_if_1.bas | 2 - .../procedure_calls/early_return_if_2.bas | 2 - .../procedure_calls/early_return_if_3.bas | 2 - .../procedure_calls/early_return_if_4.bas | 2 - .../early_return_select_case_1.bas | 2 - .../early_return_select_case_2.bas | 2 - .../early_return_select_case_3.bas | 2 - .../early_return_select_case_4.bas | 2 - .../early_return_select_case_5.bas | 2 - .../early_return_select_case_6.bas | 2 - .../early_return_select_case_7.bas | 2 - .../early_return_select_case_8.bas | 2 - .../procedure_calls/early_return_try_1.bas | 2 - .../procedure_calls/early_return_try_2.bas | 2 - .../procedure_calls/early_return_try_3.bas | 2 - .../procedure_calls/early_return_try_4.bas | 2 - .../procedure_calls/early_return_try_5.bas | 2 - .../procedure_calls/early_return_try_6.bas | 2 - .../procedure_calls/early_return_try_7.bas | 2 - .../procedure_calls/early_return_try_8.bas | 2 - .../early_return_while_false_1.bas | 2 - .../early_return_while_false_2.bas | 2 - .../early_return_while_true_1.bas | 2 - .../early_return_while_true_2.bas | 2 - .../function_with_no_parameters_1.bas | 2 - .../function_with_no_parameters_2.bas | 2 - .../missing_return_empty_function.bas | 2 - .../return_nothing_in_function.bas | 2 - .../return_value_in_subroutine.bas | 2 - .../procedure_calls/wrong_return_type.bas | 2 - ..._to_named_record_conversion_inside_for.bas | 2 - ...named_record_conversion_inside_foreach.bas | 2 - ...s_to_named_record_conversion_inside_if.bas | 2 - ...o_named_record_conversion_inside_while.bas | 2 - ..._named_record_conversion_outside_block.bas | 2 - ...st_of_named_record_explicit_conversion.bas | 3 - .../programs/records/named_record_type_1.bas | 2 - .../programs/records/named_record_type_2.bas | 3 - src/test/programs/records/record_default.bas | 1 - .../programs/records/record_field_get_1.bas | 1 - .../programs/records/record_field_get_2.bas | 1 - .../programs/records/record_field_get_3.bas | 1 - .../programs/records/record_field_get_4.bas | 1 - .../programs/records/record_field_get_5.bas | 1 - .../programs/records/record_field_get_6.bas | 1 - .../programs/records/record_field_get_7.bas | 2 - .../programs/records/record_field_get_8.bas | 2 - .../programs/records/record_field_set.bas | 1 - .../programs/records/record_list_field.bas | 1 - src/test/programs/records/record_literal.bas | 1 - src/test/programs/records/record_named_1.bas | 2 - src/test/programs/records/record_named_2.bas | 2 - src/test/programs/records/record_named_3.bas | 2 - src/test/programs/records/record_named_4.bas | 2 - src/test/programs/records/record_named_5.bas | 2 - src/test/programs/records/record_named_6.bas | 2 - src/test/programs/records/record_named_7.bas | 2 - src/test/programs/records/record_nested.bas | 1 - src/test/programs/records/record_print.bas | 1 - .../records/return_named_record_1.bas | 3 - .../records/return_named_record_2.bas | 3 - ...ecord_explicitly_converted_to_optional.bas | 3 - ...ecord_implicitly_converted_to_optional.bas | 3 - .../samples/advent_of_code_2023_day1.bas | 7 -- .../samples/advent_of_code_2023_day2.bas | 6 -- .../advent_of_code_2023_day3_part1.bas | 4 - .../advent_of_code_2023_day3_part2.bas | 5 - .../advent_of_code_2023_day4_part1.bas | 1 - .../advent_of_code_2023_day4_part2.bas | 1 - .../advent_of_code_2023_day5_part1.bas | 7 -- .../advent_of_code_2023_day5_part2.bas | 10 -- .../advent_of_code_2023_day6_part1.bas | 2 - src/test/programs/samples/euler_1.bas | 1 - src/test/programs/samples/euler_2.bas | 1 - src/test/programs/samples/euler_3.bas | 1 - src/test/programs/samples/euler_4.bas | 2 - src/test/programs/samples/euler_5.bas | 3 - src/test/programs/samples/euler_6.bas | 1 - src/test/programs/samples/euler_7.bas | 2 - .../select_case_list_of_number.bas | 1 - .../select_case_multiple_case_else.bas | 1 - .../select_case/select_case_number.bas | 1 - .../select_case/select_case_number_range.bas | 1 - .../select_case/select_case_string.bas | 1 - .../select_case/select_case_string_range.bas | 1 - .../select_case/select_case_type_mismatch.bas | 1 - .../programs/sets/Contains_set_number.bas | 1 - .../programs/sets/Contains_set_string.bas | 1 - src/test/programs/sets/Len_set.bas | 1 - src/test/programs/sets/Set_number_empty.bas | 1 - .../sets/Set_number_minus_operator.bas | 1 - .../sets/Set_number_plus_operator_1.bas | 1 - .../sets/Set_number_plus_operator_2.bas | 1 - src/test/programs/sets/Set_string_empty.bas | 1 - .../sets/Set_string_minus_operator.bas | 1 - .../sets/Set_string_plus_operator_1.bas | 1 - .../sets/Set_string_plus_operator_2.bas | 1 - src/test/programs/sets/Values_set_1.bas | 1 - src/test/programs/sets/Values_set_2.bas | 1 - .../sets/dim_set_duplicate_number.bas | 1 - .../sets/dim_set_duplicate_string.bas | 1 - src/test/programs/strings/Characters_1.bas | 1 - src/test/programs/strings/Chr.bas | 1 - src/test/programs/strings/CodePoints.bas | 1 - src/test/programs/strings/CodeUnit.bas | 1 - src/test/programs/strings/CodeUnits.bas | 1 - src/test/programs/strings/IsDigit.bas | 1 - src/test/programs/strings/Len_string.bas | 1 - src/test/programs/strings/ParseNumber_1.bas | 1 - src/test/programs/strings/ParseNumber_2.bas | 1 - src/test/programs/strings/ParseNumber_3.bas | 1 - src/test/programs/strings/Replace_1.bas | 1 - src/test/programs/strings/Replace_2.bas | 1 - src/test/programs/strings/Split_1.bas | 1 - src/test/programs/strings/Split_2.bas | 1 - .../programs/strings/StringFromCodeUnits.bas | 1 - src/test/programs/strings/crlf.bas | 1 - src/test/programs/strings/string_concat.bas | 1 - .../programs/variables/dim_list_scopes.bas | 1 - .../programs/variables/dim_map_scopes.bas | 1 - .../programs/variables/dim_set_scopes.bas | 1 - src/test/programs/variables/if_scopes.bas | 1 - src/test/programs/variables/nested_scopes.bas | 1 - src/test/programs/variables/try_scopes.bas | 1 - 391 files changed, 51 insertions(+), 575 deletions(-) diff --git a/src/compiler/SourceProgram.cpp b/src/compiler/SourceProgram.cpp index 6b9bd758..042fed72 100644 --- a/src/compiler/SourceProgram.cpp +++ b/src/compiler/SourceProgram.cpp @@ -87,8 +87,7 @@ static void loadEndCurrentBlock( for (auto& line : *currentBlock) { s << line << "\n"; } - members->push_back(std::make_unique( - currentMemberType, boost::trim_copy(boost::replace_all_copy(s.str(), "##", "#")) + "\n", 0, 0)); + members->push_back(std::make_unique(currentMemberType, boost::trim_copy(s.str()) + "\n", 0, 0)); currentBlock->clear(); } } @@ -106,6 +105,23 @@ void SourceProgram::load(const std::string& filePath) { loadFromContent(s.str()); } +static void eatLinesUntilEnd( + std::istringstream* stream, + std::vector* currentBlock, + const std::string& endPhrase) { + std::string line; + while (std::getline(*stream, line)) { + currentBlock->push_back(line); + + // The end phrase is case insensitive. + auto lc = boost::to_lower_copy(line); + + if (lc.find(endPhrase) == 0) { + return; + } + } +} + void SourceProgram::loadFromContent(const std::string& content) { // If this has Windows CRLF line endings, convert it to Unix LF line endings. if (content.find("\r\n") != std::string::npos) { @@ -121,62 +137,50 @@ void SourceProgram::loadFromContent(const std::string& content) { std::string line; while (std::getline(file, line)) { - auto isBlockDone = false; - SourceMemberType memberType; // set this when setting isBlockDone=true - - if (line.find("#design") == 0) { - memberType = SourceMemberType::kDesign; - isBlockDone = true; - } else if (line.find("#global") == 0) { - memberType = SourceMemberType::kGlobal; - isBlockDone = true; - } else if (line.find("#picture") == 0) { - memberType = SourceMemberType::kPicture; - isBlockDone = true; - } else if (line.find("#procedure") == 0) { - memberType = SourceMemberType::kProcedure; - isBlockDone = true; - } else if (line.find("#type") == 0) { - memberType = SourceMemberType::kType; - isBlockDone = true; - } + currentBlock.push_back(line); + + // These keywords are case insensitive. + auto lc = boost::to_lower_copy(line); - if (isBlockDone) { + // Detect the type of block by the starting keyword. + // There can be comment lines above this. + if (lc.find("design") == 0) { + currentMemberType = SourceMemberType::kDesign; + eatLinesUntilEnd(&file, ¤tBlock, "end design"); + loadEndCurrentBlock(¤tBlock, &members, currentMemberType); + } else if (lc.find("dim") == 0 || line.find("const") == 0) { + currentMemberType = SourceMemberType::kGlobal; + loadEndCurrentBlock(¤tBlock, &members, currentMemberType); + } else if (lc.find("picture") == 0) { + currentMemberType = SourceMemberType::kPicture; + eatLinesUntilEnd(&file, ¤tBlock, "end picture"); + loadEndCurrentBlock(¤tBlock, &members, currentMemberType); + } else if (lc.find("sub") == 0) { + currentMemberType = SourceMemberType::kProcedure; + eatLinesUntilEnd(&file, ¤tBlock, "end sub"); + loadEndCurrentBlock(¤tBlock, &members, currentMemberType); + } else if (lc.find("function") == 0) { + currentMemberType = SourceMemberType::kProcedure; + eatLinesUntilEnd(&file, ¤tBlock, "end function"); + loadEndCurrentBlock(¤tBlock, &members, currentMemberType); + } else if (lc.find("type") == 0) { + currentMemberType = SourceMemberType::kType; + eatLinesUntilEnd(&file, ¤tBlock, "end type"); loadEndCurrentBlock(¤tBlock, &members, currentMemberType); - currentMemberType = memberType; - } else { - currentBlock.push_back(line); } } - loadEndCurrentBlock(¤tBlock, &members, currentMemberType); + // If there's anything in currentBlock, it's lines at the end that didn't include the start of a block. + // We will just discard those lines. + // Conveniently, when opening our own test programs, these discarded lines are the expected output that is invalid + // TMBASIC code anyway. } void SourceProgram::save(const std::string& filePath) const { auto stream = std::ofstream(filePath); for (const auto* member : sortMembers(this)) { - switch (member->memberType) { - case SourceMemberType::kDesign: - stream << "#design"; - break; - case SourceMemberType::kGlobal: - stream << "#global"; - break; - case SourceMemberType::kPicture: - stream << "#picture"; - break; - case SourceMemberType::kProcedure: - stream << "#procedure"; - break; - case SourceMemberType::kType: - stream << "#type"; - break; - default: - assert(false); - break; - } - stream << "\n" << boost::trim_copy(boost::replace_all_copy(member->source, "#", "##")) << "\n\n"; + stream << boost::trim_copy(member->source) << "\n\n"; } } diff --git a/src/test/programs/assignments/assign_dotted_1.bas b/src/test/programs/assignments/assign_dotted_1.bas index 2cd11c18..8279b92c 100644 --- a/src/test/programs/assignments/assign_dotted_1.bas +++ b/src/test/programs/assignments/assign_dotted_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1] x(0) = 2 diff --git a/src/test/programs/assignments/assign_dotted_2.bas b/src/test/programs/assignments/assign_dotted_2.bas index 72b8ef41..3b40a926 100644 --- a/src/test/programs/assignments/assign_dotted_2.bas +++ b/src/test/programs/assignments/assign_dotted_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim y = ["A"] y(0) = "B" diff --git a/src/test/programs/assignments/assign_dotted_3.bas b/src/test/programs/assignments/assign_dotted_3.bas index d885d794..dfb67c01 100644 --- a/src/test/programs/assignments/assign_dotted_3.bas +++ b/src/test/programs/assignments/assign_dotted_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [{ foo: 111 }] x(0).foo = 999 diff --git a/src/test/programs/assignments/assign_dotted_4.bas b/src/test/programs/assignments/assign_dotted_4.bas index 5e95ed5b..391f5fad 100644 --- a/src/test/programs/assignments/assign_dotted_4.bas +++ b/src/test/programs/assignments/assign_dotted_4.bas @@ -1,6 +1,4 @@ -#global dim x = [{ foo: 111 }] -#procedure sub Main() x(0).foo = 999 print x(0).foo diff --git a/src/test/programs/assignments/assign_dotted_5.bas b/src/test/programs/assignments/assign_dotted_5.bas index b02dbb03..925c27a3 100644 --- a/src/test/programs/assignments/assign_dotted_5.bas +++ b/src/test/programs/assignments/assign_dotted_5.bas @@ -1,6 +1,4 @@ -#global dim x as List of Record(foo as Number) -#procedure sub Main() print Len(x) x = [{ foo: 111 }] diff --git a/src/test/programs/assignments/assign_list.bas b/src/test/programs/assignments/assign_list.bas index 76cc137e..7e298a29 100644 --- a/src/test/programs/assignments/assign_list.bas +++ b/src/test/programs/assignments/assign_list.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a as List of Number print Len(a) diff --git a/src/test/programs/assignments/assign_string.bas b/src/test/programs/assignments/assign_string.bas index 38eadb1d..5b5c34b9 100644 --- a/src/test/programs/assignments/assign_string.bas +++ b/src/test/programs/assignments/assign_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a as String a = "hello" diff --git a/src/test/programs/assignments/variable_shadowing_function.bas b/src/test/programs/assignments/variable_shadowing_function.bas index df18627f..0d38ef5e 100644 --- a/src/test/programs/assignments/variable_shadowing_function.bas +++ b/src/test/programs/assignments/variable_shadowing_function.bas @@ -1,9 +1,7 @@ -#procedure function Foo() as String return "hello" end function -#procedure sub Main() dim foo = Foo() print foo diff --git a/src/test/programs/assignments/variable_string.bas b/src/test/programs/assignments/variable_string.bas index 33a8f580..01ebe9eb 100644 --- a/src/test/programs/assignments/variable_string.bas +++ b/src/test/programs/assignments/variable_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = "hi" print x diff --git a/src/test/programs/booleans/and_or_short_circuit.bas b/src/test/programs/booleans/and_or_short_circuit.bas index 67a19dd4..942eadc7 100644 --- a/src/test/programs/booleans/and_or_short_circuit.bas +++ b/src/test/programs/booleans/and_or_short_circuit.bas @@ -1,9 +1,7 @@ -#procedure function AlwaysThrows() as Boolean print "should not have called this!" throw 1, "error" end function -#procedure sub Main() if true or AlwaysThrows() then print "1 good" diff --git a/src/test/programs/booleans/binary_operators_boolean.bas b/src/test/programs/booleans/binary_operators_boolean.bas index 81ba4994..4a0ce170 100644 --- a/src/test/programs/booleans/binary_operators_boolean.bas +++ b/src/test/programs/booleans/binary_operators_boolean.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print "and" print true and true diff --git a/src/test/programs/booleans/boolean_literal.bas b/src/test/programs/booleans/boolean_literal.bas index 8e8d2d62..84a2e3b2 100644 --- a/src/test/programs/booleans/boolean_literal.bas +++ b/src/test/programs/booleans/boolean_literal.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print true print false diff --git a/src/test/programs/booleans/if_false.bas b/src/test/programs/booleans/if_false.bas index 6c27d164..e7ae951b 100644 --- a/src/test/programs/booleans/if_false.bas +++ b/src/test/programs/booleans/if_false.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Boolean if x then diff --git a/src/test/programs/booleans/not_Boolean.bas b/src/test/programs/booleans/not_Boolean.bas index fad8743f..2e38f23b 100644 --- a/src/test/programs/booleans/not_Boolean.bas +++ b/src/test/programs/booleans/not_Boolean.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = true print not a diff --git a/src/test/programs/console/print_anonymous_record.bas b/src/test/programs/console/print_anonymous_record.bas index 5898cdfe..fa903506 100644 --- a/src/test/programs/console/print_anonymous_record.bas +++ b/src/test/programs/console/print_anonymous_record.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print { foo: 4, bar: 5 } end sub diff --git a/src/test/programs/console/print_boolean.bas b/src/test/programs/console/print_boolean.bas index f6ceda3b..77791927 100644 --- a/src/test/programs/console/print_boolean.bas +++ b/src/test/programs/console/print_boolean.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print true print false diff --git a/src/test/programs/console/print_date.bas b/src/test/programs/console/print_date.bas index eb8e7949..48971aa3 100644 --- a/src/test/programs/console/print_date.bas +++ b/src/test/programs/console/print_date.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print DateFromParts(2019, 2, 9) end sub diff --git a/src/test/programs/console/print_datetime.bas b/src/test/programs/console/print_datetime.bas index feaa564c..935b9fd4 100644 --- a/src/test/programs/console/print_datetime.bas +++ b/src/test/programs/console/print_datetime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print DateTimeFromParts(2019, 2, 9, 14, 30, 59, 488) end sub diff --git a/src/test/programs/console/print_datetimeoffset.bas b/src/test/programs/console/print_datetimeoffset.bas index 5dfc9230..9bb41b18 100644 --- a/src/test/programs/console/print_datetimeoffset.bas +++ b/src/test/programs/console/print_datetimeoffset.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print DateTimeOffsetFromParts(2019, 2, 9, 14, 30, 59, 488, Hours(-4)) end sub diff --git a/src/test/programs/console/print_list_number.bas b/src/test/programs/console/print_list_number.bas index e903434f..2c1d62b5 100644 --- a/src/test/programs/console/print_list_number.bas +++ b/src/test/programs/console/print_list_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print [ 1, 2, 3 ] end sub diff --git a/src/test/programs/console/print_map_number_to_number.bas b/src/test/programs/console/print_map_number_to_number.bas index e962b8f8..347f1bda 100644 --- a/src/test/programs/console/print_map_number_to_number.bas +++ b/src/test/programs/console/print_map_number_to_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Map from Number to Number x(5) = 6 diff --git a/src/test/programs/console/print_named_record.bas b/src/test/programs/console/print_named_record.bas index bfb3ef18..cd47fbe6 100644 --- a/src/test/programs/console/print_named_record.bas +++ b/src/test/programs/console/print_named_record.bas @@ -1,10 +1,8 @@ -#type type MyRecord foo as Number bar as Number end type -#procedure sub Main() dim x = { foo: 4, bar: 5 } as MyRecord print x diff --git a/src/test/programs/console/print_number.bas b/src/test/programs/console/print_number.bas index 1e378b28..48716ef4 100644 --- a/src/test/programs/console/print_number.bas +++ b/src/test/programs/console/print_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print 5 end sub diff --git a/src/test/programs/console/print_optional_number.bas b/src/test/programs/console/print_optional_number.bas index dc8334a6..adb94e7e 100644 --- a/src/test/programs/console/print_optional_number.bas +++ b/src/test/programs/console/print_optional_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional Number print x diff --git a/src/test/programs/console/print_set_number.bas b/src/test/programs/console/print_set_number.bas index 51882ca1..50daad53 100644 --- a/src/test/programs/console/print_set_number.bas +++ b/src/test/programs/console/print_set_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Set of Number x = x + 6 diff --git a/src/test/programs/console/print_string.bas b/src/test/programs/console/print_string.bas index ccd150d2..caa9f92e 100644 --- a/src/test/programs/console/print_string.bas +++ b/src/test/programs/console/print_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print "hi" end sub diff --git a/src/test/programs/constants/built_in_constants.bas b/src/test/programs/constants/built_in_constants.bas index 96680a69..08fc0690 100644 --- a/src/test/programs/constants/built_in_constants.bas +++ b/src/test/programs/constants/built_in_constants.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print "PI="; PI print "EULER="; EULER diff --git a/src/test/programs/constants/const_global.bas b/src/test/programs/constants/const_global.bas index 5a50e875..3274b876 100644 --- a/src/test/programs/constants/const_global.bas +++ b/src/test/programs/constants/const_global.bas @@ -1,10 +1,6 @@ -#global const NUM_CONST = 123 -#global const STR_CONST = "hello" -#global const BOOL_CONST = true -#procedure sub Main() print NUM_CONST print STR_CONST diff --git a/src/test/programs/constants/const_global_cannot_assign.bas b/src/test/programs/constants/const_global_cannot_assign.bas index 4199b0cd..de5b110f 100644 --- a/src/test/programs/constants/const_global_cannot_assign.bas +++ b/src/test/programs/constants/const_global_cannot_assign.bas @@ -1,6 +1,4 @@ -#global const MYCONST = 123 -#procedure sub Main() MYCONST = 20 end sub diff --git a/src/test/programs/constants/const_local.bas b/src/test/programs/constants/const_local.bas index b3257aab..26ca548d 100644 --- a/src/test/programs/constants/const_local.bas +++ b/src/test/programs/constants/const_local.bas @@ -1,4 +1,3 @@ -#procedure sub Main() const NUM_CONST = 123 print NUM_CONST diff --git a/src/test/programs/constants/const_local_cannot_assign.bas b/src/test/programs/constants/const_local_cannot_assign.bas index ebec0f68..047c4634 100644 --- a/src/test/programs/constants/const_local_cannot_assign.bas +++ b/src/test/programs/constants/const_local_cannot_assign.bas @@ -1,4 +1,3 @@ -#procedure sub Main() const MYCONST = 10 MYCONST = 20 diff --git a/src/test/programs/dates/DateFromParts.bas b/src/test/programs/dates/DateFromParts.bas index d7a25b2c..dd83bb40 100644 --- a/src/test/programs/dates/DateFromParts.bas +++ b/src/test/programs/dates/DateFromParts.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print DateFromParts(1776, 7, 4) end sub diff --git a/src/test/programs/dates/DateTimeFromParts.bas b/src/test/programs/dates/DateTimeFromParts.bas index 8fdcc526..f0f6a4bc 100644 --- a/src/test/programs/dates/DateTimeFromParts.bas +++ b/src/test/programs/dates/DateTimeFromParts.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print DateTimeFromParts(1776, 7, 4, 5, 15, 30, 450) end sub diff --git a/src/test/programs/dates/DateTimeOffsetFromParts.bas b/src/test/programs/dates/DateTimeOffsetFromParts.bas index 4cbaa99a..4398661e 100644 --- a/src/test/programs/dates/DateTimeOffsetFromParts.bas +++ b/src/test/programs/dates/DateTimeOffsetFromParts.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim offset = Hours(-6) dim x = DateTimeOffsetFromParts(2021, 3, 12, 4, 30, 0, 0, offset) diff --git a/src/test/programs/dates/Day_Date.bas b/src/test/programs/dates/Day_Date.bas index cd1ae74e..f597f79c 100644 --- a/src/test/programs/dates/Day_Date.bas +++ b/src/test/programs/dates/Day_Date.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateFromParts(2023, 12, 25) print Day(x) diff --git a/src/test/programs/dates/Day_DateTime.bas b/src/test/programs/dates/Day_DateTime.bas index 0390e3ec..be7a695c 100644 --- a/src/test/programs/dates/Day_DateTime.bas +++ b/src/test/programs/dates/Day_DateTime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeFromParts(2021, 3, 12, 4, 30, 0, 0) print Day(x) diff --git a/src/test/programs/dates/Day_DateTimeOffset.bas b/src/test/programs/dates/Day_DateTimeOffset.bas index f72e03cf..fd8faeda 100644 --- a/src/test/programs/dates/Day_DateTimeOffset.bas +++ b/src/test/programs/dates/Day_DateTimeOffset.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeOffsetFromParts(2021, 3, 12, 4, 30, 59, 488, Hours(-4)) print Day(x) diff --git a/src/test/programs/dates/Days.bas b/src/test/programs/dates/Days.bas index db794104..ed6656a5 100644 --- a/src/test/programs/dates/Days.bas +++ b/src/test/programs/dates/Days.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Days(1.5) end sub diff --git a/src/test/programs/dates/Hour_DateTime.bas b/src/test/programs/dates/Hour_DateTime.bas index 3d3d90de..36465fd1 100644 --- a/src/test/programs/dates/Hour_DateTime.bas +++ b/src/test/programs/dates/Hour_DateTime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeFromParts(2021, 3, 12, 14, 30, 0, 0) print Hour(x) diff --git a/src/test/programs/dates/Hour_DateTimeOffset.bas b/src/test/programs/dates/Hour_DateTimeOffset.bas index e96ff4c3..cc6502e3 100644 --- a/src/test/programs/dates/Hour_DateTimeOffset.bas +++ b/src/test/programs/dates/Hour_DateTimeOffset.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeOffsetFromParts(2021, 3, 12, 14, 30, 59, 488, Hours(-4)) print Hour(x) diff --git a/src/test/programs/dates/Hours.bas b/src/test/programs/dates/Hours.bas index 207e9914..54118405 100644 --- a/src/test/programs/dates/Hours.bas +++ b/src/test/programs/dates/Hours.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Hours(1.5) end sub diff --git a/src/test/programs/dates/Millisecond_DateTime.bas b/src/test/programs/dates/Millisecond_DateTime.bas index 1e5f9555..424519ac 100644 --- a/src/test/programs/dates/Millisecond_DateTime.bas +++ b/src/test/programs/dates/Millisecond_DateTime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeFromParts(2021, 3, 12, 14, 30, 59, 488) print Millisecond(x) diff --git a/src/test/programs/dates/Millisecond_DateTimeOffset.bas b/src/test/programs/dates/Millisecond_DateTimeOffset.bas index 5ed7c5b9..6117621e 100644 --- a/src/test/programs/dates/Millisecond_DateTimeOffset.bas +++ b/src/test/programs/dates/Millisecond_DateTimeOffset.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeOffsetFromParts(2021, 3, 12, 4, 30, 59, 488, Hours(-4)) print Millisecond(x) diff --git a/src/test/programs/dates/Milliseconds.bas b/src/test/programs/dates/Milliseconds.bas index a5dd7e05..44e67789 100644 --- a/src/test/programs/dates/Milliseconds.bas +++ b/src/test/programs/dates/Milliseconds.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Milliseconds(1.5) end sub diff --git a/src/test/programs/dates/Minute_DateTime.bas b/src/test/programs/dates/Minute_DateTime.bas index ce143a98..76bb37f5 100644 --- a/src/test/programs/dates/Minute_DateTime.bas +++ b/src/test/programs/dates/Minute_DateTime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeFromParts(2021, 3, 12, 14, 30, 0, 0) print Minute(x) diff --git a/src/test/programs/dates/Minute_DateTimeOffset.bas b/src/test/programs/dates/Minute_DateTimeOffset.bas index be6736d6..b5e0d863 100644 --- a/src/test/programs/dates/Minute_DateTimeOffset.bas +++ b/src/test/programs/dates/Minute_DateTimeOffset.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeOffsetFromParts(2021, 3, 12, 4, 30, 59, 488, Hours(-4)) print Minute(x) diff --git a/src/test/programs/dates/Minutes.bas b/src/test/programs/dates/Minutes.bas index 2cc43277..4094bc1a 100644 --- a/src/test/programs/dates/Minutes.bas +++ b/src/test/programs/dates/Minutes.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Minutes(1.5) end sub diff --git a/src/test/programs/dates/Month_Date.bas b/src/test/programs/dates/Month_Date.bas index c3c9d89a..49e1e7de 100644 --- a/src/test/programs/dates/Month_Date.bas +++ b/src/test/programs/dates/Month_Date.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateFromParts(2023, 12, 25) print Month(x) diff --git a/src/test/programs/dates/Month_DateTime.bas b/src/test/programs/dates/Month_DateTime.bas index 3dc2a232..216a82b6 100644 --- a/src/test/programs/dates/Month_DateTime.bas +++ b/src/test/programs/dates/Month_DateTime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeFromParts(2021, 3, 12, 4, 30, 0, 0) print Month(x) diff --git a/src/test/programs/dates/Month_DateTimeOffset.bas b/src/test/programs/dates/Month_DateTimeOffset.bas index 951ebdd9..4e05da01 100644 --- a/src/test/programs/dates/Month_DateTimeOffset.bas +++ b/src/test/programs/dates/Month_DateTimeOffset.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeOffsetFromParts(2021, 3, 12, 4, 30, 59, 488, Hours(-4)) print Month(x) diff --git a/src/test/programs/dates/Second_DateTime.bas b/src/test/programs/dates/Second_DateTime.bas index 44fab8b0..9a395de5 100644 --- a/src/test/programs/dates/Second_DateTime.bas +++ b/src/test/programs/dates/Second_DateTime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeFromParts(2021, 3, 12, 14, 30, 59, 488) print Second(x) diff --git a/src/test/programs/dates/Seconds.bas b/src/test/programs/dates/Seconds.bas index f7752951..78cdcd71 100644 --- a/src/test/programs/dates/Seconds.bas +++ b/src/test/programs/dates/Seconds.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Seconds(1.5) end sub diff --git a/src/test/programs/dates/TimeZoneFromName.bas b/src/test/programs/dates/TimeZoneFromName.bas index 07a1962a..e33ba930 100644 --- a/src/test/programs/dates/TimeZoneFromName.bas +++ b/src/test/programs/dates/TimeZoneFromName.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print TimeZoneFromName("America/New_York") end sub diff --git a/src/test/programs/dates/TotalDays_and_friends.bas b/src/test/programs/dates/TotalDays_and_friends.bas index d8ee5caa..01b39c56 100644 --- a/src/test/programs/dates/TotalDays_and_friends.bas +++ b/src/test/programs/dates/TotalDays_and_friends.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = Hours(36) print TotalDays(x) diff --git a/src/test/programs/dates/Year_Date.bas b/src/test/programs/dates/Year_Date.bas index 3ff1b962..c26023c5 100644 --- a/src/test/programs/dates/Year_Date.bas +++ b/src/test/programs/dates/Year_Date.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateFromParts(2023, 12, 25) print Year(x) diff --git a/src/test/programs/dates/Year_DateTime.bas b/src/test/programs/dates/Year_DateTime.bas index 50527d1f..0680c463 100644 --- a/src/test/programs/dates/Year_DateTime.bas +++ b/src/test/programs/dates/Year_DateTime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeFromParts(2021, 3, 12, 4, 30, 0, 0) print Year(x) diff --git a/src/test/programs/dates/Year_DateTimeOffset.bas b/src/test/programs/dates/Year_DateTimeOffset.bas index c498d374..a75f7b55 100644 --- a/src/test/programs/dates/Year_DateTimeOffset.bas +++ b/src/test/programs/dates/Year_DateTimeOffset.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = DateTimeOffsetFromParts(2021, 3, 12, 4, 30, 59, 488, Hours(-4)) print Year(x) diff --git a/src/test/programs/dates/convert_date_as_datetime.bas b/src/test/programs/dates/convert_date_as_datetime.bas index 906a4de7..dd1fa5f4 100644 --- a/src/test/programs/dates/convert_date_as_datetime.bas +++ b/src/test/programs/dates/convert_date_as_datetime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = DateFromParts(1776, 7, 4) dim b = a as DateTime diff --git a/src/test/programs/dates/convert_datetime_as_date.bas b/src/test/programs/dates/convert_datetime_as_date.bas index 27b79f3f..9e65e69b 100644 --- a/src/test/programs/dates/convert_datetime_as_date.bas +++ b/src/test/programs/dates/convert_datetime_as_date.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = DateTimeFromParts(1776, 7, 4, 5, 15, 30, 450) dim b = a as Date diff --git a/src/test/programs/dates/convert_datetimeoffset_as_date.bas b/src/test/programs/dates/convert_datetimeoffset_as_date.bas index d0a6a9cd..6997c530 100644 --- a/src/test/programs/dates/convert_datetimeoffset_as_date.bas +++ b/src/test/programs/dates/convert_datetimeoffset_as_date.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = DateTimeOffsetFromParts(1776, 7, 4, 5, 15, 30, 450, Hours(-6)) dim b = a as Date diff --git a/src/test/programs/dates/convert_datetimeoffset_as_datetime.bas b/src/test/programs/dates/convert_datetimeoffset_as_datetime.bas index f9a3dfa7..e30bd608 100644 --- a/src/test/programs/dates/convert_datetimeoffset_as_datetime.bas +++ b/src/test/programs/dates/convert_datetimeoffset_as_datetime.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim zone = TimeZoneFromName("America/Chicago") dim a = DateTimeOffsetFromParts(1776, 7, 4, 5, 15, 30, 450, Hours(-6)) diff --git a/src/test/programs/disk/FileExists.bas b/src/test/programs/disk/FileExists.bas index 044117dc..0e07beaf 100644 --- a/src/test/programs/disk/FileExists.bas +++ b/src/test/programs/disk/FileExists.bas @@ -1,4 +1,3 @@ -#procedure sub Main() DeleteFile "myfile.txt" print FileExists("myfile.txt") diff --git a/src/test/programs/disk/PathCombine.bas b/src/test/programs/disk/PathCombine.bas index 86cbd80a..2f9ed012 100644 --- a/src/test/programs/disk/PathCombine.bas +++ b/src/test/programs/disk/PathCombine.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = PathCombine(["C:", "Users" + PathSeparator(), "user", "Documents", "MyFile.txt"]) if x = "C:" + PathSeparator() + "Users" + PathSeparator() + "user" + PathSeparator() + "Documents" + PathSeparator() + "MyFile.txt" then diff --git a/src/test/programs/disk/PathDirectoryName_PathFileName.bas b/src/test/programs/disk/PathDirectoryName_PathFileName.bas index 127196a5..9147d412 100644 --- a/src/test/programs/disk/PathDirectoryName_PathFileName.bas +++ b/src/test/programs/disk/PathDirectoryName_PathFileName.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim ps = PathSeparator() dim path = "C:" + ps + "test" + ps + "file.txt" diff --git a/src/test/programs/disk/ReadFileBytes_WriteFileBytes.bas b/src/test/programs/disk/ReadFileBytes_WriteFileBytes.bas index 4d7f6842..e360ecaa 100644 --- a/src/test/programs/disk/ReadFileBytes_WriteFileBytes.bas +++ b/src/test/programs/disk/ReadFileBytes_WriteFileBytes.bas @@ -1,4 +1,3 @@ -#procedure sub Main() WriteFileBytes "myfile.dat", [65, 66, 67] print ReadFileText("myfile.dat") diff --git a/src/test/programs/disk/ReadFileLines_WriteFileLines.bas b/src/test/programs/disk/ReadFileLines_WriteFileLines.bas index aa39f223..37c362c6 100644 --- a/src/test/programs/disk/ReadFileLines_WriteFileLines.bas +++ b/src/test/programs/disk/ReadFileLines_WriteFileLines.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim path = "./tmbasic-temp" WriteFileText path, "A" + NewLine() + "B" + NewLine() diff --git a/src/test/programs/disk/ReadFileText_WriteFileText_DeleteFile.bas b/src/test/programs/disk/ReadFileText_WriteFileText_DeleteFile.bas index 011979c4..9373c736 100644 --- a/src/test/programs/disk/ReadFileText_WriteFileText_DeleteFile.bas +++ b/src/test/programs/disk/ReadFileText_WriteFileText_DeleteFile.bas @@ -1,4 +1,3 @@ -#procedure sub Main() ' deleting a file that already doesn't exist is not an error DeleteFile "this_file_does_not_exist" diff --git a/src/test/programs/disk/directories.bas b/src/test/programs/disk/directories.bas index 43b5c133..95968c92 100644 --- a/src/test/programs/disk/directories.bas +++ b/src/test/programs/disk/directories.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim path = "dir-test" + PathSeparator() try diff --git a/src/test/programs/errors/ErrorCode_ErrorMessage.bas b/src/test/programs/errors/ErrorCode_ErrorMessage.bas index 215cf1aa..76f89cea 100644 --- a/src/test/programs/errors/ErrorCode_ErrorMessage.bas +++ b/src/test/programs/errors/ErrorCode_ErrorMessage.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try throw 5, "hello" diff --git a/src/test/programs/errors/rethrow.bas b/src/test/programs/errors/rethrow.bas index 05663634..3b3a73c7 100644 --- a/src/test/programs/errors/rethrow.bas +++ b/src/test/programs/errors/rethrow.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try try diff --git a/src/test/programs/errors/throw_caught_in_same_sub.bas b/src/test/programs/errors/throw_caught_in_same_sub.bas index e84f1676..af8d490d 100644 --- a/src/test/programs/errors/throw_caught_in_same_sub.bas +++ b/src/test/programs/errors/throw_caught_in_same_sub.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try throw "hello" diff --git a/src/test/programs/errors/throw_from_catch_block.bas b/src/test/programs/errors/throw_from_catch_block.bas index f9b8c5e4..dea24d95 100644 --- a/src/test/programs/errors/throw_from_catch_block.bas +++ b/src/test/programs/errors/throw_from_catch_block.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try throw "AAA" diff --git a/src/test/programs/errors/throw_from_function.bas b/src/test/programs/errors/throw_from_function.bas index d1571cee..a7edc756 100644 --- a/src/test/programs/errors/throw_from_function.bas +++ b/src/test/programs/errors/throw_from_function.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim x = 5 + Foo(100) @@ -6,7 +5,6 @@ sub Main() print "caught" end try end sub -#procedure function Foo(bar as Number) as Number throw "" end function diff --git a/src/test/programs/errors/throw_from_sub.bas b/src/test/programs/errors/throw_from_sub.bas index 16207b6f..031cd472 100644 --- a/src/test/programs/errors/throw_from_sub.bas +++ b/src/test/programs/errors/throw_from_sub.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try Foo @@ -6,7 +5,6 @@ sub Main() print "caught" end try end sub -#procedure sub Foo() throw "" end sub diff --git a/src/test/programs/errors/throw_nested.bas b/src/test/programs/errors/throw_nested.bas index 32d31941..1d50f723 100644 --- a/src/test/programs/errors/throw_nested.bas +++ b/src/test/programs/errors/throw_nested.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try try diff --git a/src/test/programs/errors/throw_uncaught.bas b/src/test/programs/errors/throw_uncaught.bas index a059ea0a..1c8e0a2b 100644 --- a/src/test/programs/errors/throw_uncaught.bas +++ b/src/test/programs/errors/throw_uncaught.bas @@ -1,4 +1,3 @@ -#procedure sub Main() throw 1, "hello" end sub diff --git a/src/test/programs/errors/throw_uncaught_without_code.bas b/src/test/programs/errors/throw_uncaught_without_code.bas index ea534c82..5f7baaab 100644 --- a/src/test/programs/errors/throw_uncaught_without_code.bas +++ b/src/test/programs/errors/throw_uncaught_without_code.bas @@ -1,4 +1,3 @@ -#procedure sub Main() throw "hello" end sub diff --git a/src/test/programs/forms/ControlBounds_1.bas b/src/test/programs/forms/ControlBounds_1.bas index f0b9001e..31b8368b 100644 --- a/src/test/programs/forms/ControlBounds_1.bas +++ b/src/test/programs/forms/ControlBounds_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim c = NewLabel() SetControlBounds c, 1, 2, 3, 4 diff --git a/src/test/programs/forms/ControlBounds_2.bas b/src/test/programs/forms/ControlBounds_2.bas index bc726a82..02f4ec81 100644 --- a/src/test/programs/forms/ControlBounds_2.bas +++ b/src/test/programs/forms/ControlBounds_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim c = NewLabel() dim r = { Left: 1, Top: 2, Width: 3, Height: 4 } as Rectangle diff --git a/src/test/programs/forms/ControlBounds_3.bas b/src/test/programs/forms/ControlBounds_3.bas index c32c31e6..fc82c6b5 100644 --- a/src/test/programs/forms/ControlBounds_3.bas +++ b/src/test/programs/forms/ControlBounds_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim c = NewLabel() SetControlBounds c, { Left: 1, Top: 2, Width: 3, Height: 4 } as Rectangle diff --git a/src/test/programs/forms/Rectangle_1.bas b/src/test/programs/forms/Rectangle_1.bas index 7a8769db..889f342f 100644 --- a/src/test/programs/forms/Rectangle_1.bas +++ b/src/test/programs/forms/Rectangle_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Rectangle print x.left diff --git a/src/test/programs/forms/Rectangle_2.bas b/src/test/programs/forms/Rectangle_2.bas index a6064a03..7e070738 100644 --- a/src/test/programs/forms/Rectangle_2.bas +++ b/src/test/programs/forms/Rectangle_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { left: 1, top: 2, width: 3, height: 4 } as Rectangle print x.left diff --git a/src/test/programs/if/if_else_if.bas b/src/test/programs/if/if_else_if.bas index 8f67d39c..540189c5 100644 --- a/src/test/programs/if/if_else_if.bas +++ b/src/test/programs/if/if_else_if.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = 6 if a = 5 then diff --git a/src/test/programs/if/if_else_if_else.bas b/src/test/programs/if/if_else_if_else.bas index f4112ceb..ef8e8e5e 100644 --- a/src/test/programs/if/if_else_if_else.bas +++ b/src/test/programs/if/if_else_if_else.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = 7 if a = 5 then diff --git a/src/test/programs/if/if_only.bas b/src/test/programs/if/if_only.bas index e43dfb3c..5b53885e 100644 --- a/src/test/programs/if/if_only.bas +++ b/src/test/programs/if/if_only.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = 5 if a = 5 then diff --git a/src/test/programs/if/if_short_form.bas b/src/test/programs/if/if_short_form.bas index 4957b96b..2ca26f06 100644 --- a/src/test/programs/if/if_short_form.bas +++ b/src/test/programs/if/if_short_form.bas @@ -1,4 +1,3 @@ -#procedure sub Main() if true then print "ok" end sub diff --git a/src/test/programs/input/input_date.bas b/src/test/programs/input/input_date.bas index 5a175046..ca21f2cb 100644 --- a/src/test/programs/input/input_date.bas +++ b/src/test/programs/input/input_date.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a as Date input a diff --git a/src/test/programs/input/input_number_1.bas b/src/test/programs/input/input_number_1.bas index 9abbdd59..56a266fb 100644 --- a/src/test/programs/input/input_number_1.bas +++ b/src/test/programs/input/input_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim n as Number input n diff --git a/src/test/programs/input/input_number_2.bas b/src/test/programs/input/input_number_2.bas index cb6257e6..0de5d472 100644 --- a/src/test/programs/input/input_number_2.bas +++ b/src/test/programs/input/input_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a as Number dim b as Number diff --git a/src/test/programs/input/input_string_1.bas b/src/test/programs/input/input_string_1.bas index 4b306228..dbfbcc4a 100644 --- a/src/test/programs/input/input_string_1.bas +++ b/src/test/programs/input/input_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim n as String input n diff --git a/src/test/programs/input/input_string_2.bas b/src/test/programs/input/input_string_2.bas index a91ca284..6ec40275 100644 --- a/src/test/programs/input/input_string_2.bas +++ b/src/test/programs/input/input_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a as String dim b as String diff --git a/src/test/programs/lists/Concat.bas b/src/test/programs/lists/Concat.bas index b2f688c6..6e502837 100644 --- a/src/test/programs/lists/Concat.bas +++ b/src/test/programs/lists/Concat.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["Hello ", "world", "!"] print Concat(x) diff --git a/src/test/programs/lists/First_doc.bas b/src/test/programs/lists/First_doc.bas index 2b75d020..0447775a 100644 --- a/src/test/programs/lists/First_doc.bas +++ b/src/test/programs/lists/First_doc.bas @@ -1,4 +1,3 @@ -#procedure sub PrintFirstNumberIfPresent(x as List of Number) if Len(x) > 0 then print First(x) @@ -6,7 +5,6 @@ sub PrintFirstNumberIfPresent(x as List of Number) print "Empty list!" end if end sub -#procedure sub Main() dim x = [1, 2, 3] PrintFirstNumberIfPresent x diff --git a/src/test/programs/lists/First_number_1.bas b/src/test/programs/lists/First_number_1.bas index c0bfaaac..83e6a6c2 100644 --- a/src/test/programs/lists/First_number_1.bas +++ b/src/test/programs/lists/First_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] print First(x) diff --git a/src/test/programs/lists/First_number_2.bas b/src/test/programs/lists/First_number_2.bas index 5a8c3b53..9e8cd4af 100644 --- a/src/test/programs/lists/First_number_2.bas +++ b/src/test/programs/lists/First_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as List of Number try diff --git a/src/test/programs/lists/First_string_1.bas b/src/test/programs/lists/First_string_1.bas index 84c9c129..80badbbb 100644 --- a/src/test/programs/lists/First_string_1.bas +++ b/src/test/programs/lists/First_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C"] print First(x) diff --git a/src/test/programs/lists/First_string_2.bas b/src/test/programs/lists/First_string_2.bas index d6f48ea2..b2c2196e 100644 --- a/src/test/programs/lists/First_string_2.bas +++ b/src/test/programs/lists/First_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as List of String try diff --git a/src/test/programs/lists/Last_number_1.bas b/src/test/programs/lists/Last_number_1.bas index 3cfdd616..7c391739 100644 --- a/src/test/programs/lists/Last_number_1.bas +++ b/src/test/programs/lists/Last_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] print Last(x) diff --git a/src/test/programs/lists/Last_number_2.bas b/src/test/programs/lists/Last_number_2.bas index 5a0b0f75..bc1cf4cd 100644 --- a/src/test/programs/lists/Last_number_2.bas +++ b/src/test/programs/lists/Last_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as List of Number try diff --git a/src/test/programs/lists/Last_string_1.bas b/src/test/programs/lists/Last_string_1.bas index 49cb38ba..d2ba2aa8 100644 --- a/src/test/programs/lists/Last_string_1.bas +++ b/src/test/programs/lists/Last_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C"] print Last(x) diff --git a/src/test/programs/lists/Last_string_2.bas b/src/test/programs/lists/Last_string_2.bas index 4b795c9b..5d3da5cd 100644 --- a/src/test/programs/lists/Last_string_2.bas +++ b/src/test/programs/lists/Last_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as List of String try diff --git a/src/test/programs/lists/Len_list.bas b/src/test/programs/lists/Len_list.bas index 21ea7c7d..743a1e50 100644 --- a/src/test/programs/lists/Len_list.bas +++ b/src/test/programs/lists/Len_list.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [111, 222, 333] print Len(x) diff --git a/src/test/programs/lists/ListFill_doc.bas b/src/test/programs/lists/ListFill_doc.bas index 499eea74..c5fb3c5c 100644 --- a/src/test/programs/lists/ListFill_doc.bas +++ b/src/test/programs/lists/ListFill_doc.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim myList = ListFill("Hi!", 3) print Len(myList) diff --git a/src/test/programs/lists/ListFill_number_1.bas b/src/test/programs/lists/ListFill_number_1.bas index 3778b4da..f7d484da 100644 --- a/src/test/programs/lists/ListFill_number_1.bas +++ b/src/test/programs/lists/ListFill_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ListFill(123, 3) print Len(x) diff --git a/src/test/programs/lists/ListFill_number_2.bas b/src/test/programs/lists/ListFill_number_2.bas index 3eeacd4a..508da4e2 100644 --- a/src/test/programs/lists/ListFill_number_2.bas +++ b/src/test/programs/lists/ListFill_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ListFill(123, 0) print Len(x) diff --git a/src/test/programs/lists/ListFill_number_3.bas b/src/test/programs/lists/ListFill_number_3.bas index 1eb86920..f4b42814 100644 --- a/src/test/programs/lists/ListFill_number_3.bas +++ b/src/test/programs/lists/ListFill_number_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim x = ListFill(123, -1) diff --git a/src/test/programs/lists/ListFill_string_1.bas b/src/test/programs/lists/ListFill_string_1.bas index 4982cedd..7c9c19c2 100644 --- a/src/test/programs/lists/ListFill_string_1.bas +++ b/src/test/programs/lists/ListFill_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ListFill("A", 3) print Len(x) diff --git a/src/test/programs/lists/ListFill_string_2.bas b/src/test/programs/lists/ListFill_string_2.bas index c5aa8474..d520e849 100644 --- a/src/test/programs/lists/ListFill_string_2.bas +++ b/src/test/programs/lists/ListFill_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ListFill("A", 0) print Len(x) diff --git a/src/test/programs/lists/ListFill_string_3.bas b/src/test/programs/lists/ListFill_string_3.bas index 89206ef6..622062b8 100644 --- a/src/test/programs/lists/ListFill_string_3.bas +++ b/src/test/programs/lists/ListFill_string_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim x = ListFill("A", -1) diff --git a/src/test/programs/lists/Mid_doc.bas b/src/test/programs/lists/Mid_doc.bas index 3b3371ae..9d7f01ad 100644 --- a/src/test/programs/lists/Mid_doc.bas +++ b/src/test/programs/lists/Mid_doc.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim myList = [1, 2, 3, 4, 5] dim newList = Mid(myList, 1, 3) diff --git a/src/test/programs/lists/Mid_number_1.bas b/src/test/programs/lists/Mid_number_1.bas index 70829478..3d5cbdf4 100644 --- a/src/test/programs/lists/Mid_number_1.bas +++ b/src/test/programs/lists/Mid_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3, 4, 5] dim y = Mid(x, 1, 3) diff --git a/src/test/programs/lists/Mid_number_2.bas b/src/test/programs/lists/Mid_number_2.bas index b43c8e1e..a03e4393 100644 --- a/src/test/programs/lists/Mid_number_2.bas +++ b/src/test/programs/lists/Mid_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3, 4, 5] dim y = Mid(x, 2, 50) diff --git a/src/test/programs/lists/Mid_number_3.bas b/src/test/programs/lists/Mid_number_3.bas index b43c8e1e..a03e4393 100644 --- a/src/test/programs/lists/Mid_number_3.bas +++ b/src/test/programs/lists/Mid_number_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3, 4, 5] dim y = Mid(x, 2, 50) diff --git a/src/test/programs/lists/Mid_number_4.bas b/src/test/programs/lists/Mid_number_4.bas index e5653e53..c41dc472 100644 --- a/src/test/programs/lists/Mid_number_4.bas +++ b/src/test/programs/lists/Mid_number_4.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3, 4, 5] try diff --git a/src/test/programs/lists/Mid_number_5.bas b/src/test/programs/lists/Mid_number_5.bas index b01279fe..01628cf3 100644 --- a/src/test/programs/lists/Mid_number_5.bas +++ b/src/test/programs/lists/Mid_number_5.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3, 4, 5] try diff --git a/src/test/programs/lists/Mid_string_1.bas b/src/test/programs/lists/Mid_string_1.bas index 52d49b0d..406782da 100644 --- a/src/test/programs/lists/Mid_string_1.bas +++ b/src/test/programs/lists/Mid_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C", "D", "E"] dim y = Mid(x, 1, 3) diff --git a/src/test/programs/lists/Mid_string_2.bas b/src/test/programs/lists/Mid_string_2.bas index ace80ea8..bee9b1c2 100644 --- a/src/test/programs/lists/Mid_string_2.bas +++ b/src/test/programs/lists/Mid_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C", "D", "E"] dim y = Mid(x, 2, 50) diff --git a/src/test/programs/lists/Mid_string_3.bas b/src/test/programs/lists/Mid_string_3.bas index ace80ea8..bee9b1c2 100644 --- a/src/test/programs/lists/Mid_string_3.bas +++ b/src/test/programs/lists/Mid_string_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C", "D", "E"] dim y = Mid(x, 2, 50) diff --git a/src/test/programs/lists/Mid_string_4.bas b/src/test/programs/lists/Mid_string_4.bas index e48eb746..a30a100a 100644 --- a/src/test/programs/lists/Mid_string_4.bas +++ b/src/test/programs/lists/Mid_string_4.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C", "D", "E"] try diff --git a/src/test/programs/lists/Mid_string_5.bas b/src/test/programs/lists/Mid_string_5.bas index 16044bb8..17af0896 100644 --- a/src/test/programs/lists/Mid_string_5.bas +++ b/src/test/programs/lists/Mid_string_5.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C", "D", "E"] try diff --git a/src/test/programs/lists/RemoveAt_multiple_1.bas b/src/test/programs/lists/RemoveAt_multiple_1.bas index 886129d9..669f5551 100644 --- a/src/test/programs/lists/RemoveAt_multiple_1.bas +++ b/src/test/programs/lists/RemoveAt_multiple_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] dim y = RemoveAt(x, [0, 2]) diff --git a/src/test/programs/lists/RemoveAt_multiple_2.bas b/src/test/programs/lists/RemoveAt_multiple_2.bas index de29af1f..0a085be5 100644 --- a/src/test/programs/lists/RemoveAt_multiple_2.bas +++ b/src/test/programs/lists/RemoveAt_multiple_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] dim y = RemoveAt(x, [0, -1]) diff --git a/src/test/programs/lists/RemoveAt_multiple_3.bas b/src/test/programs/lists/RemoveAt_multiple_3.bas index 4095a377..760b7f65 100644 --- a/src/test/programs/lists/RemoveAt_multiple_3.bas +++ b/src/test/programs/lists/RemoveAt_multiple_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] dim y = RemoveAt(x, [0, 3]) diff --git a/src/test/programs/lists/RemoveAt_multiple_4.bas b/src/test/programs/lists/RemoveAt_multiple_4.bas index 6d67e67c..0c45917d 100644 --- a/src/test/programs/lists/RemoveAt_multiple_4.bas +++ b/src/test/programs/lists/RemoveAt_multiple_4.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] dim y = RemoveAt(x, [0, 2, 2, 2]) diff --git a/src/test/programs/lists/RemoveAt_single_1.bas b/src/test/programs/lists/RemoveAt_single_1.bas index 1a5d7612..f7512305 100644 --- a/src/test/programs/lists/RemoveAt_single_1.bas +++ b/src/test/programs/lists/RemoveAt_single_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] dim y = RemoveAt(x, 0) diff --git a/src/test/programs/lists/RemoveAt_single_2.bas b/src/test/programs/lists/RemoveAt_single_2.bas index c0d3ae88..17f4b0c6 100644 --- a/src/test/programs/lists/RemoveAt_single_2.bas +++ b/src/test/programs/lists/RemoveAt_single_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] dim y = RemoveAt(x, -1) diff --git a/src/test/programs/lists/RemoveAt_single_3.bas b/src/test/programs/lists/RemoveAt_single_3.bas index 0f414239..dc8d7325 100644 --- a/src/test/programs/lists/RemoveAt_single_3.bas +++ b/src/test/programs/lists/RemoveAt_single_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] dim y = RemoveAt(x, 3) diff --git a/src/test/programs/lists/Skip_doc.bas b/src/test/programs/lists/Skip_doc.bas index 9eb30920..bfaedbe7 100644 --- a/src/test/programs/lists/Skip_doc.bas +++ b/src/test/programs/lists/Skip_doc.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim myList = [1, 2, 3, 4, 5, 6, 7] dim newList = Skip(myList, 3) diff --git a/src/test/programs/lists/Skip_number_1.bas b/src/test/programs/lists/Skip_number_1.bas index 544a8f58..3a1366ff 100644 --- a/src/test/programs/lists/Skip_number_1.bas +++ b/src/test/programs/lists/Skip_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] dim y = Skip(x, 1) diff --git a/src/test/programs/lists/Skip_number_2.bas b/src/test/programs/lists/Skip_number_2.bas index 17571d2b..c11b98fc 100644 --- a/src/test/programs/lists/Skip_number_2.bas +++ b/src/test/programs/lists/Skip_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] dim y = Skip(x, 4) diff --git a/src/test/programs/lists/Skip_number_3.bas b/src/test/programs/lists/Skip_number_3.bas index d46f5189..b0fc37ee 100644 --- a/src/test/programs/lists/Skip_number_3.bas +++ b/src/test/programs/lists/Skip_number_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [1, 2, 3] try diff --git a/src/test/programs/lists/Skip_string_1.bas b/src/test/programs/lists/Skip_string_1.bas index d86cb781..dd4b722a 100644 --- a/src/test/programs/lists/Skip_string_1.bas +++ b/src/test/programs/lists/Skip_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C"] dim y = Skip(x, 1) diff --git a/src/test/programs/lists/Skip_string_2.bas b/src/test/programs/lists/Skip_string_2.bas index 589f3e33..505ccff0 100644 --- a/src/test/programs/lists/Skip_string_2.bas +++ b/src/test/programs/lists/Skip_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C"] dim y = Skip(x, 4) diff --git a/src/test/programs/lists/Skip_string_3.bas b/src/test/programs/lists/Skip_string_3.bas index 7578f849..6d331ae9 100644 --- a/src/test/programs/lists/Skip_string_3.bas +++ b/src/test/programs/lists/Skip_string_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = ["A", "B", "C"] try diff --git a/src/test/programs/lists/Take_doc.bas b/src/test/programs/lists/Take_doc.bas index 845eb2bb..5496281e 100644 --- a/src/test/programs/lists/Take_doc.bas +++ b/src/test/programs/lists/Take_doc.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim myList = [1, 2, 3, 4, 5, 6, 7] dim newList = Take(myList, 3) diff --git a/src/test/programs/lists/dim_list_mismatched_yield_types.bas b/src/test/programs/lists/dim_list_mismatched_yield_types.bas index 70e60101..f49a16b9 100644 --- a/src/test/programs/lists/dim_list_mismatched_yield_types.bas +++ b/src/test/programs/lists/dim_list_mismatched_yield_types.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim list foo yield 5 diff --git a/src/test/programs/lists/dim_list_no_yields.bas b/src/test/programs/lists/dim_list_no_yields.bas index 4cef24da..0b2732b6 100644 --- a/src/test/programs/lists/dim_list_no_yields.bas +++ b/src/test/programs/lists/dim_list_no_yields.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim list foo print "stuff" diff --git a/src/test/programs/lists/dim_list_number.bas b/src/test/programs/lists/dim_list_number.bas index 4471a105..4bda9151 100644 --- a/src/test/programs/lists/dim_list_number.bas +++ b/src/test/programs/lists/dim_list_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim list foo yield 1 diff --git a/src/test/programs/lists/dim_list_string.bas b/src/test/programs/lists/dim_list_string.bas index 5a18dc5a..f88566b2 100644 --- a/src/test/programs/lists/dim_list_string.bas +++ b/src/test/programs/lists/dim_list_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim list foo yield "A" diff --git a/src/test/programs/lists/dim_list_with_yield_map.bas b/src/test/programs/lists/dim_list_with_yield_map.bas index 2c7ce883..86f3833d 100644 --- a/src/test/programs/lists/dim_list_with_yield_map.bas +++ b/src/test/programs/lists/dim_list_with_yield_map.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim list x yield 5 to 6 diff --git a/src/test/programs/lists/list_add_element.bas b/src/test/programs/lists/list_add_element.bas index 64a6549b..a858defc 100644 --- a/src/test/programs/lists/list_add_element.bas +++ b/src/test/programs/lists/list_add_element.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a as List of Number print Len(a) diff --git a/src/test/programs/lists/list_add_list.bas b/src/test/programs/lists/list_add_list.bas index aee3624c..63020556 100644 --- a/src/test/programs/lists/list_add_list.bas +++ b/src/test/programs/lists/list_add_list.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = [1, 2, 3] dim b = [4, 5, 6] diff --git a/src/test/programs/lists/list_add_mismatched_list.bas b/src/test/programs/lists/list_add_mismatched_list.bas index 9f94791f..2c5610eb 100644 --- a/src/test/programs/lists/list_add_mismatched_list.bas +++ b/src/test/programs/lists/list_add_mismatched_list.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = [1, 2, 3] dim b = ["A", "B", "C"] diff --git a/src/test/programs/lists/list_index.bas b/src/test/programs/lists/list_index.bas index 5df69ae8..b789cf67 100644 --- a/src/test/programs/lists/list_index.bas +++ b/src/test/programs/lists/list_index.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = [100, 200, 300] print a(2) diff --git a/src/test/programs/lists/list_of_list_of_number.bas b/src/test/programs/lists/list_of_list_of_number.bas index 8a64c574..f7d28167 100644 --- a/src/test/programs/lists/list_of_list_of_number.bas +++ b/src/test/programs/lists/list_of_list_of_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as List of List of Number foo = [ [ 1234 ] ] diff --git a/src/test/programs/lists/list_set_1.bas b/src/test/programs/lists/list_set_1.bas index 29d5ae3b..daf140e5 100644 --- a/src/test/programs/lists/list_set_1.bas +++ b/src/test/programs/lists/list_set_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo = [1, 2, 3] foo(1) = 999 diff --git a/src/test/programs/lists/list_set_2.bas b/src/test/programs/lists/list_set_2.bas index 36628c85..3e54167b 100644 --- a/src/test/programs/lists/list_set_2.bas +++ b/src/test/programs/lists/list_set_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo = [111, 222, 333] try diff --git a/src/test/programs/lists/plus_operator_list_of_list_of_number.bas b/src/test/programs/lists/plus_operator_list_of_list_of_number.bas index a60e6175..c639c04f 100644 --- a/src/test/programs/lists/plus_operator_list_of_list_of_number.bas +++ b/src/test/programs/lists/plus_operator_list_of_list_of_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a as List of List of Number dim b as List of Number diff --git a/src/test/programs/lists/plus_operator_list_of_list_of_string.bas b/src/test/programs/lists/plus_operator_list_of_list_of_string.bas index 70ccb6b4..9f8a8607 100644 --- a/src/test/programs/lists/plus_operator_list_of_list_of_string.bas +++ b/src/test/programs/lists/plus_operator_list_of_list_of_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a as List of List of String dim b as List of String diff --git a/src/test/programs/lists/plus_operator_list_of_string.bas b/src/test/programs/lists/plus_operator_list_of_string.bas index 4820498a..fc3e8e9f 100644 --- a/src/test/programs/lists/plus_operator_list_of_string.bas +++ b/src/test/programs/lists/plus_operator_list_of_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a as List of String a = a + "foo" diff --git a/src/test/programs/lists/yield_number_and_print.bas b/src/test/programs/lists/yield_number_and_print.bas index d1d9447d..8c38fc56 100644 --- a/src/test/programs/lists/yield_number_and_print.bas +++ b/src/test/programs/lists/yield_number_and_print.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim list foo yield 0 diff --git a/src/test/programs/lists/yield_outside_dim_list.bas b/src/test/programs/lists/yield_outside_dim_list.bas index 49d14eb1..77af50e6 100644 --- a/src/test/programs/lists/yield_outside_dim_list.bas +++ b/src/test/programs/lists/yield_outside_dim_list.bas @@ -1,8 +1,6 @@ -#procedure sub Main() end sub -#procedure function Foo() as List of Number yield 1 return 1 diff --git a/src/test/programs/loops/continue_mismatch.bas b/src/test/programs/loops/continue_mismatch.bas index 2d469327..d00f386e 100644 --- a/src/test/programs/loops/continue_mismatch.bas +++ b/src/test/programs/loops/continue_mismatch.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = 0 while x < 10 diff --git a/src/test/programs/loops/continue_outside_loop.bas b/src/test/programs/loops/continue_outside_loop.bas index af804396..631629b6 100644 --- a/src/test/programs/loops/continue_outside_loop.bas +++ b/src/test/programs/loops/continue_outside_loop.bas @@ -1,4 +1,3 @@ -#procedure sub Main() continue for end sub diff --git a/src/test/programs/loops/do.bas b/src/test/programs/loops/do.bas index a98619ce..da135e39 100644 --- a/src/test/programs/loops/do.bas +++ b/src/test/programs/loops/do.bas @@ -1,4 +1,3 @@ -#procedure sub Main() do print 1 diff --git a/src/test/programs/loops/do_continue.bas b/src/test/programs/loops/do_continue.bas index 9327baa9..b808fc2e 100644 --- a/src/test/programs/loops/do_continue.bas +++ b/src/test/programs/loops/do_continue.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = 0 do diff --git a/src/test/programs/loops/do_exit.bas b/src/test/programs/loops/do_exit.bas index 4f302cdd..2d8e06e5 100644 --- a/src/test/programs/loops/do_exit.bas +++ b/src/test/programs/loops/do_exit.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = 0 do diff --git a/src/test/programs/loops/do_invalid_condition_type.bas b/src/test/programs/loops/do_invalid_condition_type.bas index 8858940c..a227522f 100644 --- a/src/test/programs/loops/do_invalid_condition_type.bas +++ b/src/test/programs/loops/do_invalid_condition_type.bas @@ -1,4 +1,3 @@ -#procedure sub Main() do print "nope" diff --git a/src/test/programs/loops/exit_mismatch.bas b/src/test/programs/loops/exit_mismatch.bas index b21b6839..dafe491c 100644 --- a/src/test/programs/loops/exit_mismatch.bas +++ b/src/test/programs/loops/exit_mismatch.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = 0 while x < 10 diff --git a/src/test/programs/loops/exit_outside_loop.bas b/src/test/programs/loops/exit_outside_loop.bas index e572ab08..cd8763cf 100644 --- a/src/test/programs/loops/exit_outside_loop.bas +++ b/src/test/programs/loops/exit_outside_loop.bas @@ -1,4 +1,3 @@ -#procedure sub Main() exit for end sub diff --git a/src/test/programs/loops/for_continue.bas b/src/test/programs/loops/for_continue.bas index a7333f69..b8d5e73c 100644 --- a/src/test/programs/loops/for_continue.bas +++ b/src/test/programs/loops/for_continue.bas @@ -1,4 +1,3 @@ -#procedure sub Main() for i = 1 to 10 if i mod 2 = 0 then diff --git a/src/test/programs/loops/for_each_early_return.bas b/src/test/programs/loops/for_each_early_return.bas index 2b4624a5..a6a60e47 100644 --- a/src/test/programs/loops/for_each_early_return.bas +++ b/src/test/programs/loops/for_each_early_return.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim objects = ["A", "B", "C"] for each o in objects diff --git a/src/test/programs/loops/for_each_object_list.bas b/src/test/programs/loops/for_each_object_list.bas index 4eedc0af..7f0f3e1c 100644 --- a/src/test/programs/loops/for_each_object_list.bas +++ b/src/test/programs/loops/for_each_object_list.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim objects = ["A", "B", "C"] for each o in objects diff --git a/src/test/programs/loops/for_each_string.bas b/src/test/programs/loops/for_each_string.bas index 01c402b6..ccaf478b 100644 --- a/src/test/programs/loops/for_each_string.bas +++ b/src/test/programs/loops/for_each_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() for each o in "hello" print o diff --git a/src/test/programs/loops/for_each_value_list.bas b/src/test/programs/loops/for_each_value_list.bas index ce1d4521..c3aa2777 100644 --- a/src/test/programs/loops/for_each_value_list.bas +++ b/src/test/programs/loops/for_each_value_list.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim values = [1, 2, 3] for each v in values diff --git a/src/test/programs/loops/for_exit.bas b/src/test/programs/loops/for_exit.bas index a492e834..c041ce92 100644 --- a/src/test/programs/loops/for_exit.bas +++ b/src/test/programs/loops/for_exit.bas @@ -1,4 +1,3 @@ -#procedure sub Main() for i = 1 to 10 if i mod 2 = 0 then diff --git a/src/test/programs/loops/for_loop.bas b/src/test/programs/loops/for_loop.bas index 127a41ef..b4e53144 100644 --- a/src/test/programs/loops/for_loop.bas +++ b/src/test/programs/loops/for_loop.bas @@ -1,4 +1,3 @@ -#procedure sub Main() for i = 1 to 3 print i diff --git a/src/test/programs/loops/while_continue.bas b/src/test/programs/loops/while_continue.bas index 1badfd1f..d29768a5 100644 --- a/src/test/programs/loops/while_continue.bas +++ b/src/test/programs/loops/while_continue.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = 0 while x < 10 diff --git a/src/test/programs/loops/while_exit.bas b/src/test/programs/loops/while_exit.bas index 0b1f6fc6..c3faa5f5 100644 --- a/src/test/programs/loops/while_exit.bas +++ b/src/test/programs/loops/while_exit.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = 0 while x < 10 diff --git a/src/test/programs/loops/while_loop.bas b/src/test/programs/loops/while_loop.bas index 010ba856..f099cb63 100644 --- a/src/test/programs/loops/while_loop.bas +++ b/src/test/programs/loops/while_loop.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = 1 while x <= 3 diff --git a/src/test/programs/maps/ContainsKey_doc_1.bas b/src/test/programs/maps/ContainsKey_doc_1.bas index 8f495cb5..09183736 100644 --- a/src/test/programs/maps/ContainsKey_doc_1.bas +++ b/src/test/programs/maps/ContainsKey_doc_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map myMap yield "aaa" to "111" diff --git a/src/test/programs/maps/ContainsKey_map_number_to_number_1.bas b/src/test/programs/maps/ContainsKey_map_number_to_number_1.bas index 4c552b88..634076fa 100644 --- a/src/test/programs/maps/ContainsKey_map_number_to_number_1.bas +++ b/src/test/programs/maps/ContainsKey_map_number_to_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Number to Number print ContainsKey(foo, 1) diff --git a/src/test/programs/maps/ContainsKey_map_number_to_number_2.bas b/src/test/programs/maps/ContainsKey_map_number_to_number_2.bas index 1fd1de9b..5cce51ab 100644 --- a/src/test/programs/maps/ContainsKey_map_number_to_number_2.bas +++ b/src/test/programs/maps/ContainsKey_map_number_to_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to 2 diff --git a/src/test/programs/maps/ContainsKey_map_number_to_number_3.bas b/src/test/programs/maps/ContainsKey_map_number_to_number_3.bas index 060ec6f7..7a7b94d4 100644 --- a/src/test/programs/maps/ContainsKey_map_number_to_number_3.bas +++ b/src/test/programs/maps/ContainsKey_map_number_to_number_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Number to Number print ContainsKey(foo, "a") diff --git a/src/test/programs/maps/ContainsKey_map_string_to_number_1.bas b/src/test/programs/maps/ContainsKey_map_string_to_number_1.bas index 6f5e567d..cff40d02 100644 --- a/src/test/programs/maps/ContainsKey_map_string_to_number_1.bas +++ b/src/test/programs/maps/ContainsKey_map_string_to_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from String to Number print ContainsKey(foo, "a") diff --git a/src/test/programs/maps/ContainsKey_map_string_to_number_2.bas b/src/test/programs/maps/ContainsKey_map_string_to_number_2.bas index 81f44042..d277aeab 100644 --- a/src/test/programs/maps/ContainsKey_map_string_to_number_2.bas +++ b/src/test/programs/maps/ContainsKey_map_string_to_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield "a" to 2 diff --git a/src/test/programs/maps/ContainsKey_map_string_to_number_3.bas b/src/test/programs/maps/ContainsKey_map_string_to_number_3.bas index 2dbc54f7..5f04036c 100644 --- a/src/test/programs/maps/ContainsKey_map_string_to_number_3.bas +++ b/src/test/programs/maps/ContainsKey_map_string_to_number_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from String to Number print ContainsKey(foo, 1) diff --git a/src/test/programs/maps/Find_map_number_to_number_1.bas b/src/test/programs/maps/Find_map_number_to_number_1.bas index 6a32f9db..b60a00be 100644 --- a/src/test/programs/maps/Find_map_number_to_number_1.bas +++ b/src/test/programs/maps/Find_map_number_to_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to 2 diff --git a/src/test/programs/maps/Find_map_number_to_number_2.bas b/src/test/programs/maps/Find_map_number_to_number_2.bas index 294472bf..d52c3399 100644 --- a/src/test/programs/maps/Find_map_number_to_number_2.bas +++ b/src/test/programs/maps/Find_map_number_to_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to 2 diff --git a/src/test/programs/maps/Find_map_number_to_string_1.bas b/src/test/programs/maps/Find_map_number_to_string_1.bas index 7104c9b0..d56240b0 100644 --- a/src/test/programs/maps/Find_map_number_to_string_1.bas +++ b/src/test/programs/maps/Find_map_number_to_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to "a" diff --git a/src/test/programs/maps/Find_map_number_to_string_2.bas b/src/test/programs/maps/Find_map_number_to_string_2.bas index 5a7f28ba..78f0e433 100644 --- a/src/test/programs/maps/Find_map_number_to_string_2.bas +++ b/src/test/programs/maps/Find_map_number_to_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to "a" diff --git a/src/test/programs/maps/Find_map_string_to_number_1.bas b/src/test/programs/maps/Find_map_string_to_number_1.bas index 1e8f3262..dffe4bda 100644 --- a/src/test/programs/maps/Find_map_string_to_number_1.bas +++ b/src/test/programs/maps/Find_map_string_to_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield "a" to 2 diff --git a/src/test/programs/maps/Find_map_string_to_number_2.bas b/src/test/programs/maps/Find_map_string_to_number_2.bas index da15f1f1..98b31c75 100644 --- a/src/test/programs/maps/Find_map_string_to_number_2.bas +++ b/src/test/programs/maps/Find_map_string_to_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield "a" to 2 diff --git a/src/test/programs/maps/Find_map_string_to_string_1.bas b/src/test/programs/maps/Find_map_string_to_string_1.bas index 5bd2e38e..0086c7a0 100644 --- a/src/test/programs/maps/Find_map_string_to_string_1.bas +++ b/src/test/programs/maps/Find_map_string_to_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield "a" to "x" diff --git a/src/test/programs/maps/Find_map_string_to_string_2.bas b/src/test/programs/maps/Find_map_string_to_string_2.bas index 0a20b726..a70a46d2 100644 --- a/src/test/programs/maps/Find_map_string_to_string_2.bas +++ b/src/test/programs/maps/Find_map_string_to_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield "a" to "x" diff --git a/src/test/programs/maps/Len_map.bas b/src/test/programs/maps/Len_map.bas index 7fc6b47d..e9e9911c 100644 --- a/src/test/programs/maps/Len_map.bas +++ b/src/test/programs/maps/Len_map.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to 2 diff --git a/src/test/programs/maps/Map_minus_operator_1.bas b/src/test/programs/maps/Map_minus_operator_1.bas index b62afbcb..c926f4b8 100644 --- a/src/test/programs/maps/Map_minus_operator_1.bas +++ b/src/test/programs/maps/Map_minus_operator_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to 2 diff --git a/src/test/programs/maps/Map_minus_operator_2.bas b/src/test/programs/maps/Map_minus_operator_2.bas index 97f6615d..b7919bc0 100644 --- a/src/test/programs/maps/Map_minus_operator_2.bas +++ b/src/test/programs/maps/Map_minus_operator_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to 2 diff --git a/src/test/programs/maps/Map_plus_operator_1.bas b/src/test/programs/maps/Map_plus_operator_1.bas index 5de30ce5..5650fb5b 100644 --- a/src/test/programs/maps/Map_plus_operator_1.bas +++ b/src/test/programs/maps/Map_plus_operator_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to 2 diff --git a/src/test/programs/maps/Map_plus_operator_2.bas b/src/test/programs/maps/Map_plus_operator_2.bas index 9056095d..433ae5b9 100644 --- a/src/test/programs/maps/Map_plus_operator_2.bas +++ b/src/test/programs/maps/Map_plus_operator_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to 2 diff --git a/src/test/programs/maps/Map_plus_operator_3.bas b/src/test/programs/maps/Map_plus_operator_3.bas index 5c5b1611..057012d5 100644 --- a/src/test/programs/maps/Map_plus_operator_3.bas +++ b/src/test/programs/maps/Map_plus_operator_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo yield 1 to 2 diff --git a/src/test/programs/maps/dim_map_with_yield_list.bas b/src/test/programs/maps/dim_map_with_yield_list.bas index e516fa40..c4109558 100644 --- a/src/test/programs/maps/dim_map_with_yield_list.bas +++ b/src/test/programs/maps/dim_map_with_yield_list.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map x yield 5 diff --git a/src/test/programs/maps/map_number_number_not_found.bas b/src/test/programs/maps/map_number_number_not_found.bas index 840f2555..3781d789 100644 --- a/src/test/programs/maps/map_number_number_not_found.bas +++ b/src/test/programs/maps/map_number_number_not_found.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim foo as Map from Number to Number diff --git a/src/test/programs/maps/map_number_number_set.bas b/src/test/programs/maps/map_number_number_set.bas index c3d67100..e28a7261 100644 --- a/src/test/programs/maps/map_number_number_set.bas +++ b/src/test/programs/maps/map_number_number_set.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Number to Number foo(5) = 10 diff --git a/src/test/programs/maps/map_number_record_not_found.bas b/src/test/programs/maps/map_number_record_not_found.bas index 8c22e9bd..3f95c150 100644 --- a/src/test/programs/maps/map_number_record_not_found.bas +++ b/src/test/programs/maps/map_number_record_not_found.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim foo as Map from Number to Record(a as Number, b as Number) diff --git a/src/test/programs/maps/map_number_record_set_1.bas b/src/test/programs/maps/map_number_record_set_1.bas index b10d25a2..4b76fa87 100644 --- a/src/test/programs/maps/map_number_record_set_1.bas +++ b/src/test/programs/maps/map_number_record_set_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Number to Record(a as Number, b as Number) foo(5) = {a: 111, b: 222} diff --git a/src/test/programs/maps/map_number_record_set_2.bas b/src/test/programs/maps/map_number_record_set_2.bas index 858714c7..ac32f585 100644 --- a/src/test/programs/maps/map_number_record_set_2.bas +++ b/src/test/programs/maps/map_number_record_set_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Number to Record(a as Number, b as Number) foo(5) = {a: 111, b: 222} diff --git a/src/test/programs/maps/map_number_record_set_3.bas b/src/test/programs/maps/map_number_record_set_3.bas index 073f2ccf..ddab6955 100644 --- a/src/test/programs/maps/map_number_record_set_3.bas +++ b/src/test/programs/maps/map_number_record_set_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Number to Record(a as Number, b as Number) try diff --git a/src/test/programs/maps/map_number_string_not_found.bas b/src/test/programs/maps/map_number_string_not_found.bas index d2d4766b..7fcfd73d 100644 --- a/src/test/programs/maps/map_number_string_not_found.bas +++ b/src/test/programs/maps/map_number_string_not_found.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim foo as Map from Number to String diff --git a/src/test/programs/maps/map_number_string_set.bas b/src/test/programs/maps/map_number_string_set.bas index 379bd281..9d918ab5 100644 --- a/src/test/programs/maps/map_number_string_set.bas +++ b/src/test/programs/maps/map_number_string_set.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Number to String foo(5) = "abc" diff --git a/src/test/programs/maps/map_record_record_not_found.bas b/src/test/programs/maps/map_record_record_not_found.bas index d7ffb3d1..bc993f43 100644 --- a/src/test/programs/maps/map_record_record_not_found.bas +++ b/src/test/programs/maps/map_record_record_not_found.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim foo as Map from Record(a as String, b as String) to Record(a as Number, b as Number) diff --git a/src/test/programs/maps/map_record_record_set_1.bas b/src/test/programs/maps/map_record_record_set_1.bas index 2edf38a0..7534b675 100644 --- a/src/test/programs/maps/map_record_record_set_1.bas +++ b/src/test/programs/maps/map_record_record_set_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Record(a as String, b as String) to Record(a as Number, b as Number) foo({a: "abc", b: "def"}) = {a: 111, b: 222} diff --git a/src/test/programs/maps/map_record_record_set_2.bas b/src/test/programs/maps/map_record_record_set_2.bas index f4d2c22c..4f70b253 100644 --- a/src/test/programs/maps/map_record_record_set_2.bas +++ b/src/test/programs/maps/map_record_record_set_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Record(a as String, b as String) to Record(a as Number, b as Number) foo({a: "abc", b: "def"}) = {a: 111, b: 222} diff --git a/src/test/programs/maps/map_record_record_set_3.bas b/src/test/programs/maps/map_record_record_set_3.bas index a6d9eadd..976c889b 100644 --- a/src/test/programs/maps/map_record_record_set_3.bas +++ b/src/test/programs/maps/map_record_record_set_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from Record(a as String, b as String) to Record(a as Number, b as Number) try diff --git a/src/test/programs/maps/map_string_number_not_found.bas b/src/test/programs/maps/map_string_number_not_found.bas index 7e934dea..ae455ea0 100644 --- a/src/test/programs/maps/map_string_number_not_found.bas +++ b/src/test/programs/maps/map_string_number_not_found.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim foo as Map from String to Number diff --git a/src/test/programs/maps/map_string_number_set.bas b/src/test/programs/maps/map_string_number_set.bas index 92cb6fc8..b8f82dfc 100644 --- a/src/test/programs/maps/map_string_number_set.bas +++ b/src/test/programs/maps/map_string_number_set.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from String to Number foo("abc") = 10 diff --git a/src/test/programs/maps/map_string_record_not_found.bas b/src/test/programs/maps/map_string_record_not_found.bas index 528e0593..897b18d6 100644 --- a/src/test/programs/maps/map_string_record_not_found.bas +++ b/src/test/programs/maps/map_string_record_not_found.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim foo as Map from String to Record(a as Number, b as Number) diff --git a/src/test/programs/maps/map_string_record_set_1.bas b/src/test/programs/maps/map_string_record_set_1.bas index 8c8c8c25..56e59f63 100644 --- a/src/test/programs/maps/map_string_record_set_1.bas +++ b/src/test/programs/maps/map_string_record_set_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from String to Record(a as Number, b as Number) foo("abc") = {a: 111, b: 222} diff --git a/src/test/programs/maps/map_string_record_set_2.bas b/src/test/programs/maps/map_string_record_set_2.bas index abb0d8df..d4993a56 100644 --- a/src/test/programs/maps/map_string_record_set_2.bas +++ b/src/test/programs/maps/map_string_record_set_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from String to Record(a as Number, b as Number) foo("abc") = {a: 111, b: 222} diff --git a/src/test/programs/maps/map_string_record_set_3.bas b/src/test/programs/maps/map_string_record_set_3.bas index f2b009dd..8cab373f 100644 --- a/src/test/programs/maps/map_string_record_set_3.bas +++ b/src/test/programs/maps/map_string_record_set_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from String to Record(a as Number, b as Number) try diff --git a/src/test/programs/maps/map_string_string_not_found.bas b/src/test/programs/maps/map_string_string_not_found.bas index ea49d72c..13826b52 100644 --- a/src/test/programs/maps/map_string_string_not_found.bas +++ b/src/test/programs/maps/map_string_string_not_found.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim foo as Map from String to String diff --git a/src/test/programs/maps/map_string_string_set.bas b/src/test/programs/maps/map_string_string_set.bas index 4a9a02c7..65929473 100644 --- a/src/test/programs/maps/map_string_string_set.bas +++ b/src/test/programs/maps/map_string_string_set.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Map from String to String foo("abc") = "def" diff --git a/src/test/programs/misc/comment_after_global.bas b/src/test/programs/misc/comment_after_global.bas index 43972914..5f13c49d 100644 --- a/src/test/programs/misc/comment_after_global.bas +++ b/src/test/programs/misc/comment_after_global.bas @@ -1,8 +1,6 @@ -#global dim a as Number ' comment 1 ' comment 2 -#procedure sub Main() print "hi" end sub diff --git a/src/test/programs/misc/comment_after_sub.bas b/src/test/programs/misc/comment_after_sub.bas index 9bfaa451..5d292c52 100644 --- a/src/test/programs/misc/comment_after_sub.bas +++ b/src/test/programs/misc/comment_after_sub.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print "hi" end sub diff --git a/src/test/programs/misc/comment_before_global.bas b/src/test/programs/misc/comment_before_global.bas index 62dc7c07..652f953d 100644 --- a/src/test/programs/misc/comment_before_global.bas +++ b/src/test/programs/misc/comment_before_global.bas @@ -1,7 +1,5 @@ -#global 'comment dim a as Number -#procedure sub Main() print "hi" end sub diff --git a/src/test/programs/misc/comment_before_sub.bas b/src/test/programs/misc/comment_before_sub.bas index 44cf620b..37f242a2 100644 --- a/src/test/programs/misc/comment_before_sub.bas +++ b/src/test/programs/misc/comment_before_sub.bas @@ -1,4 +1,3 @@ -#procedure ' comment sub Main() print "hi" diff --git a/src/test/programs/misc/empty_main.bas b/src/test/programs/misc/empty_main.bas index a246e232..21fa5862 100644 --- a/src/test/programs/misc/empty_main.bas +++ b/src/test/programs/misc/empty_main.bas @@ -1,4 +1,3 @@ -#procedure sub Main() end sub diff --git a/src/test/programs/misc/global_value_number.bas b/src/test/programs/misc/global_value_number.bas index 623b96d6..23514e43 100644 --- a/src/test/programs/misc/global_value_number.bas +++ b/src/test/programs/misc/global_value_number.bas @@ -1,6 +1,4 @@ -#global dim x as Number -#procedure sub Main() x = 5 x = x + 1 diff --git a/src/test/programs/misc/global_value_string.bas b/src/test/programs/misc/global_value_string.bas index 8ee5ce07..3a4eec10 100644 --- a/src/test/programs/misc/global_value_string.bas +++ b/src/test/programs/misc/global_value_string.bas @@ -1,6 +1,4 @@ -#global dim x as String -#procedure sub Main() print x x = "hello" diff --git a/src/test/programs/misc/hello_world.bas b/src/test/programs/misc/hello_world.bas index f60c541a..c9c2c352 100644 --- a/src/test/programs/misc/hello_world.bas +++ b/src/test/programs/misc/hello_world.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print "hello world" end sub diff --git a/src/test/programs/misc/input_string.bas b/src/test/programs/misc/input_string.bas index a9078b1f..b388054c 100644 --- a/src/test/programs/misc/input_string.bas +++ b/src/test/programs/misc/input_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim name as String input name diff --git a/src/test/programs/misc/main_not_first_in_program.bas b/src/test/programs/misc/main_not_first_in_program.bas index 3c8ff3a0..0a617f38 100644 --- a/src/test/programs/misc/main_not_first_in_program.bas +++ b/src/test/programs/misc/main_not_first_in_program.bas @@ -1,8 +1,6 @@ -#procedure sub Extra() print "no" end sub -#procedure sub Main() print "yes" end sub diff --git a/src/test/programs/misc/pascal_triangle.bas b/src/test/programs/misc/pascal_triangle.bas index 27b0c604..4ca79b97 100644 --- a/src/test/programs/misc/pascal_triangle.bas +++ b/src/test/programs/misc/pascal_triangle.bas @@ -1,4 +1,3 @@ -#procedure sub Main() const NUM_ROWS = 22 dim row = [0] diff --git a/src/test/programs/numbers/Ceil.bas b/src/test/programs/numbers/Ceil.bas index 2c08c791..6feb520f 100644 --- a/src/test/programs/numbers/Ceil.bas +++ b/src/test/programs/numbers/Ceil.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Ceil(5.7) print Ceil(3.0) diff --git a/src/test/programs/numbers/Floor.bas b/src/test/programs/numbers/Floor.bas index 37209084..4a9c8779 100644 --- a/src/test/programs/numbers/Floor.bas +++ b/src/test/programs/numbers/Floor.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Floor(5.7) print Floor(3.0) diff --git a/src/test/programs/numbers/convert_number_as_string.bas b/src/test/programs/numbers/convert_number_as_string.bas index 592467f5..7ab6d2ee 100644 --- a/src/test/programs/numbers/convert_number_as_string.bas +++ b/src/test/programs/numbers/convert_number_as_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = 5 as String print a diff --git a/src/test/programs/numbers/math_functions.bas b/src/test/programs/numbers/math_functions.bas index 3ccd7b8f..cf6a252f 100644 --- a/src/test/programs/numbers/math_functions.bas +++ b/src/test/programs/numbers/math_functions.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print "^" print 2^8+1 diff --git a/src/test/programs/numbers/not_Number.bas b/src/test/programs/numbers/not_Number.bas index 72a2b4df..01ad021b 100644 --- a/src/test/programs/numbers/not_Number.bas +++ b/src/test/programs/numbers/not_Number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print not 5 end sub diff --git a/src/test/programs/numbers/number_comparison.bas b/src/test/programs/numbers/number_comparison.bas index e99a657b..5647ad72 100644 --- a/src/test/programs/numbers/number_comparison.bas +++ b/src/test/programs/numbers/number_comparison.bas @@ -1,4 +1,3 @@ -#procedure sub Main() if 5 > 10 then print "5>10" diff --git a/src/test/programs/optionals/HasValue_number_1.bas b/src/test/programs/optionals/HasValue_number_1.bas index 0212295a..ce727f79 100644 --- a/src/test/programs/optionals/HasValue_number_1.bas +++ b/src/test/programs/optionals/HasValue_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional Number if not HasValue(x) then diff --git a/src/test/programs/optionals/HasValue_number_2.bas b/src/test/programs/optionals/HasValue_number_2.bas index 060ac73e..b29f1044 100644 --- a/src/test/programs/optionals/HasValue_number_2.bas +++ b/src/test/programs/optionals/HasValue_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional Number x = 5 diff --git a/src/test/programs/optionals/HasValue_string_1.bas b/src/test/programs/optionals/HasValue_string_1.bas index b3a37312..5c0f8d2f 100644 --- a/src/test/programs/optionals/HasValue_string_1.bas +++ b/src/test/programs/optionals/HasValue_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional String if not HasValue(x) then diff --git a/src/test/programs/optionals/HasValue_string_2.bas b/src/test/programs/optionals/HasValue_string_2.bas index a71ac523..30af5b3f 100644 --- a/src/test/programs/optionals/HasValue_string_2.bas +++ b/src/test/programs/optionals/HasValue_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional String x = "hi" diff --git a/src/test/programs/optionals/Value_number_1.bas b/src/test/programs/optionals/Value_number_1.bas index 4a87c2f6..6db1571c 100644 --- a/src/test/programs/optionals/Value_number_1.bas +++ b/src/test/programs/optionals/Value_number_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional Number try diff --git a/src/test/programs/optionals/Value_number_2.bas b/src/test/programs/optionals/Value_number_2.bas index 39c5716c..99092553 100644 --- a/src/test/programs/optionals/Value_number_2.bas +++ b/src/test/programs/optionals/Value_number_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional Number x = 5 diff --git a/src/test/programs/optionals/Value_string_1.bas b/src/test/programs/optionals/Value_string_1.bas index f88d4c9d..e8f92a1a 100644 --- a/src/test/programs/optionals/Value_string_1.bas +++ b/src/test/programs/optionals/Value_string_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional String try diff --git a/src/test/programs/optionals/Value_string_2.bas b/src/test/programs/optionals/Value_string_2.bas index 19655bd3..94655537 100644 --- a/src/test/programs/optionals/Value_string_2.bas +++ b/src/test/programs/optionals/Value_string_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional String x = "hi" diff --git a/src/test/programs/optionals/convert_number_as_optional.bas b/src/test/programs/optionals/convert_number_as_optional.bas index bd009f28..b9247c72 100644 --- a/src/test/programs/optionals/convert_number_as_optional.bas +++ b/src/test/programs/optionals/convert_number_as_optional.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = 5 dim y = x as Optional Number diff --git a/src/test/programs/optionals/optional_assign.bas b/src/test/programs/optionals/optional_assign.bas index 8ab1ee02..d80c8c74 100644 --- a/src/test/programs/optionals/optional_assign.bas +++ b/src/test/programs/optionals/optional_assign.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Optional Number x = 1 diff --git a/src/test/programs/optionals/optional_parameter.bas b/src/test/programs/optionals/optional_parameter.bas index 44ff6c0c..c843d221 100644 --- a/src/test/programs/optionals/optional_parameter.bas +++ b/src/test/programs/optionals/optional_parameter.bas @@ -1,9 +1,7 @@ -#procedure sub Main() ' Just confirm that this compiles. Foo 5 end sub -#procedure sub Foo(x as Optional Number) print "ok" end sub diff --git a/src/test/programs/print/print.bas b/src/test/programs/print/print.bas index e18fa818..a7fc1722 100644 --- a/src/test/programs/print/print.bas +++ b/src/test/programs/print/print.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print "hello"; " world"; print "!" diff --git a/src/test/programs/print/print_number.bas b/src/test/programs/print/print_number.bas index 5a5155b7..596aadfc 100644 --- a/src/test/programs/print/print_number.bas +++ b/src/test/programs/print/print_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print 5; -6.1 dim a = 7 diff --git a/src/test/programs/procedure_calls/call_function_one_arg.bas b/src/test/programs/procedure_calls/call_function_one_arg.bas index 8ff39138..ddcaef67 100644 --- a/src/test/programs/procedure_calls/call_function_one_arg.bas +++ b/src/test/programs/procedure_calls/call_function_one_arg.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print "hello" print Foo(5) end sub -#procedure function Foo(a as Number) as Number return a end function diff --git a/src/test/programs/procedure_calls/call_function_two_arg.bas b/src/test/programs/procedure_calls/call_function_two_arg.bas index f2a6ba10..5121374b 100644 --- a/src/test/programs/procedure_calls/call_function_two_arg.bas +++ b/src/test/programs/procedure_calls/call_function_two_arg.bas @@ -1,8 +1,6 @@ -#procedure sub Main() print Foo(5, 6) end sub -#procedure function Foo(a as Number, b as Number) as Number return a + b end function diff --git a/src/test/programs/procedure_calls/call_function_zero_arg.bas b/src/test/programs/procedure_calls/call_function_zero_arg.bas index 8923bf77..8a050dbd 100644 --- a/src/test/programs/procedure_calls/call_function_zero_arg.bas +++ b/src/test/programs/procedure_calls/call_function_zero_arg.bas @@ -1,8 +1,6 @@ -#procedure sub Main() print Foo() end sub -#procedure function Foo() as Number return 5 end function diff --git a/src/test/programs/procedure_calls/call_sub.bas b/src/test/programs/procedure_calls/call_sub.bas index 8d119b1b..ae911f71 100644 --- a/src/test/programs/procedure_calls/call_sub.bas +++ b/src/test/programs/procedure_calls/call_sub.bas @@ -1,8 +1,6 @@ -#procedure sub Second() print "hello" end sub -#procedure sub Main() Second print "world" diff --git a/src/test/programs/procedure_calls/call_sub_arg.bas b/src/test/programs/procedure_calls/call_sub_arg.bas index 5b23abd0..2a68032d 100644 --- a/src/test/programs/procedure_calls/call_sub_arg.bas +++ b/src/test/programs/procedure_calls/call_sub_arg.bas @@ -1,8 +1,6 @@ -#procedure sub Second(x as String) print x end sub -#procedure sub Main() Second "hello" print "world" diff --git a/src/test/programs/procedure_calls/early_return_dim_list_1.bas b/src/test/programs/procedure_calls/early_return_dim_list_1.bas index 61fa6b15..a339ea6b 100644 --- a/src/test/programs/procedure_calls/early_return_dim_list_1.bas +++ b/src/test/programs/procedure_calls/early_return_dim_list_1.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number dim list foo end dim diff --git a/src/test/programs/procedure_calls/early_return_dim_list_2.bas b/src/test/programs/procedure_calls/early_return_dim_list_2.bas index fd29a4dc..f539f213 100644 --- a/src/test/programs/procedure_calls/early_return_dim_list_2.bas +++ b/src/test/programs/procedure_calls/early_return_dim_list_2.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number dim list foo yield 1 diff --git a/src/test/programs/procedure_calls/early_return_dim_list_3.bas b/src/test/programs/procedure_calls/early_return_dim_list_3.bas index 1592ca6a..7bedf25e 100644 --- a/src/test/programs/procedure_calls/early_return_dim_list_3.bas +++ b/src/test/programs/procedure_calls/early_return_dim_list_3.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number dim list foo yield 1 diff --git a/src/test/programs/procedure_calls/early_return_dim_map_1.bas b/src/test/programs/procedure_calls/early_return_dim_map_1.bas index f989f884..4bdac224 100644 --- a/src/test/programs/procedure_calls/early_return_dim_map_1.bas +++ b/src/test/programs/procedure_calls/early_return_dim_map_1.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number dim map foo end dim diff --git a/src/test/programs/procedure_calls/early_return_dim_map_2.bas b/src/test/programs/procedure_calls/early_return_dim_map_2.bas index affd76ba..d323a4c1 100644 --- a/src/test/programs/procedure_calls/early_return_dim_map_2.bas +++ b/src/test/programs/procedure_calls/early_return_dim_map_2.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number dim map foo yield 1 to 1 diff --git a/src/test/programs/procedure_calls/early_return_dim_map_3.bas b/src/test/programs/procedure_calls/early_return_dim_map_3.bas index d192f098..ad3bbca3 100644 --- a/src/test/programs/procedure_calls/early_return_dim_map_3.bas +++ b/src/test/programs/procedure_calls/early_return_dim_map_3.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number dim map foo yield 1 to 1 diff --git a/src/test/programs/procedure_calls/early_return_dim_set_1.bas b/src/test/programs/procedure_calls/early_return_dim_set_1.bas index 685c3ccd..64519924 100644 --- a/src/test/programs/procedure_calls/early_return_dim_set_1.bas +++ b/src/test/programs/procedure_calls/early_return_dim_set_1.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number dim set foo end dim diff --git a/src/test/programs/procedure_calls/early_return_dim_set_2.bas b/src/test/programs/procedure_calls/early_return_dim_set_2.bas index 999da2b5..1d093329 100644 --- a/src/test/programs/procedure_calls/early_return_dim_set_2.bas +++ b/src/test/programs/procedure_calls/early_return_dim_set_2.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number dim set foo yield 1 diff --git a/src/test/programs/procedure_calls/early_return_dim_set_3.bas b/src/test/programs/procedure_calls/early_return_dim_set_3.bas index 24f9d950..dc6279ff 100644 --- a/src/test/programs/procedure_calls/early_return_dim_set_3.bas +++ b/src/test/programs/procedure_calls/early_return_dim_set_3.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number dim set foo yield 1 diff --git a/src/test/programs/procedure_calls/early_return_do_1.bas b/src/test/programs/procedure_calls/early_return_do_1.bas index dc231fff..2c3aaba4 100644 --- a/src/test/programs/procedure_calls/early_return_do_1.bas +++ b/src/test/programs/procedure_calls/early_return_do_1.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do loop while x = 5 diff --git a/src/test/programs/procedure_calls/early_return_do_2.bas b/src/test/programs/procedure_calls/early_return_do_2.bas index e9c46920..b26b5139 100644 --- a/src/test/programs/procedure_calls/early_return_do_2.bas +++ b/src/test/programs/procedure_calls/early_return_do_2.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do return 1 diff --git a/src/test/programs/procedure_calls/early_return_do_3.bas b/src/test/programs/procedure_calls/early_return_do_3.bas index d14b5b83..07081d19 100644 --- a/src/test/programs/procedure_calls/early_return_do_3.bas +++ b/src/test/programs/procedure_calls/early_return_do_3.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do do diff --git a/src/test/programs/procedure_calls/early_return_do_4.bas b/src/test/programs/procedure_calls/early_return_do_4.bas index 78053c0a..fda909da 100644 --- a/src/test/programs/procedure_calls/early_return_do_4.bas +++ b/src/test/programs/procedure_calls/early_return_do_4.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do throw 999, "blah" diff --git a/src/test/programs/procedure_calls/early_return_do_5.bas b/src/test/programs/procedure_calls/early_return_do_5.bas index 1db825ae..9c03fedf 100644 --- a/src/test/programs/procedure_calls/early_return_do_5.bas +++ b/src/test/programs/procedure_calls/early_return_do_5.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do do diff --git a/src/test/programs/procedure_calls/early_return_do_exit_1.bas b/src/test/programs/procedure_calls/early_return_do_exit_1.bas index ef978314..5e011dff 100644 --- a/src/test/programs/procedure_calls/early_return_do_exit_1.bas +++ b/src/test/programs/procedure_calls/early_return_do_exit_1.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do exit do diff --git a/src/test/programs/procedure_calls/early_return_do_exit_2.bas b/src/test/programs/procedure_calls/early_return_do_exit_2.bas index ebea2744..bc694cfa 100644 --- a/src/test/programs/procedure_calls/early_return_do_exit_2.bas +++ b/src/test/programs/procedure_calls/early_return_do_exit_2.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do if x = 1 then diff --git a/src/test/programs/procedure_calls/early_return_do_exit_3.bas b/src/test/programs/procedure_calls/early_return_do_exit_3.bas index d0235ba0..84d29a4e 100644 --- a/src/test/programs/procedure_calls/early_return_do_exit_3.bas +++ b/src/test/programs/procedure_calls/early_return_do_exit_3.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do ' This inner loop is a red herring. It doesn't matter what happens in this loop... diff --git a/src/test/programs/procedure_calls/early_return_do_exit_4.bas b/src/test/programs/procedure_calls/early_return_do_exit_4.bas index cf7c6ed1..a5d7441b 100644 --- a/src/test/programs/procedure_calls/early_return_do_exit_4.bas +++ b/src/test/programs/procedure_calls/early_return_do_exit_4.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do exit do diff --git a/src/test/programs/procedure_calls/early_return_do_exit_5.bas b/src/test/programs/procedure_calls/early_return_do_exit_5.bas index dae23b6b..bb0abd82 100644 --- a/src/test/programs/procedure_calls/early_return_do_exit_5.bas +++ b/src/test/programs/procedure_calls/early_return_do_exit_5.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number do if x = 1 then diff --git a/src/test/programs/procedure_calls/early_return_if_1.bas b/src/test/programs/procedure_calls/early_return_if_1.bas index cfd8021b..b14697b6 100644 --- a/src/test/programs/procedure_calls/early_return_if_1.bas +++ b/src/test/programs/procedure_calls/early_return_if_1.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number if x = 0 then return 1 diff --git a/src/test/programs/procedure_calls/early_return_if_2.bas b/src/test/programs/procedure_calls/early_return_if_2.bas index 4a55329a..c543caf1 100644 --- a/src/test/programs/procedure_calls/early_return_if_2.bas +++ b/src/test/programs/procedure_calls/early_return_if_2.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number if x = 0 then return 1 diff --git a/src/test/programs/procedure_calls/early_return_if_3.bas b/src/test/programs/procedure_calls/early_return_if_3.bas index 1904ed74..c1f1c25f 100644 --- a/src/test/programs/procedure_calls/early_return_if_3.bas +++ b/src/test/programs/procedure_calls/early_return_if_3.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number if x = 0 then throw 999, "blah" diff --git a/src/test/programs/procedure_calls/early_return_if_4.bas b/src/test/programs/procedure_calls/early_return_if_4.bas index 11d83b4c..29f415c2 100644 --- a/src/test/programs/procedure_calls/early_return_if_4.bas +++ b/src/test/programs/procedure_calls/early_return_if_4.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number if x = 0 then throw 111, "foo" diff --git a/src/test/programs/procedure_calls/early_return_select_case_1.bas b/src/test/programs/procedure_calls/early_return_select_case_1.bas index 7ffb2ed6..271d580f 100644 --- a/src/test/programs/procedure_calls/early_return_select_case_1.bas +++ b/src/test/programs/procedure_calls/early_return_select_case_1.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number select case x case 1 diff --git a/src/test/programs/procedure_calls/early_return_select_case_2.bas b/src/test/programs/procedure_calls/early_return_select_case_2.bas index db464063..a6e7dc30 100644 --- a/src/test/programs/procedure_calls/early_return_select_case_2.bas +++ b/src/test/programs/procedure_calls/early_return_select_case_2.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number select case x case 1 diff --git a/src/test/programs/procedure_calls/early_return_select_case_3.bas b/src/test/programs/procedure_calls/early_return_select_case_3.bas index 3ef751d1..04f0e25a 100644 --- a/src/test/programs/procedure_calls/early_return_select_case_3.bas +++ b/src/test/programs/procedure_calls/early_return_select_case_3.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number select case x case 1 diff --git a/src/test/programs/procedure_calls/early_return_select_case_4.bas b/src/test/programs/procedure_calls/early_return_select_case_4.bas index 85fc7fe9..4f4140a7 100644 --- a/src/test/programs/procedure_calls/early_return_select_case_4.bas +++ b/src/test/programs/procedure_calls/early_return_select_case_4.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number select case x case 1 diff --git a/src/test/programs/procedure_calls/early_return_select_case_5.bas b/src/test/programs/procedure_calls/early_return_select_case_5.bas index ed44708b..554882c4 100644 --- a/src/test/programs/procedure_calls/early_return_select_case_5.bas +++ b/src/test/programs/procedure_calls/early_return_select_case_5.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number select case x case 1 diff --git a/src/test/programs/procedure_calls/early_return_select_case_6.bas b/src/test/programs/procedure_calls/early_return_select_case_6.bas index bf236eb1..c2e48fb7 100644 --- a/src/test/programs/procedure_calls/early_return_select_case_6.bas +++ b/src/test/programs/procedure_calls/early_return_select_case_6.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number select case x case 1 diff --git a/src/test/programs/procedure_calls/early_return_select_case_7.bas b/src/test/programs/procedure_calls/early_return_select_case_7.bas index 21075bb5..7975cb52 100644 --- a/src/test/programs/procedure_calls/early_return_select_case_7.bas +++ b/src/test/programs/procedure_calls/early_return_select_case_7.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number select case x case 1 diff --git a/src/test/programs/procedure_calls/early_return_select_case_8.bas b/src/test/programs/procedure_calls/early_return_select_case_8.bas index ffd6e15e..3b6c4794 100644 --- a/src/test/programs/procedure_calls/early_return_select_case_8.bas +++ b/src/test/programs/procedure_calls/early_return_select_case_8.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number select case x case 1 diff --git a/src/test/programs/procedure_calls/early_return_try_1.bas b/src/test/programs/procedure_calls/early_return_try_1.bas index 5fdd2ad1..69ba1981 100644 --- a/src/test/programs/procedure_calls/early_return_try_1.bas +++ b/src/test/programs/procedure_calls/early_return_try_1.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number try catch diff --git a/src/test/programs/procedure_calls/early_return_try_2.bas b/src/test/programs/procedure_calls/early_return_try_2.bas index 5620e9da..db53a3de 100644 --- a/src/test/programs/procedure_calls/early_return_try_2.bas +++ b/src/test/programs/procedure_calls/early_return_try_2.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number try return 1 diff --git a/src/test/programs/procedure_calls/early_return_try_3.bas b/src/test/programs/procedure_calls/early_return_try_3.bas index 18e21354..ade367d6 100644 --- a/src/test/programs/procedure_calls/early_return_try_3.bas +++ b/src/test/programs/procedure_calls/early_return_try_3.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number try catch diff --git a/src/test/programs/procedure_calls/early_return_try_4.bas b/src/test/programs/procedure_calls/early_return_try_4.bas index e5a50c9c..9d59d9ec 100644 --- a/src/test/programs/procedure_calls/early_return_try_4.bas +++ b/src/test/programs/procedure_calls/early_return_try_4.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number try return 1 diff --git a/src/test/programs/procedure_calls/early_return_try_5.bas b/src/test/programs/procedure_calls/early_return_try_5.bas index c2ac9e3c..54ead468 100644 --- a/src/test/programs/procedure_calls/early_return_try_5.bas +++ b/src/test/programs/procedure_calls/early_return_try_5.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number try throw 999, "blah" diff --git a/src/test/programs/procedure_calls/early_return_try_6.bas b/src/test/programs/procedure_calls/early_return_try_6.bas index 567e55ea..68cbdb60 100644 --- a/src/test/programs/procedure_calls/early_return_try_6.bas +++ b/src/test/programs/procedure_calls/early_return_try_6.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number try catch diff --git a/src/test/programs/procedure_calls/early_return_try_7.bas b/src/test/programs/procedure_calls/early_return_try_7.bas index affeddf9..887e0a9c 100644 --- a/src/test/programs/procedure_calls/early_return_try_7.bas +++ b/src/test/programs/procedure_calls/early_return_try_7.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number try throw 111, "foo" diff --git a/src/test/programs/procedure_calls/early_return_try_8.bas b/src/test/programs/procedure_calls/early_return_try_8.bas index 6f0edc1a..ab246c77 100644 --- a/src/test/programs/procedure_calls/early_return_try_8.bas +++ b/src/test/programs/procedure_calls/early_return_try_8.bas @@ -1,9 +1,7 @@ -#procedure sub Main() print Foo(123) end sub -#procedure function Foo(x as Number) as Number try throw 111, "foo" diff --git a/src/test/programs/procedure_calls/early_return_while_false_1.bas b/src/test/programs/procedure_calls/early_return_while_false_1.bas index 10581bea..607c9891 100644 --- a/src/test/programs/procedure_calls/early_return_while_false_1.bas +++ b/src/test/programs/procedure_calls/early_return_while_false_1.bas @@ -1,11 +1,9 @@ -#procedure function Foo() as Number while false return 1 wend end function -#procedure sub Main() end sub diff --git a/src/test/programs/procedure_calls/early_return_while_false_2.bas b/src/test/programs/procedure_calls/early_return_while_false_2.bas index 867414bc..b6a41254 100644 --- a/src/test/programs/procedure_calls/early_return_while_false_2.bas +++ b/src/test/programs/procedure_calls/early_return_while_false_2.bas @@ -1,11 +1,9 @@ -#procedure function Foo() as Number while false throw 999, "blah" wend end function -#procedure sub Main() end sub diff --git a/src/test/programs/procedure_calls/early_return_while_true_1.bas b/src/test/programs/procedure_calls/early_return_while_true_1.bas index 5d222b5b..852d3722 100644 --- a/src/test/programs/procedure_calls/early_return_while_true_1.bas +++ b/src/test/programs/procedure_calls/early_return_while_true_1.bas @@ -1,4 +1,3 @@ -#procedure function Foo() as Number ' At runtime this would return. However, we aren't smart enough to know at runtime that ' while true will execute the loop body at least once. @@ -7,7 +6,6 @@ function Foo() as Number wend end function -#procedure sub Main() end sub diff --git a/src/test/programs/procedure_calls/early_return_while_true_2.bas b/src/test/programs/procedure_calls/early_return_while_true_2.bas index c6010d22..213e92cf 100644 --- a/src/test/programs/procedure_calls/early_return_while_true_2.bas +++ b/src/test/programs/procedure_calls/early_return_while_true_2.bas @@ -1,4 +1,3 @@ -#procedure function Foo() as Number ' At runtime this would return. However, we aren't smart enough to know at runtime that ' while true will execute the loop body at least once. @@ -7,7 +6,6 @@ function Foo() as Number wend end function -#procedure sub Main() end sub diff --git a/src/test/programs/procedure_calls/function_with_no_parameters_1.bas b/src/test/programs/procedure_calls/function_with_no_parameters_1.bas index caed0f70..446f88b5 100644 --- a/src/test/programs/procedure_calls/function_with_no_parameters_1.bas +++ b/src/test/programs/procedure_calls/function_with_no_parameters_1.bas @@ -1,9 +1,7 @@ -#procedure function Foo() as Number return 42 end function -#procedure sub Main() print Foo() end sub diff --git a/src/test/programs/procedure_calls/function_with_no_parameters_2.bas b/src/test/programs/procedure_calls/function_with_no_parameters_2.bas index e44d188d..b2467155 100644 --- a/src/test/programs/procedure_calls/function_with_no_parameters_2.bas +++ b/src/test/programs/procedure_calls/function_with_no_parameters_2.bas @@ -1,9 +1,7 @@ -#procedure function Foo() as Number return 42 end function -#procedure sub Main() ' Must use parentheses when calling a function. print Foo diff --git a/src/test/programs/procedure_calls/missing_return_empty_function.bas b/src/test/programs/procedure_calls/missing_return_empty_function.bas index b48016a7..bdbc9b53 100644 --- a/src/test/programs/procedure_calls/missing_return_empty_function.bas +++ b/src/test/programs/procedure_calls/missing_return_empty_function.bas @@ -1,8 +1,6 @@ -#procedure function Foo() as Number end function -#procedure sub Main() end sub diff --git a/src/test/programs/procedure_calls/return_nothing_in_function.bas b/src/test/programs/procedure_calls/return_nothing_in_function.bas index d789b086..2e1bc05f 100644 --- a/src/test/programs/procedure_calls/return_nothing_in_function.bas +++ b/src/test/programs/procedure_calls/return_nothing_in_function.bas @@ -1,8 +1,6 @@ -#procedure sub Main() end sub -#procedure function Foo() as Number return end function diff --git a/src/test/programs/procedure_calls/return_value_in_subroutine.bas b/src/test/programs/procedure_calls/return_value_in_subroutine.bas index 06dcd6f6..afba8a1c 100644 --- a/src/test/programs/procedure_calls/return_value_in_subroutine.bas +++ b/src/test/programs/procedure_calls/return_value_in_subroutine.bas @@ -1,8 +1,6 @@ -#procedure sub Main() end sub -#procedure sub Foo() return 1 end sub diff --git a/src/test/programs/procedure_calls/wrong_return_type.bas b/src/test/programs/procedure_calls/wrong_return_type.bas index 4c8f0fa0..5d66d702 100644 --- a/src/test/programs/procedure_calls/wrong_return_type.bas +++ b/src/test/programs/procedure_calls/wrong_return_type.bas @@ -1,9 +1,7 @@ -#procedure function Foo() as Number return "hello" end function -#procedure sub Main() print Foo() end sub diff --git a/src/test/programs/records/anonymous_to_named_record_conversion_inside_for.bas b/src/test/programs/records/anonymous_to_named_record_conversion_inside_for.bas index e4d40c6d..d0b4cc2d 100644 --- a/src/test/programs/records/anonymous_to_named_record_conversion_inside_for.bas +++ b/src/test/programs/records/anonymous_to_named_record_conversion_inside_for.bas @@ -1,9 +1,7 @@ -#type type Bar baz as Number end type -#procedure sub Main() for i = 1 to 1 dim x = { baz: 0 } as Bar diff --git a/src/test/programs/records/anonymous_to_named_record_conversion_inside_foreach.bas b/src/test/programs/records/anonymous_to_named_record_conversion_inside_foreach.bas index 46f6de06..5ae45586 100644 --- a/src/test/programs/records/anonymous_to_named_record_conversion_inside_foreach.bas +++ b/src/test/programs/records/anonymous_to_named_record_conversion_inside_foreach.bas @@ -1,9 +1,7 @@ -#type type Bar baz as Number end type -#procedure sub Main() dim aaa as List of Number for each bbb in aaa diff --git a/src/test/programs/records/anonymous_to_named_record_conversion_inside_if.bas b/src/test/programs/records/anonymous_to_named_record_conversion_inside_if.bas index a99ef070..7b473615 100644 --- a/src/test/programs/records/anonymous_to_named_record_conversion_inside_if.bas +++ b/src/test/programs/records/anonymous_to_named_record_conversion_inside_if.bas @@ -1,9 +1,7 @@ -#type type Bar baz as Number end type -#procedure sub Main() if true then dim x = { baz: 0 } as Bar diff --git a/src/test/programs/records/anonymous_to_named_record_conversion_inside_while.bas b/src/test/programs/records/anonymous_to_named_record_conversion_inside_while.bas index 89c377cb..ac8c3340 100644 --- a/src/test/programs/records/anonymous_to_named_record_conversion_inside_while.bas +++ b/src/test/programs/records/anonymous_to_named_record_conversion_inside_while.bas @@ -1,9 +1,7 @@ -#type type Bar baz as Number end type -#procedure sub Main() while false dim x = { baz: 0 } as Bar diff --git a/src/test/programs/records/anonymous_to_named_record_conversion_outside_block.bas b/src/test/programs/records/anonymous_to_named_record_conversion_outside_block.bas index 32cf03d4..ce6f8d9a 100644 --- a/src/test/programs/records/anonymous_to_named_record_conversion_outside_block.bas +++ b/src/test/programs/records/anonymous_to_named_record_conversion_outside_block.bas @@ -1,9 +1,7 @@ -#type type Bar baz as Number end type -#procedure sub Main() dim x = { baz: 0 } as Bar print "ok" diff --git a/src/test/programs/records/list_of_named_record_explicit_conversion.bas b/src/test/programs/records/list_of_named_record_explicit_conversion.bas index 28ec691c..3dec4f87 100644 --- a/src/test/programs/records/list_of_named_record_explicit_conversion.bas +++ b/src/test/programs/records/list_of_named_record_explicit_conversion.bas @@ -1,14 +1,11 @@ -#type type Foo zzz as Number end type -#type type Bar baz as Foo end type -#procedure sub Main() dim f as Foo dim x = { baz: f } as Bar diff --git a/src/test/programs/records/named_record_type_1.bas b/src/test/programs/records/named_record_type_1.bas index ff67caea..9d40322c 100644 --- a/src/test/programs/records/named_record_type_1.bas +++ b/src/test/programs/records/named_record_type_1.bas @@ -1,9 +1,7 @@ -#type type MyRecord a as Number b as String end type -#procedure sub Main() dim x as MyRecord print x.a diff --git a/src/test/programs/records/named_record_type_2.bas b/src/test/programs/records/named_record_type_2.bas index d9138abf..e4197358 100644 --- a/src/test/programs/records/named_record_type_2.bas +++ b/src/test/programs/records/named_record_type_2.bas @@ -1,13 +1,10 @@ -#type type MyRecord a as Number b as String end type -#procedure function Foo() as MyRecord return { a: 5, b: "hello" } as MyRecord end function -#procedure sub Main() dim x = Foo() print x.a diff --git a/src/test/programs/records/record_default.bas b/src/test/programs/records/record_default.bas index 7c7f6d65..6bb17d19 100644 --- a/src/test/programs/records/record_default.bas +++ b/src/test/programs/records/record_default.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x as Record (foo as Number, bar as String) print x.foo diff --git a/src/test/programs/records/record_field_get_1.bas b/src/test/programs/records/record_field_get_1.bas index 6b42d244..267e7faa 100644 --- a/src/test/programs/records/record_field_get_1.bas +++ b/src/test/programs/records/record_field_get_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { foo: 1, bar: 2 } print x.foo diff --git a/src/test/programs/records/record_field_get_2.bas b/src/test/programs/records/record_field_get_2.bas index 7db51857..85648429 100644 --- a/src/test/programs/records/record_field_get_2.bas +++ b/src/test/programs/records/record_field_get_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim y = { baz: 3 } dim x = { foo: y, bar: 2 } diff --git a/src/test/programs/records/record_field_get_3.bas b/src/test/programs/records/record_field_get_3.bas index b6c071bc..c59dbf5f 100644 --- a/src/test/programs/records/record_field_get_3.bas +++ b/src/test/programs/records/record_field_get_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { foo: { baz: 3 }, bar: 2 } print x.foo.baz diff --git a/src/test/programs/records/record_field_get_4.bas b/src/test/programs/records/record_field_get_4.bas index 7327d493..c60e1da9 100644 --- a/src/test/programs/records/record_field_get_4.bas +++ b/src/test/programs/records/record_field_get_4.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { foo: [1, 2, 3], bar: 4 } print x.foo(1) diff --git a/src/test/programs/records/record_field_get_5.bas b/src/test/programs/records/record_field_get_5.bas index 2b513fe4..a585ec5a 100644 --- a/src/test/programs/records/record_field_get_5.bas +++ b/src/test/programs/records/record_field_get_5.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { foo: [1, 2, 3], bar: 4 } dim i = 1 diff --git a/src/test/programs/records/record_field_get_6.bas b/src/test/programs/records/record_field_get_6.bas index 594b81d2..d04cce6a 100644 --- a/src/test/programs/records/record_field_get_6.bas +++ b/src/test/programs/records/record_field_get_6.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { foo: [111, 222, 333], bar: 444 } dim i = 1 diff --git a/src/test/programs/records/record_field_get_7.bas b/src/test/programs/records/record_field_get_7.bas index ccee960a..c9531467 100644 --- a/src/test/programs/records/record_field_get_7.bas +++ b/src/test/programs/records/record_field_get_7.bas @@ -1,8 +1,6 @@ -#procedure function GetNum() as Number return 1 end function -#procedure sub Main() dim x = { foo: [111, 222, 333], bar: 444 } dim i = 1 diff --git a/src/test/programs/records/record_field_get_8.bas b/src/test/programs/records/record_field_get_8.bas index afd4428c..87962ab5 100644 --- a/src/test/programs/records/record_field_get_8.bas +++ b/src/test/programs/records/record_field_get_8.bas @@ -1,8 +1,6 @@ -#procedure function GetNum(i as Number) as Number return i end function -#procedure sub Main() dim x = { foo: [111, 222, 333], bar: 444 } dim i = 1 diff --git a/src/test/programs/records/record_field_set.bas b/src/test/programs/records/record_field_set.bas index 13f9187b..be67e435 100644 --- a/src/test/programs/records/record_field_set.bas +++ b/src/test/programs/records/record_field_set.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { foo: 1, bar: 2 } x.foo = 999 diff --git a/src/test/programs/records/record_list_field.bas b/src/test/programs/records/record_list_field.bas index 1179b9bd..c7a33b0e 100644 --- a/src/test/programs/records/record_list_field.bas +++ b/src/test/programs/records/record_list_field.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { foo: [1, 2, 3], bar: 4 } print x.foo(0) diff --git a/src/test/programs/records/record_literal.bas b/src/test/programs/records/record_literal.bas index 7131129e..1f4efc51 100644 --- a/src/test/programs/records/record_literal.bas +++ b/src/test/programs/records/record_literal.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { foo: 1, bar: "A" } print x.foo diff --git a/src/test/programs/records/record_named_1.bas b/src/test/programs/records/record_named_1.bas index 2be4ca99..fcb40b1b 100644 --- a/src/test/programs/records/record_named_1.bas +++ b/src/test/programs/records/record_named_1.bas @@ -1,8 +1,6 @@ -#type type Foo a as Number end type -#procedure sub Main() dim bar as Foo print bar.a diff --git a/src/test/programs/records/record_named_2.bas b/src/test/programs/records/record_named_2.bas index 72f27521..3ecc1ebc 100644 --- a/src/test/programs/records/record_named_2.bas +++ b/src/test/programs/records/record_named_2.bas @@ -1,8 +1,6 @@ -#type type Foo a as Number end type -#procedure sub Main() dim bar = { a: 5 } as Foo print bar.a diff --git a/src/test/programs/records/record_named_3.bas b/src/test/programs/records/record_named_3.bas index f4b3b0c2..bc17d956 100644 --- a/src/test/programs/records/record_named_3.bas +++ b/src/test/programs/records/record_named_3.bas @@ -1,8 +1,6 @@ -#type type Foo a as Number end type -#procedure sub Main() dim bar = { a: 5 } as Foo dim baz = bar as record (a as Number) diff --git a/src/test/programs/records/record_named_4.bas b/src/test/programs/records/record_named_4.bas index 76f835ed..c2099790 100644 --- a/src/test/programs/records/record_named_4.bas +++ b/src/test/programs/records/record_named_4.bas @@ -1,9 +1,7 @@ -#type type Foo a as Number b as Number end type -#procedure sub Main() dim bar = { a: 5 } as Foo end sub diff --git a/src/test/programs/records/record_named_5.bas b/src/test/programs/records/record_named_5.bas index 33f92d66..d5cbed3d 100644 --- a/src/test/programs/records/record_named_5.bas +++ b/src/test/programs/records/record_named_5.bas @@ -1,9 +1,7 @@ -#type type Foo a as Number b as Number end type -#procedure sub Main() dim bar = { a: 5, b: 6 } as Foo dim baz = bar as record (a as Number) diff --git a/src/test/programs/records/record_named_6.bas b/src/test/programs/records/record_named_6.bas index 83ef5a53..98e5fb8b 100644 --- a/src/test/programs/records/record_named_6.bas +++ b/src/test/programs/records/record_named_6.bas @@ -1,8 +1,6 @@ -#type type Foo z as Number end type -#procedure sub Main() dim bar = { a: 5 } as Foo end sub diff --git a/src/test/programs/records/record_named_7.bas b/src/test/programs/records/record_named_7.bas index 1ed135d2..e93ff48e 100644 --- a/src/test/programs/records/record_named_7.bas +++ b/src/test/programs/records/record_named_7.bas @@ -1,8 +1,6 @@ -#type type Foo z as Number end type -#procedure sub Main() dim bar = { z: 5 } as Foo dim baz = bar as record (a as Number) diff --git a/src/test/programs/records/record_nested.bas b/src/test/programs/records/record_nested.bas index 4dda227d..52219505 100644 --- a/src/test/programs/records/record_nested.bas +++ b/src/test/programs/records/record_nested.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = { a: { b: 1, c: 2 }, d: 3 } print x.a.b diff --git a/src/test/programs/records/record_print.bas b/src/test/programs/records/record_print.bas index 4a2cad2c..879b28b0 100644 --- a/src/test/programs/records/record_print.bas +++ b/src/test/programs/records/record_print.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = { myNumber: 123, myBool: true, myString: "Hello", mySubRecord: { subNumber: 1, subString: "Hello" } } print a diff --git a/src/test/programs/records/return_named_record_1.bas b/src/test/programs/records/return_named_record_1.bas index 48440f74..99ab1eb3 100644 --- a/src/test/programs/records/return_named_record_1.bas +++ b/src/test/programs/records/return_named_record_1.bas @@ -1,14 +1,11 @@ -#type type Foo a as Number end type -#procedure sub Main() print Bar().a end sub -#procedure function Bar() as Foo return { a: 1 } as Foo end function diff --git a/src/test/programs/records/return_named_record_2.bas b/src/test/programs/records/return_named_record_2.bas index 167cdc2d..0bde5bb9 100644 --- a/src/test/programs/records/return_named_record_2.bas +++ b/src/test/programs/records/return_named_record_2.bas @@ -1,16 +1,13 @@ -#type type Foo a as Number end type -#procedure sub Main() dim foo as Foo foo = Bar() print foo.a end sub -#procedure function Bar() as Foo return { a: 1 } as Foo end function diff --git a/src/test/programs/records/return_named_record_explicitly_converted_to_optional.bas b/src/test/programs/records/return_named_record_explicitly_converted_to_optional.bas index b7d07ca3..c0307118 100644 --- a/src/test/programs/records/return_named_record_explicitly_converted_to_optional.bas +++ b/src/test/programs/records/return_named_record_explicitly_converted_to_optional.bas @@ -1,14 +1,11 @@ -#type type MyType end type -#procedure function Foo() as Optional MyType dim x as MyType return x as Optional MyType end function -#procedure sub Main() dim x = Value(Foo()) end sub diff --git a/src/test/programs/records/return_named_record_implicitly_converted_to_optional.bas b/src/test/programs/records/return_named_record_implicitly_converted_to_optional.bas index c6cbd4b1..77443e8f 100644 --- a/src/test/programs/records/return_named_record_implicitly_converted_to_optional.bas +++ b/src/test/programs/records/return_named_record_implicitly_converted_to_optional.bas @@ -1,14 +1,11 @@ -#type type MyType end type -#procedure function Foo() as Optional MyType dim x as MyType return x end function -#procedure sub Main() dim x = Value(Foo()) end sub diff --git a/src/test/programs/samples/advent_of_code_2023_day1.bas b/src/test/programs/samples/advent_of_code_2023_day1.bas index 407fe56c..395e6bad 100644 --- a/src/test/programs/samples/advent_of_code_2023_day1.bas +++ b/src/test/programs/samples/advent_of_code_2023_day1.bas @@ -1,4 +1,3 @@ -#procedure function Part1(line as List of String) as Number dim firstDigit as Optional String dim lastDigit as String @@ -15,7 +14,6 @@ function Part1(line as List of String) as Number return ParseNumber(Value(firstDigit) + lastDigit) end function -#procedure function Part2(lineChs as List of String) as Number dim firstDigit as Optional Number dim lastDigit as Number @@ -33,7 +31,6 @@ function Part2(lineChs as List of String) as Number return 10 * Value(firstDigit) + lastDigit end function -#procedure sub Main() dim lines = ReadFileLines("../src/test/files/advent_of_code_2023_day1_input.txt") dim sum1 = 0 @@ -47,25 +44,21 @@ sub Main() print sum2 end sub -#procedure function Range(chars as List of String, offset as Number, length as Number) as String dim subchars = Mid(chars, offset, length) return Concat(subchars) end function -#procedure function Match(chars as List of String, offset as Number, target as String) as Boolean dim substr = Range(chars, offset, Len(target)) return substr = target end function -#procedure function IsDigit(ch as String) as Boolean dim asc = CodeUnit(ch) return asc >= 48 and asc <= 57 end function -#procedure function GetDigit(chs as List of String, i as Number) as Number dim ch = chs(i) dim asc = CodeUnit(ch) diff --git a/src/test/programs/samples/advent_of_code_2023_day2.bas b/src/test/programs/samples/advent_of_code_2023_day2.bas index 6f3277f4..044be686 100644 --- a/src/test/programs/samples/advent_of_code_2023_day2.bas +++ b/src/test/programs/samples/advent_of_code_2023_day2.bas @@ -1,11 +1,9 @@ -#type type Round red as Number green as Number blue as Number end type -#procedure function ParseRounds(parts as List of String) as List of Round ' Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green dim rounds as List of Round @@ -37,7 +35,6 @@ function ParseRounds(parts as List of String) as List of Round return rounds end function -#procedure function ParseGameNumber(part as String) as Number ' part is like "1:" dim partCodeUnits = CodeUnits(part) @@ -45,7 +42,6 @@ function ParseGameNumber(part as String) as Number return ParseNumber(StringFromCodeUnits(truncatedCodeUnits)) end function -#procedure function Part1(gameNumber as Number, rounds as List of Round) as Number for each r in rounds if r.red > 12 or r.green > 13 or r.blue > 14 then @@ -55,7 +51,6 @@ function Part1(gameNumber as Number, rounds as List of Round) as Number return gameNumber end function -#procedure function Part2(gameNumber as Number, rounds as List of Round) as Number dim maxRed = 0 dim maxGreen = 0 @@ -74,7 +69,6 @@ function Part2(gameNumber as Number, rounds as List of Round) as Number return maxRed * maxGreen * maxBlue end function -#procedure sub Main() dim lines = ReadFileLines("../src/test/files/advent_of_code_2023_day2_input.txt") dim sum1 = 0 diff --git a/src/test/programs/samples/advent_of_code_2023_day3_part1.bas b/src/test/programs/samples/advent_of_code_2023_day3_part1.bas index 3af6f52b..4e2a7788 100644 --- a/src/test/programs/samples/advent_of_code_2023_day3_part1.bas +++ b/src/test/programs/samples/advent_of_code_2023_day3_part1.bas @@ -1,8 +1,6 @@ -#global ' Two extra for the buffer we add on either side. const kWidth = 142 -#procedure sub Part1(grid as List of List of Number) dim sum = 0 @@ -48,7 +46,6 @@ sub Part1(grid as List of List of Number) print sum end sub -#procedure sub Main() dim lines = ReadFileLines("../src/test/files/advent_of_code_2023_day3_input.txt") dim grid = [ListFill(46, kWidth)] @@ -61,7 +58,6 @@ sub Main() Part1 grid end sub -#procedure function IsPunctuationInRange(grid as List of List of Number, minRow as Number, minCol as Number, maxRow as Number, maxCol as Number) as Boolean for row = minRow to maxRow for col = minCol to maxCol diff --git a/src/test/programs/samples/advent_of_code_2023_day3_part2.bas b/src/test/programs/samples/advent_of_code_2023_day3_part2.bas index 8ebda2ab..11216ecb 100644 --- a/src/test/programs/samples/advent_of_code_2023_day3_part2.bas +++ b/src/test/programs/samples/advent_of_code_2023_day3_part2.bas @@ -1,15 +1,12 @@ -#type type Gear num as Number row as Number col as Number end type -#global ' Two extra for the buffer we add on either side. const kWidth = 142 -#procedure sub Part2(grid as List of List of Number) dim sum = 0 @@ -81,7 +78,6 @@ sub Part2(grid as List of List of Number) print sum end sub -#procedure sub Main() dim lines = ReadFileLines("../src/test/files/advent_of_code_2023_day3_input.txt") dim list grid @@ -95,7 +91,6 @@ sub Main() Part2 grid end sub -#procedure function GetGearsInRange(num as Number, grid as List of List of Number, minRow as Number, minCol as Number, maxRow as Number, maxCol as Number) as List of Gear dim list gears for row = minRow to maxRow diff --git a/src/test/programs/samples/advent_of_code_2023_day4_part1.bas b/src/test/programs/samples/advent_of_code_2023_day4_part1.bas index ea5f51ec..c74041fb 100644 --- a/src/test/programs/samples/advent_of_code_2023_day4_part1.bas +++ b/src/test/programs/samples/advent_of_code_2023_day4_part1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim lines = ReadFileLines("../src/test/files/advent_of_code_2023_day4_input.txt") dim sum = 0 diff --git a/src/test/programs/samples/advent_of_code_2023_day4_part2.bas b/src/test/programs/samples/advent_of_code_2023_day4_part2.bas index 7bc36eb4..7854ac2f 100644 --- a/src/test/programs/samples/advent_of_code_2023_day4_part2.bas +++ b/src/test/programs/samples/advent_of_code_2023_day4_part2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim lines = ReadFileLines("../src/test/files/advent_of_code_2023_day4_input.txt") diff --git a/src/test/programs/samples/advent_of_code_2023_day5_part1.bas b/src/test/programs/samples/advent_of_code_2023_day5_part1.bas index caa2e89a..709066cf 100644 --- a/src/test/programs/samples/advent_of_code_2023_day5_part1.bas +++ b/src/test/programs/samples/advent_of_code_2023_day5_part1.bas @@ -1,23 +1,19 @@ -#type type MapRange dstStart as Number srcStart as Number length as Number end type -#type type InputData seeds as List of Number maps as List of List of MapRange end type -#procedure sub Main() dim data = ParseFile() Part1 data end sub -#procedure function ParseFile() as InputData dim lines = ReadFileLines("../src/test/files/advent_of_code_2023_day5_input.txt") dim seeds = ParseSeeds(lines(0)) @@ -32,7 +28,6 @@ function ParseFile() as InputData return { seeds: seeds, maps: maps } as InputData end function -#procedure function ParseSeeds(line as String) as List of Number dim parts = Split(line, " ") dim list seeds @@ -43,7 +38,6 @@ function ParseSeeds(line as String) as List of Number return seeds end function -#procedure function ParseMap(lines as List of String, i as Number) as Record (ranges as List of MapRange, index as Number) dim list ranges while Len(lines(i)) > 0 @@ -56,7 +50,6 @@ function ParseMap(lines as List of String, i as Number) as Record (ranges as Lis ' index is the blank line after the map end function -#procedure sub Part1(data as InputData) dim minFinalNum as Optional Number for each seed in data.seeds diff --git a/src/test/programs/samples/advent_of_code_2023_day5_part2.bas b/src/test/programs/samples/advent_of_code_2023_day5_part2.bas index 70c71f2e..f81aec44 100644 --- a/src/test/programs/samples/advent_of_code_2023_day5_part2.bas +++ b/src/test/programs/samples/advent_of_code_2023_day5_part2.bas @@ -1,23 +1,19 @@ -#type type MapRange srcMin as Number srcMax as Number dstMin as Number end type -#type type InputData seeds as List of Number maps as List of List of MapRange end type -#type type SeedRange min as Number max as Number end type -#procedure sub Main() dim data = ParseFile() dim list seedRanges @@ -45,7 +41,6 @@ sub Main() print Value(minStart) end sub -#procedure function Subdivide(seedRanges as List of SeedRange, mapRanges as List of MapRange) as List of SeedRange dim list newSeedRanges for each seedRange in seedRanges @@ -57,7 +52,6 @@ function Subdivide(seedRanges as List of SeedRange, mapRanges as List of MapRang return newSeedRanges end function -#procedure function Subdivide(seedRange as SeedRange, mapRanges as List of MapRange) as List of SeedRange ' If any of the mapRange min or max is within the seedRange, then subdivide and recurse. for each mapRange in mapRanges @@ -80,7 +74,6 @@ function Subdivide(seedRange as SeedRange, mapRanges as List of MapRange) as Lis return [seedRange] end function -#procedure function Part2Step(seedRange as SeedRange, mapRanges as List of MapRange) as SeedRange for each mapRange in mapRanges ' Thanks to Subdivide() we know that the seedRange is either entirely inside or entirely outside the mapRange. @@ -95,7 +88,6 @@ function Part2Step(seedRange as SeedRange, mapRanges as List of MapRange) as See return seedRange end function -#procedure function ParseFile() as InputData dim lines = ReadFileLines("../src/test/files/advent_of_code_2023_day5_input.txt") dim seeds = ParseSeeds(lines(0)) @@ -110,7 +102,6 @@ function ParseFile() as InputData return { seeds: seeds, maps: maps } as InputData end function -#procedure function ParseSeeds(line as String) as List of Number dim parts = Split(line, " ") dim list seeds @@ -121,7 +112,6 @@ function ParseSeeds(line as String) as List of Number return seeds end function -#procedure function ParseMap(lines as List of String, i as Number) as Record (ranges as List of MapRange, index as Number) dim list ranges while Len(lines(i)) > 0 diff --git a/src/test/programs/samples/advent_of_code_2023_day6_part1.bas b/src/test/programs/samples/advent_of_code_2023_day6_part1.bas index 64fa12c2..c2350e78 100644 --- a/src/test/programs/samples/advent_of_code_2023_day6_part1.bas +++ b/src/test/programs/samples/advent_of_code_2023_day6_part1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim raceTimes = [47, 98, 66, 98] dim raceRecords = [400, 1213, 1011, 1540] @@ -12,7 +11,6 @@ sub Main() print totalWays end sub -#procedure function CountWaysToWin(time as Number, rec as Number) as Number dim count = 0 for holdTime = 0 to time - 1 diff --git a/src/test/programs/samples/euler_1.bas b/src/test/programs/samples/euler_1.bas index 17849461..887a45d7 100644 --- a/src/test/programs/samples/euler_1.bas +++ b/src/test/programs/samples/euler_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() ' https://projecteuler.net/problem=1 dim sum = 0 diff --git a/src/test/programs/samples/euler_2.bas b/src/test/programs/samples/euler_2.bas index e9809f25..f36dfe85 100644 --- a/src/test/programs/samples/euler_2.bas +++ b/src/test/programs/samples/euler_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() ' https://projecteuler.net/problem=2 dim sum = 0 diff --git a/src/test/programs/samples/euler_3.bas b/src/test/programs/samples/euler_3.bas index e7eac012..03920905 100644 --- a/src/test/programs/samples/euler_3.bas +++ b/src/test/programs/samples/euler_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() ' https://projecteuler.net/problem=3 dim n = 600851475143 diff --git a/src/test/programs/samples/euler_4.bas b/src/test/programs/samples/euler_4.bas index 5164eed8..d9e1c1c6 100644 --- a/src/test/programs/samples/euler_4.bas +++ b/src/test/programs/samples/euler_4.bas @@ -1,4 +1,3 @@ -#procedure sub Main() ' https://projecteuler.net/problem=4 dim largestPalindrome = 0 @@ -17,7 +16,6 @@ sub Main() print largestPalindrome end sub -#procedure function IsPalindrome(bytes as List of Number) as Boolean dim length = Len(bytes) for i = 0 to length / 2 - 1 diff --git a/src/test/programs/samples/euler_5.bas b/src/test/programs/samples/euler_5.bas index 3a747ed5..86ee53d8 100644 --- a/src/test/programs/samples/euler_5.bas +++ b/src/test/programs/samples/euler_5.bas @@ -1,4 +1,3 @@ -#procedure function GCD(a as Number, b as Number) as Number while b <> 0 dim temp = b @@ -8,12 +7,10 @@ function GCD(a as Number, b as Number) as Number return a end function -#procedure function LCM(a as Number, b as Number) as Number return (a / GCD(a, b)) * b end function -#procedure sub Main() dim result = 1 for i = 1 to 20 diff --git a/src/test/programs/samples/euler_6.bas b/src/test/programs/samples/euler_6.bas index 9d55d95d..8a7c3420 100644 --- a/src/test/programs/samples/euler_6.bas +++ b/src/test/programs/samples/euler_6.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim sumOfSquares = 0 dim sum = 0 diff --git a/src/test/programs/samples/euler_7.bas b/src/test/programs/samples/euler_7.bas index 0b66a2a1..d8070304 100644 --- a/src/test/programs/samples/euler_7.bas +++ b/src/test/programs/samples/euler_7.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim primeCount = 0 dim num = 1 @@ -15,7 +14,6 @@ sub Main() print num end sub -#procedure function IsPrime(n as Number) as Boolean if n <= 1 then return false diff --git a/src/test/programs/select_case/select_case_list_of_number.bas b/src/test/programs/select_case/select_case_list_of_number.bas index 9ccfbb51..a8eaa5d6 100644 --- a/src/test/programs/select_case/select_case_list_of_number.bas +++ b/src/test/programs/select_case/select_case_list_of_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = [2, 3, 4] select case x diff --git a/src/test/programs/select_case/select_case_multiple_case_else.bas b/src/test/programs/select_case/select_case_multiple_case_else.bas index 9471d772..2c4ab812 100644 --- a/src/test/programs/select_case/select_case_multiple_case_else.bas +++ b/src/test/programs/select_case/select_case_multiple_case_else.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = "A" select case x diff --git a/src/test/programs/select_case/select_case_number.bas b/src/test/programs/select_case/select_case_number.bas index 15900b89..7a4f576a 100644 --- a/src/test/programs/select_case/select_case_number.bas +++ b/src/test/programs/select_case/select_case_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = 2 select case x diff --git a/src/test/programs/select_case/select_case_number_range.bas b/src/test/programs/select_case/select_case_number_range.bas index e9340d59..44af620a 100644 --- a/src/test/programs/select_case/select_case_number_range.bas +++ b/src/test/programs/select_case/select_case_number_range.bas @@ -1,4 +1,3 @@ -#procedure sub Main() for i = -1 to 6 select case i diff --git a/src/test/programs/select_case/select_case_string.bas b/src/test/programs/select_case/select_case_string.bas index e25acc9b..7dc4320d 100644 --- a/src/test/programs/select_case/select_case_string.bas +++ b/src/test/programs/select_case/select_case_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = "D" select case x diff --git a/src/test/programs/select_case/select_case_string_range.bas b/src/test/programs/select_case/select_case_string_range.bas index baa1881a..501348dc 100644 --- a/src/test/programs/select_case/select_case_string_range.bas +++ b/src/test/programs/select_case/select_case_string_range.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = "A" select case x diff --git a/src/test/programs/select_case/select_case_type_mismatch.bas b/src/test/programs/select_case/select_case_type_mismatch.bas index 5ea3bf5c..052bd7a2 100644 --- a/src/test/programs/select_case/select_case_type_mismatch.bas +++ b/src/test/programs/select_case/select_case_type_mismatch.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = "A" select case x diff --git a/src/test/programs/sets/Contains_set_number.bas b/src/test/programs/sets/Contains_set_number.bas index 5b57e378..2eab9278 100644 --- a/src/test/programs/sets/Contains_set_number.bas +++ b/src/test/programs/sets/Contains_set_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield 5 diff --git a/src/test/programs/sets/Contains_set_string.bas b/src/test/programs/sets/Contains_set_string.bas index 7bc3f62c..6a1e78b6 100644 --- a/src/test/programs/sets/Contains_set_string.bas +++ b/src/test/programs/sets/Contains_set_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield "a" diff --git a/src/test/programs/sets/Len_set.bas b/src/test/programs/sets/Len_set.bas index efde9142..41b47dd8 100644 --- a/src/test/programs/sets/Len_set.bas +++ b/src/test/programs/sets/Len_set.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield 1 diff --git a/src/test/programs/sets/Set_number_empty.bas b/src/test/programs/sets/Set_number_empty.bas index f1e6fb5f..815a542f 100644 --- a/src/test/programs/sets/Set_number_empty.bas +++ b/src/test/programs/sets/Set_number_empty.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Set of Number print Len(foo) diff --git a/src/test/programs/sets/Set_number_minus_operator.bas b/src/test/programs/sets/Set_number_minus_operator.bas index b457a0b3..7b619473 100644 --- a/src/test/programs/sets/Set_number_minus_operator.bas +++ b/src/test/programs/sets/Set_number_minus_operator.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield 5 diff --git a/src/test/programs/sets/Set_number_plus_operator_1.bas b/src/test/programs/sets/Set_number_plus_operator_1.bas index 08cddb69..75435f44 100644 --- a/src/test/programs/sets/Set_number_plus_operator_1.bas +++ b/src/test/programs/sets/Set_number_plus_operator_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Set of Number foo = foo + 5 diff --git a/src/test/programs/sets/Set_number_plus_operator_2.bas b/src/test/programs/sets/Set_number_plus_operator_2.bas index d3fcb296..1c818797 100644 --- a/src/test/programs/sets/Set_number_plus_operator_2.bas +++ b/src/test/programs/sets/Set_number_plus_operator_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield 1 diff --git a/src/test/programs/sets/Set_string_empty.bas b/src/test/programs/sets/Set_string_empty.bas index 3ea71dd6..7a2d51dd 100644 --- a/src/test/programs/sets/Set_string_empty.bas +++ b/src/test/programs/sets/Set_string_empty.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Set of String print Len(foo) diff --git a/src/test/programs/sets/Set_string_minus_operator.bas b/src/test/programs/sets/Set_string_minus_operator.bas index 517c71c0..b6582f04 100644 --- a/src/test/programs/sets/Set_string_minus_operator.bas +++ b/src/test/programs/sets/Set_string_minus_operator.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield "a" diff --git a/src/test/programs/sets/Set_string_plus_operator_1.bas b/src/test/programs/sets/Set_string_plus_operator_1.bas index 599bc384..a0415312 100644 --- a/src/test/programs/sets/Set_string_plus_operator_1.bas +++ b/src/test/programs/sets/Set_string_plus_operator_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Set of String foo = foo + "a" diff --git a/src/test/programs/sets/Set_string_plus_operator_2.bas b/src/test/programs/sets/Set_string_plus_operator_2.bas index e286402d..03281fe5 100644 --- a/src/test/programs/sets/Set_string_plus_operator_2.bas +++ b/src/test/programs/sets/Set_string_plus_operator_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield "a" diff --git a/src/test/programs/sets/Values_set_1.bas b/src/test/programs/sets/Values_set_1.bas index 73a985ec..447c02f0 100644 --- a/src/test/programs/sets/Values_set_1.bas +++ b/src/test/programs/sets/Values_set_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim foo as Set of Number dim bar as List of Number diff --git a/src/test/programs/sets/Values_set_2.bas b/src/test/programs/sets/Values_set_2.bas index b1bec823..4307e7f2 100644 --- a/src/test/programs/sets/Values_set_2.bas +++ b/src/test/programs/sets/Values_set_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield 1 diff --git a/src/test/programs/sets/dim_set_duplicate_number.bas b/src/test/programs/sets/dim_set_duplicate_number.bas index 0031bc93..c38c1572 100644 --- a/src/test/programs/sets/dim_set_duplicate_number.bas +++ b/src/test/programs/sets/dim_set_duplicate_number.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield 999 diff --git a/src/test/programs/sets/dim_set_duplicate_string.bas b/src/test/programs/sets/dim_set_duplicate_string.bas index b3d2745f..a6e0418e 100644 --- a/src/test/programs/sets/dim_set_duplicate_string.bas +++ b/src/test/programs/sets/dim_set_duplicate_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo yield "a" diff --git a/src/test/programs/strings/Characters_1.bas b/src/test/programs/strings/Characters_1.bas index 4a58e1ba..4019819a 100644 --- a/src/test/programs/strings/Characters_1.bas +++ b/src/test/programs/strings/Characters_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() ' U+0301 Combining Acute Accent dim s = "n" + "e" + Chr(769) diff --git a/src/test/programs/strings/Chr.bas b/src/test/programs/strings/Chr.bas index 60262ca1..0c0c58fa 100644 --- a/src/test/programs/strings/Chr.bas +++ b/src/test/programs/strings/Chr.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Chr(65) end sub diff --git a/src/test/programs/strings/CodePoints.bas b/src/test/programs/strings/CodePoints.bas index a565c7d4..3510e9b2 100644 --- a/src/test/programs/strings/CodePoints.bas +++ b/src/test/programs/strings/CodePoints.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = CodePoints("💩") print Len(x) diff --git a/src/test/programs/strings/CodeUnit.bas b/src/test/programs/strings/CodeUnit.bas index 55bd3090..0e7e8a45 100644 --- a/src/test/programs/strings/CodeUnit.bas +++ b/src/test/programs/strings/CodeUnit.bas @@ -1,4 +1,3 @@ -#procedure sub Main() ' CodeUnit1 dim x = Chr(65) diff --git a/src/test/programs/strings/CodeUnits.bas b/src/test/programs/strings/CodeUnits.bas index 230bc30d..2fd96ddc 100644 --- a/src/test/programs/strings/CodeUnits.bas +++ b/src/test/programs/strings/CodeUnits.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim x = CodeUnits("ABC") print x(0) diff --git a/src/test/programs/strings/IsDigit.bas b/src/test/programs/strings/IsDigit.bas index 7d2d72b4..eaf44b77 100644 --- a/src/test/programs/strings/IsDigit.bas +++ b/src/test/programs/strings/IsDigit.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print IsDigit("1") print IsDigit("a") diff --git a/src/test/programs/strings/Len_string.bas b/src/test/programs/strings/Len_string.bas index 1d4010e4..341a8e37 100644 --- a/src/test/programs/strings/Len_string.bas +++ b/src/test/programs/strings/Len_string.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Len("hello") end sub diff --git a/src/test/programs/strings/ParseNumber_1.bas b/src/test/programs/strings/ParseNumber_1.bas index f7f3fde8..5be17005 100644 --- a/src/test/programs/strings/ParseNumber_1.bas +++ b/src/test/programs/strings/ParseNumber_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() ' Establish that it returns a Number. dim a as Number diff --git a/src/test/programs/strings/ParseNumber_2.bas b/src/test/programs/strings/ParseNumber_2.bas index 9236706c..0dc87d06 100644 --- a/src/test/programs/strings/ParseNumber_2.bas +++ b/src/test/programs/strings/ParseNumber_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print ParseNumber("asdf") end sub diff --git a/src/test/programs/strings/ParseNumber_3.bas b/src/test/programs/strings/ParseNumber_3.bas index 1d4c56d5..f444e552 100644 --- a/src/test/programs/strings/ParseNumber_3.bas +++ b/src/test/programs/strings/ParseNumber_3.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim num as Number num = ParseNumber("-123.40") diff --git a/src/test/programs/strings/Replace_1.bas b/src/test/programs/strings/Replace_1.bas index 02fdfdb7..ef82c743 100644 --- a/src/test/programs/strings/Replace_1.bas +++ b/src/test/programs/strings/Replace_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print "1:"; Replace("aaa", "a", "bb") print "2:"; Replace("aaa", "aa", "bb") diff --git a/src/test/programs/strings/Replace_2.bas b/src/test/programs/strings/Replace_2.bas index c330230f..20426f7d 100644 --- a/src/test/programs/strings/Replace_2.bas +++ b/src/test/programs/strings/Replace_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print Replace("aaa", "", "bb") end sub diff --git a/src/test/programs/strings/Split_1.bas b/src/test/programs/strings/Split_1.bas index 8f09a5b5..9d1ae3c6 100644 --- a/src/test/programs/strings/Split_1.bas +++ b/src/test/programs/strings/Split_1.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim xs = Split("a,b,c", ",") print Len(xs) diff --git a/src/test/programs/strings/Split_2.bas b/src/test/programs/strings/Split_2.bas index 3af2484f..559cffac 100644 --- a/src/test/programs/strings/Split_2.bas +++ b/src/test/programs/strings/Split_2.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim xs = Split("a,b,c", "") end sub diff --git a/src/test/programs/strings/StringFromCodeUnits.bas b/src/test/programs/strings/StringFromCodeUnits.bas index 581088da..a6846da6 100644 --- a/src/test/programs/strings/StringFromCodeUnits.bas +++ b/src/test/programs/strings/StringFromCodeUnits.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim poopEmoji = "💩" ' U+1F4A, four code units dim poopCodeUnits = CodeUnits(poopEmoji) diff --git a/src/test/programs/strings/crlf.bas b/src/test/programs/strings/crlf.bas index ef82930c..66087d05 100644 --- a/src/test/programs/strings/crlf.bas +++ b/src/test/programs/strings/crlf.bas @@ -1,4 +1,3 @@ -#procedure sub Main() ' Comment 1 ' Comment 2 diff --git a/src/test/programs/strings/string_concat.bas b/src/test/programs/strings/string_concat.bas index 6167b20f..a428db07 100644 --- a/src/test/programs/strings/string_concat.bas +++ b/src/test/programs/strings/string_concat.bas @@ -1,4 +1,3 @@ -#procedure sub Main() print "a" + "b" end sub diff --git a/src/test/programs/variables/dim_list_scopes.bas b/src/test/programs/variables/dim_list_scopes.bas index d71213ef..b4dd3589 100644 --- a/src/test/programs/variables/dim_list_scopes.bas +++ b/src/test/programs/variables/dim_list_scopes.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim list foo dim a = 0 diff --git a/src/test/programs/variables/dim_map_scopes.bas b/src/test/programs/variables/dim_map_scopes.bas index 6b37fecd..63987a3a 100644 --- a/src/test/programs/variables/dim_map_scopes.bas +++ b/src/test/programs/variables/dim_map_scopes.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim map foo dim a = 0 diff --git a/src/test/programs/variables/dim_set_scopes.bas b/src/test/programs/variables/dim_set_scopes.bas index 88db0c39..e9319bf5 100644 --- a/src/test/programs/variables/dim_set_scopes.bas +++ b/src/test/programs/variables/dim_set_scopes.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim set foo dim a = 0 diff --git a/src/test/programs/variables/if_scopes.bas b/src/test/programs/variables/if_scopes.bas index 81bf5bbe..f4366f5f 100644 --- a/src/test/programs/variables/if_scopes.bas +++ b/src/test/programs/variables/if_scopes.bas @@ -1,4 +1,3 @@ -#procedure sub Main() if true then dim a = 1 diff --git a/src/test/programs/variables/nested_scopes.bas b/src/test/programs/variables/nested_scopes.bas index 22c050e2..6c6e797e 100644 --- a/src/test/programs/variables/nested_scopes.bas +++ b/src/test/programs/variables/nested_scopes.bas @@ -1,4 +1,3 @@ -#procedure sub Main() dim a = 1 if true then diff --git a/src/test/programs/variables/try_scopes.bas b/src/test/programs/variables/try_scopes.bas index b9215ac9..62386844 100644 --- a/src/test/programs/variables/try_scopes.bas +++ b/src/test/programs/variables/try_scopes.bas @@ -1,4 +1,3 @@ -#procedure sub Main() try dim a = 1