From 166a8f46938ddf59a2a24ba47dbf77deced29cfa Mon Sep 17 00:00:00 2001 From: Roman Heinrich Date: Sun, 12 Jan 2025 00:25:01 +0100 Subject: [PATCH 1/2] chore: update copyright year for all files to 2025 + run `moon fmt` --- array/array_test.mbt | 4 +- array/fixedarray_sort_by.mbt | 26 +++--- array/fixedarray_test.mbt | 2 +- array/panic_test.mbt | 2 +- array/slice.mbt | 2 +- array/sort.mbt | 16 ++-- array/sort_by.mbt | 26 +++--- array/utils.mbt | 2 +- array/view_test.mbt | 2 +- bool/bool_test.mbt | 2 +- buffer/buffer_test.mbt | 2 +- builtin/array_nonjs_test.mbt | 2 +- builtin/array_test.mbt | 4 +- builtin/array_wbtest.mbt | 2 +- builtin/arraycore_js.mbt | 14 ++-- builtin/assert.mbt | 2 +- builtin/autoloc.mbt | 2 +- builtin/bigint_deprecated.mbt | 8 +- builtin/bigint_js_wbtest.mbt | 2 +- builtin/bigint_nonjs_wbtest.mbt | 4 +- builtin/bigint_wbtest.mbt | 2 +- builtin/byte.mbt | 4 +- builtin/byte_test.mbt | 2 +- builtin/bytes_block.mbt | 2 +- builtin/bytes_block_test.mbt | 2 +- builtin/bytes_test.mbt | 2 +- builtin/console.mbt | 12 +-- builtin/existensial_test.mbt | 2 +- builtin/failure.mbt | 2 +- builtin/feature_test.mbt | 6 +- builtin/fixedarray.mbt | 2 +- builtin/fixedarray_block.mbt | 2 +- builtin/fixedarray_test.mbt | 2 +- builtin/hasher.mbt | 2 +- builtin/intrinsics.mbt | 14 ++-- builtin/intrinsics_test.mbt | 2 +- builtin/iter.mbt | 34 ++++---- builtin/iter2.mbt | 6 +- builtin/iter_test.mbt | 2 +- builtin/iter_upto.mbt | 16 ++-- builtin/linked_hash_map.mbt | 10 +-- builtin/linked_hash_map_test.mbt | 2 +- builtin/linked_hash_map_wbtest.mbt | 2 +- builtin/linked_hash_set.mbt | 6 +- builtin/linked_hash_set_test.mbt | 2 +- builtin/option.mbt | 2 +- builtin/option_test.mbt | 2 +- builtin/panic_nonjs_test.mbt | 2 +- builtin/panic_wbtest.mbt | 2 +- builtin/result.mbt | 2 +- builtin/result_test.mbt | 2 +- builtin/show.mbt | 2 +- builtin/string.mbt | 6 +- builtin/string_overloading_feature_test.mbt | 2 +- builtin/string_test.mbt | 2 +- builtin/stringbuilder.mbt | 2 +- builtin/stringbuilder_concat.mbt | 2 +- builtin/stringbuilder_test.mbt | 4 +- builtin/traits.mbt | 4 +- builtin/tuple_compare.mbt | 2 +- builtin/tuple_eq.mbt | 2 +- builtin/tuple_hash.mbt | 2 +- builtin/tuple_show.mbt | 2 +- builtin/tuple_to_json.mbt | 2 +- builtin/uint64.mbt | 2 +- builtin/uninitialized_array.mbt | 2 +- builtin/unit.mbt | 2 +- builtin/unit_test.mbt | 2 +- byte/byte_test.mbt | 2 +- bytes/bytes_test.mbt | 2 +- bytes/xxhash.mbt | 2 +- char/char.mbt | 2 +- char/char_test.mbt | 2 +- coverage/coverage.mbt | 6 +- deque/panic_test.mbt | 2 +- deque/types.mbt | 2 +- double/double_test.mbt | 2 +- double/exp_test.mbt | 2 +- double/internal/ryu/common.mbt | 2 +- double/internal/ryu/ryu_test.mbt | 2 +- double/mod_test.mbt | 4 +- double/pow_test.mbt | 2 +- double/round_test.mbt | 2 +- double/scalbn.mbt | 2 +- error/error.mbt | 2 +- error/error_test.mbt | 2 +- float/exp.mbt | 2 +- float/exp_test.mbt | 2 +- float/log.mbt | 2 +- float/log_test.mbt | 2 +- float/mod.mbt | 2 +- float/mod_test.mbt | 2 +- float/pow.mbt | 2 +- float/pow_test.mbt | 2 +- float/round.mbt | 2 +- float/round_js.mbt | 2 +- float/round_test.mbt | 2 +- float/round_wasm.mbt | 2 +- hashmap/hashmap.mbt | 6 +- hashmap/hashmap_test.mbt | 2 +- hashmap/pattern_test.mbt | 2 +- hashmap/types.mbt | 12 +-- hashmap/utils.mbt | 2 +- hashmap/utils_test.mbt | 2 +- hashset/hashset.mbt | 2 +- hashset/hashset_test.mbt | 2 +- hashset/types.mbt | 12 +-- immut/array/array.mbt | 24 +++--- immut/array/array_test.mbt | 2 +- immut/array/operation.mbt | 2 +- immut/array/panic_test.mbt | 2 +- immut/array/panic_wbtest.mbt | 2 +- immut/array/tree.mbt | 2 +- immut/array/types.mbt | 2 +- immut/hashmap/HAMT.mbt | 2 +- immut/hashmap/HAMT_test.mbt | 2 +- immut/hashmap/bucket.mbt | 2 +- immut/hashmap/pattern_test.mbt | 2 +- immut/hashmap/types.mbt | 2 +- immut/hashset/HAMT.mbt | 2 +- immut/hashset/HAMT_test.mbt | 2 +- immut/hashset/bucket.mbt | 2 +- immut/hashset/types.mbt | 2 +- immut/internal/sparse_array/bitset.mbt | 2 +- immut/internal/sparse_array/sparse_array.mbt | 2 +- .../sparse_array/sparse_array_test.mbt | 2 +- immut/list/list_test.mbt | 2 +- immut/list/panic_test.mbt | 2 +- immut/list/types.mbt | 2 +- immut/priority_queue/panic_test.mbt | 2 +- immut/priority_queue/priority_queue.mbt | 18 ++--- immut/priority_queue/priority_queue_test.mbt | 2 +- immut/priority_queue/types.mbt | 2 +- immut/sorted_map/depercated.mbt | 4 +- immut/sorted_map/inorder_iterator.mbt | 2 +- immut/sorted_map/map.mbt | 4 +- immut/sorted_map/map_test.mbt | 2 +- immut/sorted_map/panic_wbtest.mbt | 2 +- immut/sorted_map/traits_impl.mbt | 2 +- immut/sorted_map/types.mbt | 2 +- immut/sorted_map/utils.mbt | 2 +- immut/sorted_map/utils_test.mbt | 2 +- immut/sorted_set/generic.mbt | 2 +- immut/sorted_set/immutable_set.mbt | 80 +++++++++---------- immut/sorted_set/immutable_set_test.mbt | 2 +- immut/sorted_set/panic_test.mbt | 2 +- immut/sorted_set/types.mbt | 2 +- int/int_test.mbt | 2 +- int64/int64_test.mbt | 2 +- json/derive_json_test.mbt | 6 +- json/from_to_json_test.mbt | 2 +- json/internal_types.mbt | 2 +- json/json.mbt | 2 +- json/json_encode_decode_test.mbt | 8 +- json/json_inspect_test.mbt | 2 +- json/json_path.mbt | 2 +- json/json_test.mbt | 2 +- json/lex_main.mbt | 2 +- json/lex_misc.mbt | 2 +- json/lex_number.mbt | 2 +- json/lex_string.mbt | 2 +- json/parse.mbt | 2 +- json/parse_error_test.mbt | 2 +- json/parse_test.mbt | 2 +- json/tuple_fromjson.mbt | 2 +- json/types.mbt | 2 +- json/types_test.mbt | 2 +- json/utils.mbt | 2 +- math/algebraic.mbt | 2 +- math/algebraic_test.mbt | 2 +- math/exp.mbt | 2 +- math/log.mbt | 2 +- math/round.mbt | 2 +- math/trigonometric.mbt | 2 +- math/trigonometric_test.mbt | 4 +- option/option.mbt | 4 +- option/option_test.mbt | 2 +- option/panic_test.mbt | 2 +- priority_queue/panic_test.mbt | 2 +- priority_queue/priority_queue.mbt | 24 +++--- priority_queue/priority_queue_test.mbt | 2 +- priority_queue/types.mbt | 2 +- queue/panic_test.mbt | 2 +- queue/queue.mbt | 2 +- queue/queue_test.mbt | 2 +- queue/types.mbt | 2 +- quickcheck/arbitrary_test.mbt | 2 +- quickcheck/splitmix/random.mbt | 2 +- quickcheck/utils.mbt | 2 +- random/random.mbt | 20 ++--- random/random_test.mbt | 2 +- rational/rational.mbt | 4 +- rational/rational_test.mbt | 2 +- ref/ref.mbt | 8 +- ref/ref_test.mbt | 2 +- result/panic_test.mbt | 2 +- result/result.mbt | 8 +- result/result_test.mbt | 2 +- sorted_map/map.mbt | 2 +- sorted_map/map_test.mbt | 2 +- sorted_map/types.mbt | 2 +- sorted_map/utils.mbt | 2 +- sorted_set/set_test.mbt | 2 +- sorted_set/types.mbt | 2 +- sorted_set/utils.mbt | 2 +- strconv/bool.mbt | 2 +- strconv/double.mbt | 4 +- strconv/errors.mbt | 2 +- strconv/int.mbt | 2 +- strconv/int_test.mbt | 2 +- strconv/number.mbt | 2 +- strconv/string_slice.mbt | 4 +- string/deprecated.mbt | 2 +- string/panic_test.mbt | 2 +- string/string.mbt | 52 ++++++------ string/string_test.mbt | 2 +- test/test.mbt | 2 +- test/types.mbt | 2 +- tuple/tuple.mbt | 20 ++--- tuple/tuple_arbitrary.mbt | 2 +- tuple/tuple_test.mbt | 2 +- uint/uint_test.mbt | 2 +- unit/unit.mbt | 2 +- unit/unit_test.mbt | 2 +- 224 files changed, 461 insertions(+), 461 deletions(-) diff --git a/array/array_test.mbt b/array/array_test.mbt index aa6ee18cf..33d730e23 100644 --- a/array/array_test.mbt +++ b/array/array_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -125,7 +125,7 @@ test "eachi" { let v = [3, 4, 5] let mut sum = 0 for i, x in v { - // todo: maybe support (i,x) + // todo: maybe support (i,x) sum = sum + x + i } assert_eq!(sum, 15) diff --git a/array/fixedarray_sort_by.mbt b/array/fixedarray_sort_by.mbt index d4c6cb41f..36850a76d 100644 --- a/array/fixedarray_sort_by.mbt +++ b/array/fixedarray_sort_by.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,11 +14,11 @@ ///| /// Sorts the array with a key extraction function. -/// +/// /// It's an in-place, unstable sort(it will reorder equal elements). The time complexity is O(n log n) in the worst case. -/// +/// /// # Example -/// +/// /// ``` /// let arr = [5, 3, 2, 4, 1] /// arr.sort_by_key(fn (x) {-x}) @@ -47,11 +47,11 @@ test "@array.sort_by_key/basic" { ///| /// Sorts the array with a custom comparison function. -/// +/// /// It's an in-place, unstable sort(it will reorder equal elements). The time complexity is O(n log n) in the worst case. -/// +/// /// # Example -/// +/// /// ``` /// let arr = [5, 3, 2, 4, 1] /// arr.sort_by(fn (a, b) { a - b }) @@ -182,9 +182,9 @@ fn fixed_quick_sort_by[T]( ///| /// Try to sort the array with bubble sort. -/// +/// /// It will only tolerate at most 8 unsorted elements. The time complexity is O(n). -/// +/// /// Returns whether the array is sorted. fn fixed_try_bubble_sort_by[T]( arr : FixedArraySlice[T], @@ -210,9 +210,9 @@ fn fixed_try_bubble_sort_by[T]( ///| /// Try to sort the array with bubble sort. -/// +/// /// It will only tolerate at most 8 unsorted elements. The time complexity is O(n). -/// +/// /// Returns whether the array is sorted. fn fixed_bubble_sort_by[T]( arr : FixedArraySlice[T], @@ -262,9 +262,9 @@ fn fixed_partition_by[T]( ///| /// Choose a pivot index for quick sort. -/// +/// /// It avoids worst case performance by choosing a pivot that is likely to be close to the median. -/// +/// /// Returns the pivot index and whether the array is likely sorted. fn fixed_choose_pivot_by[T]( arr : FixedArraySlice[T], diff --git a/array/fixedarray_test.mbt b/array/fixedarray_test.mbt index b69dabbd4..2123d7c62 100644 --- a/array/fixedarray_test.mbt +++ b/array/fixedarray_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/array/panic_test.mbt b/array/panic_test.mbt index fd1eced0d..63204851a 100644 --- a/array/panic_test.mbt +++ b/array/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/array/slice.mbt b/array/slice.mbt index 18a681205..c3595e700 100644 --- a/array/slice.mbt +++ b/array/slice.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/array/sort.mbt b/array/sort.mbt index 0b606c850..e2b6a4576 100644 --- a/array/sort.mbt +++ b/array/sort.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,11 +14,11 @@ ///| /// Sorts the array in place. -/// +/// /// It's an in-place, unstable sort(it will reorder equal elements). The time complexity is O(n log n) in the worst case. -/// +/// /// # Example -/// +/// /// ``` /// let arr = [5, 4, 3, 2, 1] /// arr.sort() @@ -105,9 +105,9 @@ fn get_limit(len : Int) -> Int { ///| /// Try to sort the array with bubble sort. -/// +/// /// It will only tolerate at most 8 unsorted elements. The time complexity is O(n). -/// +/// /// Returns whether the array is sorted. fn try_bubble_sort[T : Compare](arr : ArrayView[T]) -> Bool { let max_tries = 8 @@ -159,9 +159,9 @@ fn partition[T : Compare](arr : ArrayView[T], pivot_index : Int) -> (Int, Bool) ///| /// Choose a pivot index for quick sort. -/// +/// /// It avoids worst case performance by choosing a pivot that is likely to be close to the median. -/// +/// /// Returns the pivot index and whether the array is likely sorted. fn choose_pivot[T : Compare](arr : ArrayView[T]) -> (Int, Bool) { let len = arr.length() diff --git a/array/sort_by.mbt b/array/sort_by.mbt index 35d499405..7b8eb375a 100644 --- a/array/sort_by.mbt +++ b/array/sort_by.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,11 +14,11 @@ ///| /// Sorts the array with a key extraction function. -/// +/// /// It's an in-place, unstable sort(it will reorder equal elements). The time complexity is O(n log n) in the worst case. -/// +/// /// # Example -/// +/// /// ``` /// let arr = [5, 3, 2, 4, 1] /// arr.sort_by_key(fn (x) {-x}) @@ -35,11 +35,11 @@ pub fn sort_by_key[T, K : Compare](self : Array[T], map : (T) -> K) -> Unit { ///| /// Sorts the array with a custom comparison function. -/// +/// /// It's an in-place, unstable sort(it will reorder equal elements). The time complexity is O(n log n) in the worst case. -/// +/// /// # Example -/// +/// /// ``` /// let arr = [5, 3, 2, 4, 1] /// arr.sort_by(fn (a, b) { a - b }) @@ -119,9 +119,9 @@ fn quick_sort_by[T]( ///| /// Try to sort the array with bubble sort. -/// +/// /// It will only tolerate at most 8 unsorted elements. The time complexity is O(n). -/// +/// /// Returns whether the array is sorted. fn try_bubble_sort_by[T](arr : ArrayView[T], cmp : (T, T) -> Int) -> Bool { let max_tries = 8 @@ -144,9 +144,9 @@ fn try_bubble_sort_by[T](arr : ArrayView[T], cmp : (T, T) -> Int) -> Bool { ///| /// Try to sort the array with bubble sort. -/// +/// /// It will only tolerate at most 8 unsorted elements. The time complexity is O(n). -/// +/// /// Returns whether the array is sorted. fn bubble_sort_by[T](arr : ArrayView[T], cmp : (T, T) -> Int) -> Unit { for i = 1; i < arr.length(); i = i + 1 { @@ -181,9 +181,9 @@ fn partition_by[T]( ///| /// Choose a pivot index for quick sort. -/// +/// /// It avoids worst case performance by choosing a pivot that is likely to be close to the median. -/// +/// /// Returns the pivot index and whether the array is likely sorted. fn choose_pivot_by[T](arr : ArrayView[T], cmp : (T, T) -> Int) -> (Int, Bool) { let len = arr.length() diff --git a/array/utils.mbt b/array/utils.mbt index 23301c14b..b63447e91 100644 --- a/array/utils.mbt +++ b/array/utils.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/array/view_test.mbt b/array/view_test.mbt index 63b068c78..25ab9b378 100644 --- a/array/view_test.mbt +++ b/array/view_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bool/bool_test.mbt b/bool/bool_test.mbt index 4a2e3e089..d4dd71579 100644 --- a/bool/bool_test.mbt +++ b/bool/bool_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/buffer/buffer_test.mbt b/buffer/buffer_test.mbt index d3e1f9692..dac901e49 100644 --- a/buffer/buffer_test.mbt +++ b/buffer/buffer_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/array_nonjs_test.mbt b/builtin/array_nonjs_test.mbt index cd579933d..4b794e36e 100644 --- a/builtin/array_nonjs_test.mbt +++ b/builtin/array_nonjs_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/array_test.mbt b/builtin/array_test.mbt index 9978f4b56..568766904 100644 --- a/builtin/array_test.mbt +++ b/builtin/array_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -129,7 +129,7 @@ test "array_append" { arr1.append(arr3) assert_eq!(arr1.length(), 6 + cap) // assert_eq!(arr1.capacity(), arr1.length()) - // Not testing capacity as it may be platform/algorithm + // Not testing capacity as it may be platform/algorithm // dependent and not guaranteed to be equal to length } diff --git a/builtin/array_wbtest.mbt b/builtin/array_wbtest.mbt index 1f965048f..7b179e2fe 100644 --- a/builtin/array_wbtest.mbt +++ b/builtin/array_wbtest.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/arraycore_js.mbt b/builtin/arraycore_js.mbt index 9a98c0f82..79125c412 100644 --- a/builtin/arraycore_js.mbt +++ b/builtin/arraycore_js.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ // limitations under the License. //#region -// These types are of workaround for the restriction that MoonBit do not support +// These types are of workaround for the restriction that MoonBit do not support // generic type parameters of extern ffi ///| @@ -131,7 +131,7 @@ test "UninitializedArray::unsafe_blit_fixed" { ///| /// Reserves capacity to ensure that it can hold at least the number of elements /// specified by the `capacity` argument. -/// +/// /// **NOTE**: This method does nothing on js platform. /// # Example /// @@ -206,10 +206,10 @@ pub fn pop_exn[T](self : Array[T]) -> T { ///| /// Removes the last element from a array and returns it. -/// +/// /// **NOTE** This method will not cause a panic, but it may result in undefined -/// behavior on the JavaScript platform. Use with caution. -/// +/// behavior on the JavaScript platform. Use with caution. +/// /// @alert unsafe "Panic if the array is empty." pub fn unsafe_pop[T](self : Array[T]) -> T { JSArray::ofAnyArray(self).pop().toAny() @@ -280,7 +280,7 @@ pub fn insert[T](self : Array[T], index : Int, value : T) -> Unit { ///| /// Resize the array in-place so that `len` is equal to `new_len`. /// -/// If `new_len` is greater than `len`, the array will be extended by the +/// If `new_len` is greater than `len`, the array will be extended by the /// difference, and the values in the new slots are left uninitilized. /// If `new_len` is less than `len`, it will panic /// diff --git a/builtin/assert.mbt b/builtin/assert.mbt index 085a6ac70..b97b5754a 100644 --- a/builtin/assert.mbt +++ b/builtin/assert.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/autoloc.mbt b/builtin/autoloc.mbt index fcb4c57f4..a5817a00b 100644 --- a/builtin/autoloc.mbt +++ b/builtin/autoloc.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/bigint_deprecated.mbt b/builtin/bigint_deprecated.mbt index 9a05b3848..18eb16497 100644 --- a/builtin/bigint_deprecated.mbt +++ b/builtin/bigint_deprecated.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ pub fn asr(self : BigInt, n : Int) -> BigInt { /// Left shift a bigint /// The sign of the result is the same as the sign of the input. /// Only the absolute value is shifted. -/// +/// /// @alert deprecated "Use infix bitwise operator `<<` instead" /// @coverage.skip pub fn shl(self : BigInt, n : Int) -> BigInt { @@ -34,7 +34,7 @@ pub fn shl(self : BigInt, n : Int) -> BigInt { /// Left shift a bigint /// The sign of the result is the same as the sign of the input. /// Only the absolute value is shifted. -/// +/// /// @alert deprecated "Use infix bitwise operator `<<` instead" /// @coverage.skip pub fn lsl(self : BigInt, n : Int) -> BigInt { @@ -45,7 +45,7 @@ pub fn lsl(self : BigInt, n : Int) -> BigInt { /// Right shift a bigint /// The sign of the result is the same as the sign of the input. /// Only the absolute value is shifted. -/// +/// /// @alert deprecated "Use infix bitwise operator `>>` instead" /// @coverage.skip pub fn shr(self : BigInt, n : Int) -> BigInt { diff --git a/builtin/bigint_js_wbtest.mbt b/builtin/bigint_js_wbtest.mbt index 57fa087da..7ebd5194b 100644 --- a/builtin/bigint_js_wbtest.mbt +++ b/builtin/bigint_js_wbtest.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/bigint_nonjs_wbtest.mbt b/builtin/bigint_nonjs_wbtest.mbt index dcef50b22..304d97b60 100644 --- a/builtin/bigint_nonjs_wbtest.mbt +++ b/builtin/bigint_nonjs_wbtest.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ test "debug_string" { (buf as &Logger).write_iter(v.iter(), sep="\n", prefix="", suffix="") // Logger::writer_iter() // trait logger has no method write_iter - // precise: + // precise: // (dyn Logger)::write_iter(buf,..) // Logger::trait_method() inspect!( diff --git a/builtin/bigint_wbtest.mbt b/builtin/bigint_wbtest.mbt index 57a8563ed..8f6bd174a 100644 --- a/builtin/bigint_wbtest.mbt +++ b/builtin/bigint_wbtest.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/byte.mbt b/builtin/byte.mbt index f6a9a74af..10498eedc 100644 --- a/builtin/byte.mbt +++ b/builtin/byte.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -242,7 +242,7 @@ pub fn Byte::op_shr(self : Byte, count : Int) -> Byte { /// the left. /// /// Returns the resulting `Byte` value after the bitwise left shift operation. -/// +/// /// @alert deprecated "Use infix operator `<<` instead" /// @coverage.skip pub fn Byte::lsl(self : Byte, count : Int) -> Byte { diff --git a/builtin/byte_test.mbt b/builtin/byte_test.mbt index e10585eb7..f11035f64 100644 --- a/builtin/byte_test.mbt +++ b/builtin/byte_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/bytes_block.mbt b/builtin/bytes_block.mbt index 7c41a6268..fd471019c 100644 --- a/builtin/bytes_block.mbt +++ b/builtin/bytes_block.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/bytes_block_test.mbt b/builtin/bytes_block_test.mbt index f307e1338..4e36a8aa8 100644 --- a/builtin/bytes_block_test.mbt +++ b/builtin/bytes_block_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/bytes_test.mbt b/builtin/bytes_test.mbt index 00b1ad6fb..083d6efa4 100644 --- a/builtin/bytes_test.mbt +++ b/builtin/bytes_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/console.mbt b/builtin/console.mbt index e84ffdd68..0807281fa 100644 --- a/builtin/console.mbt +++ b/builtin/console.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -148,31 +148,31 @@ pub fn UInt64::to_string(self : UInt64) -> String { } ///| -/// @coverage.skip +/// @coverage.skip pub fn op_lt[T : Compare](self_ : T, other : T) -> Bool { self_.compare(other).is_neg() } ///| -/// @coverage.skip +/// @coverage.skip pub fn op_gt[T : Compare](self_ : T, other : T) -> Bool { self_.compare(other).is_pos() } ///| -/// @coverage.skip +/// @coverage.skip pub fn op_le[T : Compare](self_ : T, other : T) -> Bool { self_.compare(other).is_non_pos() } ///| -/// @coverage.skip +/// @coverage.skip pub fn op_ge[T : Compare](self_ : T, other : T) -> Bool { self_.compare(other).is_non_neg() } ///| -/// @coverage.skip +/// @coverage.skip pub fn op_notequal[T : Eq](x : T, y : T) -> Bool { not(x == y) } diff --git a/builtin/existensial_test.mbt b/builtin/existensial_test.mbt index f2e0d8858..5ec6df624 100644 --- a/builtin/existensial_test.mbt +++ b/builtin/existensial_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/failure.mbt b/builtin/failure.mbt index 140745cb5..ff1205fec 100644 --- a/builtin/failure.mbt +++ b/builtin/failure.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/feature_test.mbt b/builtin/feature_test.mbt index c961a353b..1ac37ddf3 100644 --- a/builtin/feature_test.mbt +++ b/builtin/feature_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,9 @@ struct RangeImpl[T] { } derive(Show, ToJson) ///| -// pub +// pub // priv -// default to abstract +// default to abstract trait Range { range(Self, Self) -> RangeImpl[Self] } diff --git a/builtin/fixedarray.mbt b/builtin/fixedarray.mbt index 060378551..e632aa3e1 100644 --- a/builtin/fixedarray.mbt +++ b/builtin/fixedarray.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/fixedarray_block.mbt b/builtin/fixedarray_block.mbt index 6237ac3b8..6af5e22d6 100644 --- a/builtin/fixedarray_block.mbt +++ b/builtin/fixedarray_block.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/fixedarray_test.mbt b/builtin/fixedarray_test.mbt index 98b2d0892..5404052ee 100644 --- a/builtin/fixedarray_test.mbt +++ b/builtin/fixedarray_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/hasher.mbt b/builtin/hasher.mbt index 84b6bcb7e..cbde6573c 100644 --- a/builtin/hasher.mbt +++ b/builtin/hasher.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/intrinsics.mbt b/builtin/intrinsics.mbt index b21eadca7..8cf02c30d 100644 --- a/builtin/intrinsics.mbt +++ b/builtin/intrinsics.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -93,7 +93,7 @@ pub fn Int::op_shr(self : Int, other : Int) -> Int = "%i32_shr" pub fn Int::lsl(self : Int, other : Int) -> Int = "%i32_shl" ///| -/// @alert deprecated "Use infix operator `<<` instead" +/// @alert deprecated "Use infix operator `<<` instead" /// @coverage.skip pub fn Int::shl(self : Int, other : Int) -> Int = "%i32_shl" @@ -151,9 +151,9 @@ pub fn Int::to_double(self : Int) -> Double = "%i32_to_f64" pub fn UInt::trunc_double(val : Double) -> UInt = "%f64.to_u32" ///| -/// reinterpret the signed int as unsigned int, when the value is -/// non-negative, i.e, 0..=2^31-1, the value is the same. When the -/// value is negative, it turns into a large number, +/// reinterpret the signed int as unsigned int, when the value is +/// non-negative, i.e, 0..=2^31-1, the value is the same. When the +/// value is negative, it turns into a large number, /// for example, -1 turns into 2^32-1 pub fn Int::reinterpret_as_uint(self : Int) -> UInt = "%i32.to_u32_reinterpret" @@ -231,7 +231,7 @@ pub fn Char::default() -> Char = "%char_default" ///| pub fn Bytes::op_get(self : Bytes, idx : Int) -> Byte = "%bytes_get" -///| +///| /// @alert unsafe "Panic if index is out of bounds" pub fn Bytes::unsafe_get(self : Bytes, idx : Int) -> Byte = "%bytes_get" @@ -317,7 +317,7 @@ pub fn Byte::to_int64(self : Byte) -> Int64 { ///| /// reinterpret the unsigned int as signed int -/// For number within the range of 0..=2^31-1, +/// For number within the range of 0..=2^31-1, /// the value is the same. For number within the range of 2^31..=2^32-1, /// the value is negative pub fn UInt::reinterpret_as_int(self : UInt) -> Int = "%u32.to_i32_reinterpret" diff --git a/builtin/intrinsics_test.mbt b/builtin/intrinsics_test.mbt index 5de9f8902..68fd37f37 100644 --- a/builtin/intrinsics_test.mbt +++ b/builtin/intrinsics_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/iter.mbt b/builtin/iter.mbt index 445461a6a..6e3a09f5b 100644 --- a/builtin/iter.mbt +++ b/builtin/iter.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -542,7 +542,7 @@ pub fn take[T](self : Iter[T], n : Int) -> Iter[T] { /// A new iterator that contains the elements as long as the predicate function returns `true`. pub fn take_while[T](self : Iter[T], f : (T) -> Bool) -> Iter[T] { fn(yield_) { - // `r` represents the overall return value. + // `r` represents the overall return value. // It is set to `IterEnd` only if `yield_(a)` returns `IterEnd`. // so if `f(a)` returns `false`, it will return `IterEnd` // immediately the iteration of current seq is terminated @@ -797,21 +797,21 @@ pub fn last[A](self : Iter[A]) -> A? { ///| /// Returns the first element of the iterator, or `None` if the iterator is empty. -/// +/// /// # Type Parameters -/// +/// /// - `A` : The type of the elements in the iterator. -/// +/// /// # Parameters -/// +/// /// - `self` : The iterator to retrieve the first element from. -/// +/// /// # Returns -/// +/// /// - An `Option` containing the first element of the iterator if it exists, otherwise `None`. -/// +/// /// # Examples -/// +/// /// ``` /// let iter = Iter::singleton(42) /// assert_eq!(head(iter), Some(42)) @@ -826,14 +826,14 @@ pub fn head[A](self : Iter[A]) -> A? { ///| /// Inserts a separator element `sep` between each element of the iterator. -/// +/// /// # Parameters -/// +/// /// - `self` : The iterator to intersperse the separator into. /// - `sep` : The separator element to insert between each element of the iterator. -/// +/// /// # Examples -/// +/// /// ``` /// let arr = [] /// [1, 2, 3].iter().intersperse(0).each(fn(i) {arr.push(i)}) @@ -862,8 +862,8 @@ pub fn op_as_view[A](self : Iter[A], start~ : Int = 0, end? : Int) -> Iter[A] { // this is time consuming to calculate // while `None` is more appropriate. // In general, when to use `end = expr` and when to use `end?` is a design decision. - // when `expr` is always needed when user does not specify, the former is - // slightly more efficient. When `expr` is not always needed, the latter is more appropriate. + // when `expr` is always needed when user does not specify, the former is + // slightly more efficient. When `expr` is not always needed, the latter is more appropriate. match end { Some(end) => self.drop(start).take(end - start) None => self.drop(start) @@ -889,7 +889,7 @@ pub fn op_as_view[A](self : Iter[A], start~ : Int = 0, end? : Int) -> Iter[A] { /// inspect!(iter.contains(3), content="true") /// inspect!(iter.contains(6), content="false") /// } -/// +/// /// test "Iter::contains/empty" { /// let iter = Iter::empty() /// inspect!(iter.contains(1), content="false") diff --git a/builtin/iter2.mbt b/builtin/iter2.mbt index 8d6689620..e766d0394 100644 --- a/builtin/iter2.mbt +++ b/builtin/iter2.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -72,8 +72,8 @@ pub fn iter[A, B](self : Iter2[A, B]) -> Iter[(A, B)] { ///| pub fn iter2[A, B](self : Iter2[A, B]) -> Iter2[A, B] { // This is a no-op to make sure - // `for k,v in map.iter2() { ... }` - // still work + // `for k,v in map.iter2() { ... }` + // still work self } diff --git a/builtin/iter_test.mbt b/builtin/iter_test.mbt index a51e8c9ba..8b65207d4 100644 --- a/builtin/iter_test.mbt +++ b/builtin/iter_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/iter_upto.mbt b/builtin/iter_upto.mbt index 3aa30678b..5c605d3c4 100644 --- a/builtin/iter_upto.mbt +++ b/builtin/iter_upto.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -45,15 +45,15 @@ pub fn upto(self : Int, end : Int, inclusive~ : Bool = false) -> Iter[Int] { ///| /// Creates an iterator that iterates over a range of UInt with default step 1U. -/// +/// /// # Arguments -/// +/// /// * `start` - The starting value of the range (inclusive). /// * `end` - The ending value of the range (exclusive). /// * `inclusive` - Whether the ending value is inclusive (default false). /// /// # Returns -/// +/// /// Returns an iterator that iterates over the range of UInt from `start` to `end - 1`. /// @alert deprecated "Use `..<` in for loop or `until` method instead" /// @coverage.skip @@ -76,15 +76,15 @@ pub fn upto(self : UInt, end : UInt, inclusive~ : Bool = false) -> Iter[UInt] { ///| /// Creates an iterator that iterates over a range of UInt64 with default step 1UL. -/// +/// /// # Arguments -/// +/// /// * `start` - The starting value of the range (inclusive). /// * `end` - The ending value of the range (exclusive). /// * `inclusive` - Whether the ending value is inclusive (default false). -/// +/// /// # Returns -/// +/// /// Returns an iterator that iterates over the range of UInt64 from `start` to `end - 1`. /// @alert deprecated "Use `..<` in for loop or `until` method instead" /// @coverage.skip diff --git a/builtin/linked_hash_map.mbt b/builtin/linked_hash_map.mbt index c2793c135..5e4ad39fa 100644 --- a/builtin/linked_hash_map.mbt +++ b/builtin/linked_hash_map.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,10 +34,10 @@ priv struct ListNode[K, V] { } ///| -/// Mutable linked hash map that maintains the order of insertion, not thread safe. -/// +/// Mutable linked hash map that maintains the order of insertion, not thread safe. +/// /// # Example -/// +/// /// ``` /// let map = { 3: "three", 8 : "eight", 1 : "one"} /// assert_eq!(map.get(2), None) @@ -66,7 +66,7 @@ fn power_2_above(x : Int, n : Int) -> Int { } let next = i << 1 if next < 0 { - // overflow happend + // overflow happend break i } continue next diff --git a/builtin/linked_hash_map_test.mbt b/builtin/linked_hash_map_test.mbt index 1612dc815..0af9e811a 100644 --- a/builtin/linked_hash_map_test.mbt +++ b/builtin/linked_hash_map_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/linked_hash_map_wbtest.mbt b/builtin/linked_hash_map_wbtest.mbt index 9f5650dc1..072a8b1df 100644 --- a/builtin/linked_hash_map_wbtest.mbt +++ b/builtin/linked_hash_map_wbtest.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/linked_hash_set.mbt b/builtin/linked_hash_set.mbt index 225e6f79b..7c5fc1dcf 100644 --- a/builtin/linked_hash_set.mbt +++ b/builtin/linked_hash_set.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ priv struct SListNode[K] { } ///| -/// Mutable linked hash set that maintains the order of insertion, not thread safe. +/// Mutable linked hash set that maintains the order of insertion, not thread safe. struct Set[K] { mut entries : FixedArray[SEntry[K]?] mut list : FixedArray[SListNode[K]] @@ -76,7 +76,7 @@ pub fn Set::from_array[K : Hash + Eq](arr : Array[K]) -> Set[K] { ///| /// Insert a key into the hash set. -/// +/// /// @alert deprecated "Use `add` instead." /// @coverage.skip pub fn insert[K : Hash + Eq](self : Set[K], key : K) -> Unit { diff --git a/builtin/linked_hash_set_test.mbt b/builtin/linked_hash_set_test.mbt index f54ab37ff..c70a49b02 100644 --- a/builtin/linked_hash_set_test.mbt +++ b/builtin/linked_hash_set_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/option.mbt b/builtin/option.mbt index e9f6e70da..d4532d053 100644 --- a/builtin/option.mbt +++ b/builtin/option.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/option_test.mbt b/builtin/option_test.mbt index 1e21742c2..b8332fcd5 100644 --- a/builtin/option_test.mbt +++ b/builtin/option_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/panic_nonjs_test.mbt b/builtin/panic_nonjs_test.mbt index a555c6a82..5c35b0767 100644 --- a/builtin/panic_nonjs_test.mbt +++ b/builtin/panic_nonjs_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/panic_wbtest.mbt b/builtin/panic_wbtest.mbt index 78fc57be1..4afbee975 100644 --- a/builtin/panic_wbtest.mbt +++ b/builtin/panic_wbtest.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/result.mbt b/builtin/result.mbt index e2e6e5019..466a971b6 100644 --- a/builtin/result.mbt +++ b/builtin/result.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/result_test.mbt b/builtin/result_test.mbt index c55f53d08..94c785b5f 100644 --- a/builtin/result_test.mbt +++ b/builtin/result_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/show.mbt b/builtin/show.mbt index a207b7558..7293ed5bc 100644 --- a/builtin/show.mbt +++ b/builtin/show.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/string.mbt b/builtin/string.mbt index 4efb7aa0f..271286cdc 100644 --- a/builtin/string.mbt +++ b/builtin/string.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -43,13 +43,13 @@ fn unsafe_substring(str : String, start : Int, end : Int) -> String { /// inspect!(s.substring(start=6, end=11), content="world") /// inspect!(s.substring(), content="Hello world") /// } -/// +/// /// test "substring/empty" { /// let s = "test" /// inspect!(s.substring(start=2, end=2), content="") /// inspect!("".substring(), content="") /// } -/// +/// /// test "panic substring/invalid_range" { /// let s = "test" /// ignore(s.substring(start=-1)) diff --git a/builtin/string_overloading_feature_test.mbt b/builtin/string_overloading_feature_test.mbt index f19ed8452..c7fe54ef8 100644 --- a/builtin/string_overloading_feature_test.mbt +++ b/builtin/string_overloading_feature_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/string_test.mbt b/builtin/string_test.mbt index 20a813355..0df35c982 100644 --- a/builtin/string_test.mbt +++ b/builtin/string_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/stringbuilder.mbt b/builtin/stringbuilder.mbt index cc707fb7a..a0f3de84a 100644 --- a/builtin/stringbuilder.mbt +++ b/builtin/stringbuilder.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/stringbuilder_concat.mbt b/builtin/stringbuilder_concat.mbt index 3d8584820..28a3e3036 100644 --- a/builtin/stringbuilder_concat.mbt +++ b/builtin/stringbuilder_concat.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/stringbuilder_test.mbt b/builtin/stringbuilder_test.mbt index a9d9c1254..1839d610d 100644 --- a/builtin/stringbuilder_test.mbt +++ b/builtin/stringbuilder_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ // when we write the string into the buffer // we assume the string is utf16 and blit // we assume the bytes (in valid region [0, len)) is utf16 -// so that +// so that fn id(s : String) -> String { StringBuilder::new()..write_string(s).to_string() } diff --git a/builtin/traits.mbt b/builtin/traits.mbt index 1fdaeec50..ec0602ba7 100644 --- a/builtin/traits.mbt +++ b/builtin/traits.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -109,7 +109,7 @@ pub fn &Logger::write_iter[T : Show]( self.write_string(sep) } } else { - // trailing is false + // trailing is false let mut first = true for x in iter { if first { diff --git a/builtin/tuple_compare.mbt b/builtin/tuple_compare.mbt index f3fca92ca..ba73d26d5 100644 --- a/builtin/tuple_compare.mbt +++ b/builtin/tuple_compare.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/tuple_eq.mbt b/builtin/tuple_eq.mbt index 219b52264..c44762b67 100644 --- a/builtin/tuple_eq.mbt +++ b/builtin/tuple_eq.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/tuple_hash.mbt b/builtin/tuple_hash.mbt index 8f9b2b926..99244531c 100644 --- a/builtin/tuple_hash.mbt +++ b/builtin/tuple_hash.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/tuple_show.mbt b/builtin/tuple_show.mbt index 3288e5cda..bc40b7b0d 100644 --- a/builtin/tuple_show.mbt +++ b/builtin/tuple_show.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/tuple_to_json.mbt b/builtin/tuple_to_json.mbt index 652b1511c..a2a9bc6e8 100644 --- a/builtin/tuple_to_json.mbt +++ b/builtin/tuple_to_json.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/uint64.mbt b/builtin/uint64.mbt index 02fd25b08..586efcad0 100644 --- a/builtin/uint64.mbt +++ b/builtin/uint64.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/uninitialized_array.mbt b/builtin/uninitialized_array.mbt index b87216285..576ddf163 100644 --- a/builtin/uninitialized_array.mbt +++ b/builtin/uninitialized_array.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/unit.mbt b/builtin/unit.mbt index 987f847f0..200e9d0ce 100644 --- a/builtin/unit.mbt +++ b/builtin/unit.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/builtin/unit_test.mbt b/builtin/unit_test.mbt index e59ea3ca8..1a8735f78 100644 --- a/builtin/unit_test.mbt +++ b/builtin/unit_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/byte/byte_test.mbt b/byte/byte_test.mbt index 8a6106ea4..a25ead676 100644 --- a/byte/byte_test.mbt +++ b/byte/byte_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bytes/bytes_test.mbt b/bytes/bytes_test.mbt index a5a5a47c2..25c25ab5d 100644 --- a/bytes/bytes_test.mbt +++ b/bytes/bytes_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bytes/xxhash.mbt b/bytes/xxhash.mbt index 4ec9fb77e..f18e7b3dc 100644 --- a/bytes/xxhash.mbt +++ b/bytes/xxhash.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/char/char.mbt b/char/char.mbt index 9436c7be6..edcc08155 100644 --- a/char/char.mbt +++ b/char/char.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/char/char_test.mbt b/char/char_test.mbt index d1bc0caee..5d41fe430 100644 --- a/char/char_test.mbt +++ b/char/char_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/coverage/coverage.mbt b/coverage/coverage.mbt index 19a1f3223..039191c06 100644 --- a/coverage/coverage.mbt +++ b/coverage/coverage.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ struct CoverageCounter { ///| /// Create a new coverage counter with the given size. /// -/// @coverage.skip +/// @coverage.skip pub fn CoverageCounter::new(size : Int) -> CoverageCounter { { counter: FixedArray::make(size, 0) } } @@ -31,7 +31,7 @@ pub fn CoverageCounter::new(size : Int) -> CoverageCounter { ///| /// Increment the specified tracking index. /// -/// @coverage.skip +/// @coverage.skip pub fn CoverageCounter::incr(self : CoverageCounter, idx : Int) -> Unit { let counter = self.counter[idx] self.counter[idx] = counter + 1 diff --git a/deque/panic_test.mbt b/deque/panic_test.mbt index cc6526d2a..13a4711d1 100644 --- a/deque/panic_test.mbt +++ b/deque/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/deque/types.mbt b/deque/types.mbt index d7c06f7aa..7d7e509e0 100644 --- a/deque/types.mbt +++ b/deque/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/double/double_test.mbt b/double/double_test.mbt index 8aa7e24eb..7c14a8739 100644 --- a/double/double_test.mbt +++ b/double/double_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/double/exp_test.mbt b/double/exp_test.mbt index 0b9089119..190835066 100644 --- a/double/exp_test.mbt +++ b/double/exp_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/double/internal/ryu/common.mbt b/double/internal/ryu/common.mbt index ef6cba52f..f4d318fd1 100644 --- a/double/internal/ryu/common.mbt +++ b/double/internal/ryu/common.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/double/internal/ryu/ryu_test.mbt b/double/internal/ryu/ryu_test.mbt index 4a7b521a0..dda4488bd 100644 --- a/double/internal/ryu/ryu_test.mbt +++ b/double/internal/ryu/ryu_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/double/mod_test.mbt b/double/mod_test.mbt index ed5d72c48..4253b493e 100644 --- a/double/mod_test.mbt +++ b/double/mod_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ ///| /// Check if two floating point numbers are equal within a small epsilon. -/// +/// /// Only used for testing when the result can't be precisely represented /// by IEEE 754 double. fn check(x : Double, y : Double) -> Bool { diff --git a/double/pow_test.mbt b/double/pow_test.mbt index 187c7f984..f31d1df6b 100644 --- a/double/pow_test.mbt +++ b/double/pow_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/double/round_test.mbt b/double/round_test.mbt index fc3231124..9716a2563 100644 --- a/double/round_test.mbt +++ b/double/round_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/double/scalbn.mbt b/double/scalbn.mbt index 8476a1ead..2aa9e653b 100644 --- a/double/scalbn.mbt +++ b/double/scalbn.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/error/error.mbt b/error/error.mbt index 12b3d6ade..1935d17ec 100644 --- a/error/error.mbt +++ b/error/error.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/error/error_test.mbt b/error/error_test.mbt index 9f939d44f..3347792ca 100644 --- a/error/error_test.mbt +++ b/error/error_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/exp.mbt b/float/exp.mbt index 38996e0c3..4b0865085 100644 --- a/float/exp.mbt +++ b/float/exp.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/exp_test.mbt b/float/exp_test.mbt index 834ac0cda..2f90ac2a8 100644 --- a/float/exp_test.mbt +++ b/float/exp_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/log.mbt b/float/log.mbt index e1afc86f8..0f793bc49 100644 --- a/float/log.mbt +++ b/float/log.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/log_test.mbt b/float/log_test.mbt index 52c9e188e..9ee5d5ce0 100644 --- a/float/log_test.mbt +++ b/float/log_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/mod.mbt b/float/mod.mbt index fd102539d..3e7ecd7e2 100644 --- a/float/mod.mbt +++ b/float/mod.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/mod_test.mbt b/float/mod_test.mbt index d8771231c..1c9ad1bc4 100644 --- a/float/mod_test.mbt +++ b/float/mod_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/pow.mbt b/float/pow.mbt index 374bfc4b0..76911e43c 100644 --- a/float/pow.mbt +++ b/float/pow.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/pow_test.mbt b/float/pow_test.mbt index 71f1bd991..090a20e54 100644 --- a/float/pow_test.mbt +++ b/float/pow_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/round.mbt b/float/round.mbt index 539a4a110..d6475c1be 100644 --- a/float/round.mbt +++ b/float/round.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/round_js.mbt b/float/round_js.mbt index 143d80d48..8a1de6e89 100644 --- a/float/round_js.mbt +++ b/float/round_js.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/round_test.mbt b/float/round_test.mbt index 6a7ec75be..669f6ec60 100644 --- a/float/round_test.mbt +++ b/float/round_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/float/round_wasm.mbt b/float/round_wasm.mbt index 937c9998c..dfe8971ca 100644 --- a/float/round_wasm.mbt +++ b/float/round_wasm.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/hashmap/hashmap.mbt b/hashmap/hashmap.mbt index 5513290e5..06f9c2264 100644 --- a/hashmap/hashmap.mbt +++ b/hashmap/hashmap.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ fn power_2_above(x : Int, n : Int) -> Int { } let next = i << 1 if next < 0 { - // overflow happend + // overflow happend break i } continue next @@ -169,7 +169,7 @@ pub fn get_or_init[K : Hash + Eq, V]( } ///| -/// Get the value associated with a key, +/// Get the value associated with a key, /// returns the provided default value if the key does not exist. pub fn get_or_default[K : Hash + Eq, V]( self : T[K, V], diff --git a/hashmap/hashmap_test.mbt b/hashmap/hashmap_test.mbt index 634a89ff6..1e6b93545 100644 --- a/hashmap/hashmap_test.mbt +++ b/hashmap/hashmap_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/hashmap/pattern_test.mbt b/hashmap/pattern_test.mbt index 1593a8a30..a6b19a70a 100644 --- a/hashmap/pattern_test.mbt +++ b/hashmap/pattern_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/hashmap/types.mbt b/hashmap/types.mbt index 9a66e8405..58341a64f 100644 --- a/hashmap/types.mbt +++ b/hashmap/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,16 +21,16 @@ priv struct Entry[K, V] { } derive(Show) /// A mutable hash map implements with Robin Hood hashing. -/// +/// /// reference: /// - /// - ///| -/// Mutable hash map, not thread safe. -/// +/// Mutable hash map, not thread safe. +/// /// # Example -/// +/// /// ``` /// let map = @hashmap.of([(3, "three"), (8, "eight"), (1, "one")]) /// assert_eq!(map.get(2), None) @@ -43,6 +43,6 @@ struct T[K, V] { mut capacity : Int // size of field `entries`, it is redundant but useful for performance // so we don't need do `self.entries.length()` every time - mut size : Int // active key-value pairs count + mut size : Int // active key-value pairs count // mut growAt : Int // threshold that triggers grow } diff --git a/hashmap/utils.mbt b/hashmap/utils.mbt index 8ac7b8c30..b9b60645c 100644 --- a/hashmap/utils.mbt +++ b/hashmap/utils.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/hashmap/utils_test.mbt b/hashmap/utils_test.mbt index 39330ef26..5ea9b0682 100644 --- a/hashmap/utils_test.mbt +++ b/hashmap/utils_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/hashset/hashset.mbt b/hashset/hashset.mbt index 7e5f2a751..4181eec8c 100644 --- a/hashset/hashset.mbt +++ b/hashset/hashset.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/hashset/hashset_test.mbt b/hashset/hashset_test.mbt index f327cf242..ec2a2f7fb 100644 --- a/hashset/hashset_test.mbt +++ b/hashset/hashset_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/hashset/types.mbt b/hashset/types.mbt index 4e2903f49..0fb83861e 100644 --- a/hashset/types.mbt +++ b/hashset/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,16 +20,16 @@ priv struct Entry[K] { } derive(Show) /// A mutable hash set implements with Robin Hood hashing. -/// +/// /// reference: /// - /// - ///| -/// Mutable hash set, not thread safe. -/// +/// Mutable hash set, not thread safe. +/// /// # Example -/// +/// /// ``` /// let set = @hashset.of([(3, "three"), (8, "eight"), (1, "one")]) /// set.add((4, "four")) @@ -38,6 +38,6 @@ priv struct Entry[K] { struct T[K] { mut entries : FixedArray[Entry[K]?] mut size : Int // active key count - mut capacity : Int // current capacity + mut capacity : Int // current capacity mut growAt : Int // threshold that triggers grow } diff --git a/immut/array/array.mbt b/immut/array/array.mbt index 3acdb5d36..b58616a50 100644 --- a/immut/array/array.mbt +++ b/immut/array/array.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -75,7 +75,7 @@ pub fn copy[A](self : T[A]) -> T[A] { ///| /// Get a value at the given index. -/// +/// /// # Examples /// ``` /// let v = @array.of([1, 2, 3, 4, 5]) @@ -93,7 +93,7 @@ pub fn op_get[A](self : T[A], index : Int) -> A { ///| /// Set a value at the given index (immutable). -/// +/// /// # Example /// ``` /// let v = @array.of([1, 2, 3, 4, 5]) @@ -120,7 +120,7 @@ pub fn set[A](self : T[A], index : Int, value : A) -> T[A] { ///| /// Push a value to the end of the array. -/// +/// /// # Example /// ``` /// let v = @array.of([1, 2, 3]) @@ -144,7 +144,7 @@ pub fn push[A](self : T[A], value : A) -> T[A] { ///| /// Create a persistent array from an array. -/// +/// /// # Example /// ``` /// let v = @array.of([1, 2, 3]) @@ -156,7 +156,7 @@ pub fn T::from_array[A](arr : Array[A]) -> T[A] { ///| /// Iterate over the array. -/// +/// /// # Example /// ``` /// let arr = [] @@ -178,7 +178,7 @@ pub fn each[A](self : T[A], f : (A) -> Unit) -> Unit { ///| /// Iterate over the array with index. -/// +/// /// # Example /// ``` /// let arr = [] @@ -215,7 +215,7 @@ pub impl[A : Eq] Eq for T[A] with op_equal(self, other) { ///| /// Fold the array. -/// +/// /// # Example /// ``` /// let v = @array.of([1, 2, 3, 4, 5]) @@ -235,7 +235,7 @@ pub fn fold[A, B](self : T[A], init~ : B, f : (B, A) -> B) -> B { ///| /// Fold the array in reverse order. -/// +/// /// # Example /// ``` /// let v = @array.of([1, 2, 3, 4, 5]) @@ -255,7 +255,7 @@ pub fn rev_fold[A, B](self : T[A], init~ : B, f : (B, A) -> B) -> B { ///| /// Fold the array from left to right. -/// +/// /// # Example /// ``` /// let v = @array.of([1, 2, 3, 4, 5]) @@ -269,7 +269,7 @@ pub fn fold_left[A](self : T[A], f : (A, A) -> A, init~ : A) -> A { ///| /// Fold the array from right to left. -/// +/// /// # Example /// ``` /// let v = @array.of([1, 2, 3, 4, 5]) @@ -283,7 +283,7 @@ pub fn fold_right[A](self : T[A], f : (A, A) -> A, init~ : A) -> A { ///| /// Map a function over the array. -/// +/// /// # Example /// ``` /// let v = @array.of([1, 2, 3, 4, 5]) diff --git a/immut/array/array_test.mbt b/immut/array/array_test.mbt index a0feedb58..befea3ffb 100644 --- a/immut/array/array_test.mbt +++ b/immut/array/array_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/array/operation.mbt b/immut/array/operation.mbt index d61d360a1..8dfd8ced9 100644 --- a/immut/array/operation.mbt +++ b/immut/array/operation.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/array/panic_test.mbt b/immut/array/panic_test.mbt index bfe3b91e5..64201a5f6 100644 --- a/immut/array/panic_test.mbt +++ b/immut/array/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/array/panic_wbtest.mbt b/immut/array/panic_wbtest.mbt index 60f7e5133..f9309a194 100644 --- a/immut/array/panic_wbtest.mbt +++ b/immut/array/panic_wbtest.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/array/tree.mbt b/immut/array/tree.mbt index 7301ca4c0..0ecbf3f87 100644 --- a/immut/array/tree.mbt +++ b/immut/array/tree.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/array/types.mbt b/immut/array/types.mbt index 8e9a9cb1d..f1c9231fe 100644 --- a/immut/array/types.mbt +++ b/immut/array/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/hashmap/HAMT.mbt b/immut/hashmap/HAMT.mbt index 3a23ec162..130099af5 100644 --- a/immut/hashmap/HAMT.mbt +++ b/immut/hashmap/HAMT.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/hashmap/HAMT_test.mbt b/immut/hashmap/HAMT_test.mbt index 97c5a96f8..2f9034b2a 100644 --- a/immut/hashmap/HAMT_test.mbt +++ b/immut/hashmap/HAMT_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/hashmap/bucket.mbt b/immut/hashmap/bucket.mbt index 1bc64b0ef..6b75c5dcf 100644 --- a/immut/hashmap/bucket.mbt +++ b/immut/hashmap/bucket.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/hashmap/pattern_test.mbt b/immut/hashmap/pattern_test.mbt index 1593a8a30..a6b19a70a 100644 --- a/immut/hashmap/pattern_test.mbt +++ b/immut/hashmap/pattern_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/hashmap/types.mbt b/immut/hashmap/types.mbt index 7cb5bb7e3..7d3a30160 100644 --- a/immut/hashmap/types.mbt +++ b/immut/hashmap/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/hashset/HAMT.mbt b/immut/hashset/HAMT.mbt index 46f2317a2..d30dff815 100644 --- a/immut/hashset/HAMT.mbt +++ b/immut/hashset/HAMT.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/hashset/HAMT_test.mbt b/immut/hashset/HAMT_test.mbt index c129ca85f..c15366b42 100644 --- a/immut/hashset/HAMT_test.mbt +++ b/immut/hashset/HAMT_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/hashset/bucket.mbt b/immut/hashset/bucket.mbt index 678243b9b..2b4101f5a 100644 --- a/immut/hashset/bucket.mbt +++ b/immut/hashset/bucket.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/hashset/types.mbt b/immut/hashset/types.mbt index 55e28c6c0..3d1c28363 100644 --- a/immut/hashset/types.mbt +++ b/immut/hashset/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/internal/sparse_array/bitset.mbt b/immut/internal/sparse_array/bitset.mbt index 10a9bea4e..b0ecb87d0 100644 --- a/immut/internal/sparse_array/bitset.mbt +++ b/immut/internal/sparse_array/bitset.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/internal/sparse_array/sparse_array.mbt b/immut/internal/sparse_array/sparse_array.mbt index 9224c0f0d..0cb4fcc92 100644 --- a/immut/internal/sparse_array/sparse_array.mbt +++ b/immut/internal/sparse_array/sparse_array.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/internal/sparse_array/sparse_array_test.mbt b/immut/internal/sparse_array/sparse_array_test.mbt index 9ea10179e..f5b50502d 100644 --- a/immut/internal/sparse_array/sparse_array_test.mbt +++ b/immut/internal/sparse_array/sparse_array_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/list/list_test.mbt b/immut/list/list_test.mbt index a163b2706..6d344cce5 100644 --- a/immut/list/list_test.mbt +++ b/immut/list/list_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/list/panic_test.mbt b/immut/list/panic_test.mbt index fdefaa3f5..f3847243b 100644 --- a/immut/list/panic_test.mbt +++ b/immut/list/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/list/types.mbt b/immut/list/types.mbt index ac0bd2199..2c50df3b2 100644 --- a/immut/list/types.mbt +++ b/immut/list/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/priority_queue/panic_test.mbt b/immut/priority_queue/panic_test.mbt index bf361f33b..c9960840e 100644 --- a/immut/priority_queue/panic_test.mbt +++ b/immut/priority_queue/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/priority_queue/priority_queue.mbt b/immut/priority_queue/priority_queue.mbt index 7c22371f6..8ccbdf57d 100644 --- a/immut/priority_queue/priority_queue.mbt +++ b/immut/priority_queue/priority_queue.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ ///| /// Creates a new empty immutable priority queue. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.new() @@ -26,7 +26,7 @@ pub fn T::new[A : Compare]() -> T[A] { ///| /// Creates a new immutable priority queue from an array. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4, 5]) @@ -110,7 +110,7 @@ fn merges[A : Compare](x : @list.T[Cont[A]]) -> Cont[A] { ///| /// Pops the first value from the immutable priority queue, which returns None if the queue is empty. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4]) @@ -126,7 +126,7 @@ pub fn pop[A : Compare](self : T[A]) -> T[A]? { ///| /// Pops the first value from the immutable priority queue. -/// +/// /// Panics if the queue is empty. /// # Example /// ``` @@ -150,7 +150,7 @@ pub fn pop_exn[A : Compare](self : T[A]) -> T[A] { ///| /// Adds a value to the immutable priority queue. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.new() @@ -162,7 +162,7 @@ pub fn push[A : Compare](self : T[A], value : A) -> T[A] { ///| /// Peeks at the first value in the immutable priority queue, which returns None if the immutable priority queue is empty. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4]) @@ -177,7 +177,7 @@ pub fn peek[A](self : T[A]) -> A? { ///| /// Checks if the immutable priority queue is empty. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.new() @@ -193,7 +193,7 @@ pub fn is_empty[A](self : T[A]) -> Bool { ///| /// Return the length of the immutable priority queue. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.new() diff --git a/immut/priority_queue/priority_queue_test.mbt b/immut/priority_queue/priority_queue_test.mbt index 357523e01..024c35bf1 100644 --- a/immut/priority_queue/priority_queue_test.mbt +++ b/immut/priority_queue/priority_queue_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/priority_queue/types.mbt b/immut/priority_queue/types.mbt index f1fa04915..35ca4d993 100644 --- a/immut/priority_queue/types.mbt +++ b/immut/priority_queue/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_map/depercated.mbt b/immut/sorted_map/depercated.mbt index b4ed611ee..7daa27db9 100644 --- a/immut/sorted_map/depercated.mbt +++ b/immut/sorted_map/depercated.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ ///| /// Create a new map with a key-value pair inserted. /// O(log n). -/// +/// /// @alert deprecated "Use `add` instead" /// @coverage.skip pub fn insert[K : Compare, V](self : T[K, V], key : K, value : V) -> T[K, V] { diff --git a/immut/sorted_map/inorder_iterator.mbt b/immut/sorted_map/inorder_iterator.mbt index 6c5bcfd42..e393c892f 100644 --- a/immut/sorted_map/inorder_iterator.mbt +++ b/immut/sorted_map/inorder_iterator.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_map/map.mbt b/immut/sorted_map/map.mbt index bad1f290b..39459d24e 100644 --- a/immut/sorted_map/map.mbt +++ b/immut/sorted_map/map.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ ///| /// Create a new map with a key-value pair inserted. /// O(log n). -/// +/// pub fn add[K : Compare, V](self : T[K, V], key : K, value : V) -> T[K, V] { match self { Empty => singleton(key, value) diff --git a/immut/sorted_map/map_test.mbt b/immut/sorted_map/map_test.mbt index 188edd849..ab2cf1af8 100644 --- a/immut/sorted_map/map_test.mbt +++ b/immut/sorted_map/map_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_map/panic_wbtest.mbt b/immut/sorted_map/panic_wbtest.mbt index 6c85df4c3..270c970a4 100644 --- a/immut/sorted_map/panic_wbtest.mbt +++ b/immut/sorted_map/panic_wbtest.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_map/traits_impl.mbt b/immut/sorted_map/traits_impl.mbt index 563dfb2f4..7eda4de69 100644 --- a/immut/sorted_map/traits_impl.mbt +++ b/immut/sorted_map/traits_impl.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_map/types.mbt b/immut/sorted_map/types.mbt index 0e43e3881..01da65acc 100644 --- a/immut/sorted_map/types.mbt +++ b/immut/sorted_map/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_map/utils.mbt b/immut/sorted_map/utils.mbt index 17118dd6b..952e3205a 100644 --- a/immut/sorted_map/utils.mbt +++ b/immut/sorted_map/utils.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_map/utils_test.mbt b/immut/sorted_map/utils_test.mbt index 768b3ad3f..6807f4540 100644 --- a/immut/sorted_map/utils_test.mbt +++ b/immut/sorted_map/utils_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_set/generic.mbt b/immut/sorted_set/generic.mbt index e122d4baf..92b168f5c 100644 --- a/immut/sorted_set/generic.mbt +++ b/immut/sorted_set/generic.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_set/immutable_set.mbt b/immut/sorted_set/immutable_set.mbt index d085ee1c9..9a2983790 100644 --- a/immut/sorted_set/immutable_set.mbt +++ b/immut/sorted_set/immutable_set.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -63,9 +63,9 @@ pub fn to_array[A : Compare](self : T[A]) -> Array[A] { ///| /// Remove the smallest value, -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([3, 4, 5]).remove_min(), @sorted_set.of([4, 5])) /// ``` @@ -83,9 +83,9 @@ pub fn remove_min[A : Compare](self : T[A]) -> T[A] { ///| /// Insert a value into the ImmutableSet. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([6, 3, 8, 1]).add(5), @sorted_set.of([1, 3, 5, 6, 8])) /// ``` @@ -117,9 +117,9 @@ pub fn add[A : Compare](self : T[A], value : A) -> T[A] { ///| /// Remove n value from the ImmutableSet. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([3, 8, 1]).remove(8), @sorted_set.of([1, 3])) /// ``` @@ -151,9 +151,9 @@ pub fn remove[A : Compare](self : T[A], value : A) -> T[A] { ///| /// Returns the smallest value in the sorted_set. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([7, 2, 9, 4, 5, 6, 3, 8, 1]).min(), 1) /// ``` @@ -185,9 +185,9 @@ pub fn min_option[A : Compare](self : T[A]) -> A? { ///| /// Returns the largest value in the sorted_set. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([7, 2, 9, 4, 5, 6, 3, 8, 1]).max(), 9) /// ``` @@ -219,11 +219,11 @@ pub fn max_option[A : Compare](self : T[A]) -> A? { ///| /// Returns a triple (left, present, right), where left < divide < right. -/// present == false if self contains no value equal to divide, +/// present == false if self contains no value equal to divide, /// present == true if self contains an value equal to divide. -/// +/// /// # Example -/// +/// /// ``` /// let (left, present, right) = @sorted_set.of([7, 2, 9, 4, 5, 6, 3, 8, 1]).split(5) /// assert_eq!(present, true) @@ -272,9 +272,9 @@ pub fn contains[A : Compare](self : T[A], value : A) -> Bool { ///| /// Returns the union of self and other. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([3, 4, 5]).union(@sorted_set.of([4, 5, 6])), @sorted_set.of([3, 4, 5, 6])) /// ``` @@ -311,9 +311,9 @@ pub fn inter[A : Compare](self : T[A], other : T[A]) -> T[A] { ///| /// Returns the intersection of self with other. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([3, 4, 5]).intersection(@sorted_set.of([4, 5, 6])), @sorted_set.of([4, 5])) /// ``` @@ -330,13 +330,13 @@ pub fn intersection[A : Compare](self : T[A], other : T[A]) -> T[A] { ///| /// Returns the difference between self and other. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([1, 2, 3]).difference(@sorted_set.of([4, 5, 1])), @sorted_set.of([2, 3])) /// ``` -/// +/// /// @alert deprecated "Use `difference` instead" /// @coverage.skip pub fn diff[A : Compare](self : T[A], other : T[A]) -> T[A] { @@ -345,9 +345,9 @@ pub fn diff[A : Compare](self : T[A], other : T[A]) -> T[A] { ///| /// Returns the difference between self and other. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([1, 2, 3]).difference(@sorted_set.of([4, 5, 1])), @sorted_set.of([2, 3])) /// ``` @@ -365,9 +365,9 @@ pub fn difference[A : Compare](self : T[A], other : T[A]) -> T[A] { ///| /// Returns true if self is a subset of other. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([1, 2, 3]).subset(@sorted_set.of([7, 2, 9, 4, 5, 6, 3, 8, 1])), true) /// ``` @@ -395,9 +395,9 @@ pub fn subset[A : Compare](self : T[A], other : T[A]) -> Bool { ///| /// Returns true if the two sets do not intersect. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([1, 2, 3]).disjoint(@sorted_set.of([4, 5, 6])), true) /// ``` @@ -418,9 +418,9 @@ pub fn disjoint[A : Compare](self : T[A], other : T[A]) -> Bool { ///| /// Iterates over the ImmutableSet. -/// +/// /// # Example -/// +/// /// ``` /// let arr = [] /// @sorted_set.of([7, 2, 9, 4, 5, 6, 3, 8, 1]).each(fn(x) { arr.push(x) }) @@ -439,9 +439,9 @@ pub fn each[A](self : T[A], f : (A) -> Unit) -> Unit { ///| /// Fold the ImmutableSet. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([1, 2, 3, 4, 5]).fold(init=0, fn(acc, x) { acc + x }), 15) /// ``` @@ -455,9 +455,9 @@ pub fn fold[A : Compare, B](self : T[A], init~ : B, f : (B, A) -> B) -> B { ///| /// Maps the ImmutableSet. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([1, 2, 3]).map(fn(x){ x * 2}), @sorted_set.of([2, 4, 6])) /// ``` @@ -471,9 +471,9 @@ pub fn map[A : Compare, B : Compare](self : T[A], f : (A) -> B) -> T[B] { ///| /// Test if all values of the ImmutableSet satisfy the predicate. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([2, 4, 6]).all(fn(v) { v % 2 == 0}), true) /// ``` @@ -486,9 +486,9 @@ pub fn all[A : Compare](self : T[A], f : (A) -> Bool) -> Bool { ///| /// Checks if at least one element of the set satisfies the predicate. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([1, 4, 3]).any(fn(v) { v % 2 == 0}), true) /// ``` @@ -501,9 +501,9 @@ pub fn any[A : Compare](self : T[A], f : (A) -> Bool) -> Bool { ///| /// Filter the ImmutableSet. -/// +/// /// # Example -/// +/// /// ``` /// assert_eq!(@sorted_set.of([1, 2, 3, 4, 5, 6]).filter(fn(v) { v % 2 == 0}), @sorted_set.of([2, 4, 6])) /// ``` @@ -731,7 +731,7 @@ fn try_join[A : Compare](left : T[A], value : A, right : T[A]) -> T[A] { } ///| -/// Merge two ImmutableSet[T] into one. +/// Merge two ImmutableSet[T] into one. /// All values of left must precede the values of r. fn merge[A : Compare](self : T[A], other : T[A]) -> T[A] { match (self, other) { diff --git a/immut/sorted_set/immutable_set_test.mbt b/immut/sorted_set/immutable_set_test.mbt index 9cf29a5cb..f95a16b8e 100644 --- a/immut/sorted_set/immutable_set_test.mbt +++ b/immut/sorted_set/immutable_set_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_set/panic_test.mbt b/immut/sorted_set/panic_test.mbt index 7a2b7a85e..1fa09c2fc 100644 --- a/immut/sorted_set/panic_test.mbt +++ b/immut/sorted_set/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/immut/sorted_set/types.mbt b/immut/sorted_set/types.mbt index 8df7fb653..1c74b64b1 100644 --- a/immut/sorted_set/types.mbt +++ b/immut/sorted_set/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/int/int_test.mbt b/int/int_test.mbt index ce1e7d5f4..0b6813ba4 100644 --- a/int/int_test.mbt +++ b/int/int_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/int64/int64_test.mbt b/int64/int64_test.mbt index 61463f9fb..f59864b4b 100644 --- a/int64/int64_test.mbt +++ b/int64/int64_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/derive_json_test.mbt b/json/derive_json_test.mbt index 2b40cf93d..c1e721036 100644 --- a/json/derive_json_test.mbt +++ b/json/derive_json_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,8 +34,8 @@ test { ///| // struct Hello2 [A, B] { -// fieldA : A -// fieldB : B +// fieldA : A +// fieldB : B // data : Map[B, A] // }derive(ToJson) // Should the deriver generate constraints that [B: Show] diff --git a/json/from_to_json_test.mbt b/json/from_to_json_test.mbt index bfef05d68..a8dd882e0 100644 --- a/json/from_to_json_test.mbt +++ b/json/from_to_json_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/internal_types.mbt b/json/internal_types.mbt index 78d280d9a..3c8b2174e 100644 --- a/json/internal_types.mbt +++ b/json/internal_types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/json.mbt b/json/json.mbt index 6dfe0e083..fb63aa9a3 100644 --- a/json/json.mbt +++ b/json/json.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/json_encode_decode_test.mbt b/json/json_encode_decode_test.mbt index b78ea49ce..27e11eec4 100644 --- a/json/json_encode_decode_test.mbt +++ b/json/json_encode_decode_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -59,19 +59,19 @@ fn of_json(jv : Json) -> AllThree!DecodeError { for n in ints { match n { Number(n) => ints_result.push(n.to_int()) - _ => () // error handling here + _ => () // error handling here } } for n in floats { match n { Number(n) => floats_result.push(n) - _ => () // error handling here + _ => () // error handling here } } for s in strings { match s { String(s) => strings_result.push(s) - _ => () // error handling here + _ => () // error handling here } } { ints: ints_result, floats: floats_result, strings: strings_result } diff --git a/json/json_inspect_test.mbt b/json/json_inspect_test.mbt index d9bf94975..dae772fec 100644 --- a/json/json_inspect_test.mbt +++ b/json/json_inspect_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/json_path.mbt b/json/json_path.mbt index 9f19e9e3d..7437a7bba 100644 --- a/json/json_path.mbt +++ b/json/json_path.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/json_test.mbt b/json/json_test.mbt index 85f4c4ec8..ea2f69f2a 100644 --- a/json/json_test.mbt +++ b/json/json_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/lex_main.mbt b/json/lex_main.mbt index 8914fa528..7ea0f2c5e 100644 --- a/json/lex_main.mbt +++ b/json/lex_main.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/lex_misc.mbt b/json/lex_misc.mbt index 4689ace17..115ba1543 100644 --- a/json/lex_misc.mbt +++ b/json/lex_misc.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/lex_number.mbt b/json/lex_number.mbt index 0bb5128cb..9db17665d 100644 --- a/json/lex_number.mbt +++ b/json/lex_number.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/lex_string.mbt b/json/lex_string.mbt index 5eb27c376..cd13e0801 100644 --- a/json/lex_string.mbt +++ b/json/lex_string.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/parse.mbt b/json/parse.mbt index be949e5c9..a9b3ae2c7 100644 --- a/json/parse.mbt +++ b/json/parse.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/parse_error_test.mbt b/json/parse_error_test.mbt index 1f3674ca1..330a8e3dc 100644 --- a/json/parse_error_test.mbt +++ b/json/parse_error_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/parse_test.mbt b/json/parse_test.mbt index 84dd0308d..11de6d157 100644 --- a/json/parse_test.mbt +++ b/json/parse_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/tuple_fromjson.mbt b/json/tuple_fromjson.mbt index 65a9f4f57..f2340eb9c 100644 --- a/json/tuple_fromjson.mbt +++ b/json/tuple_fromjson.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/types.mbt b/json/types.mbt index 6b4e4f696..e32eee2e7 100644 --- a/json/types.mbt +++ b/json/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/types_test.mbt b/json/types_test.mbt index 0e04895dc..21bb6a5a4 100644 --- a/json/types_test.mbt +++ b/json/types_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/json/utils.mbt b/json/utils.mbt index 90f95fa69..43adf0a84 100644 --- a/json/utils.mbt +++ b/json/utils.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/math/algebraic.mbt b/math/algebraic.mbt index de942a68b..056053551 100644 --- a/math/algebraic.mbt +++ b/math/algebraic.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/math/algebraic_test.mbt b/math/algebraic_test.mbt index 8e4d1b7ad..3b407d765 100644 --- a/math/algebraic_test.mbt +++ b/math/algebraic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/math/exp.mbt b/math/exp.mbt index f0780e950..9d9a9395d 100644 --- a/math/exp.mbt +++ b/math/exp.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/math/log.mbt b/math/log.mbt index 1c2996297..d38ff60c7 100644 --- a/math/log.mbt +++ b/math/log.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/math/round.mbt b/math/round.mbt index 94da90264..0dd7ef42e 100644 --- a/math/round.mbt +++ b/math/round.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/math/trigonometric.mbt b/math/trigonometric.mbt index fa930efd5..362d427f4 100644 --- a/math/trigonometric.mbt +++ b/math/trigonometric.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/math/trigonometric_test.mbt b/math/trigonometric_test.mbt index cf5b832f5..b8358fefc 100644 --- a/math/trigonometric_test.mbt +++ b/math/trigonometric_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,7 +226,7 @@ test "atan2" { } test "tan with very small value" { - let x = 1.0e-8 // x * x = 1.0e-16 < 1.0e-14 + let x = 1.0e-8 // x * x = 1.0e-16 < 1.0e-14 inspect!(@math.tan(x), content="1e-8") } diff --git a/option/option.mbt b/option/option.mbt index ca9fe67d5..89ef663f8 100644 --- a/option/option.mbt +++ b/option/option.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -146,7 +146,7 @@ test "map_or" { ///| /// Computes a default function result (if none), or applies a different function to the contained value (if any). -/// +/// /// # Example /// /// ``` diff --git a/option/option_test.mbt b/option/option_test.mbt index 77b597dad..dd0b21d92 100644 --- a/option/option_test.mbt +++ b/option/option_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/option/panic_test.mbt b/option/panic_test.mbt index 8e2283552..7bf055b25 100644 --- a/option/panic_test.mbt +++ b/option/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/priority_queue/panic_test.mbt b/priority_queue/panic_test.mbt index 4160a5dee..e17b44c95 100644 --- a/priority_queue/panic_test.mbt +++ b/priority_queue/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/priority_queue/priority_queue.mbt b/priority_queue/priority_queue.mbt index 0e140c31c..760690328 100644 --- a/priority_queue/priority_queue.mbt +++ b/priority_queue/priority_queue.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ ///| /// Creates a new empty priority queue. -/// +/// /// # Example /// ``` /// let queue : @priority_queue.T[Int] = @priority_queue.new() @@ -26,14 +26,14 @@ pub fn T::new[A : Compare]() -> T[A] { ///| /// Creates a new priority queue from an array. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4, 5]) /// assert_eq!(queue.length(), 5) /// ``` pub fn T::from_array[A : Compare](arr : Array[A]) -> T[A] { - // CR: bad formatting + // CR: bad formatting let len = arr.length() for i = 0, acc = Node::Nil { if i < len { @@ -59,7 +59,7 @@ fn copy_node[A](x : Node[A]) -> Node[A] { ///| /// Return a copy of the queue. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4]) @@ -152,7 +152,7 @@ pub fn length[A](self : T[A]) -> Int { ///| /// Pops the first value from the priority queue. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4]) @@ -177,7 +177,7 @@ pub fn pop_exn[A : Compare](self : T[A]) -> Unit { ///| /// Pops the first value from the priority queue, which returns None if the queue is empty. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4]) @@ -199,7 +199,7 @@ pub fn pop[A : Compare](self : T[A]) -> A? { ///| /// Adds a value to the priority queue. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.new() @@ -213,7 +213,7 @@ pub fn push[A : Compare](self : T[A], value : A) -> Unit { ///| /// Peeks at the first value in the priority queue, which returns None if the priority queue is empty. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4]) @@ -229,7 +229,7 @@ pub fn peek[A](self : T[A]) -> A? { ///| /// Clears the queue. -/// +/// /// # Example /// ``` /// let queue = @priority_queue.of([1, 2, 3, 4]) @@ -243,7 +243,7 @@ pub fn clear[A](self : T[A]) -> Unit { ///| /// Checks if the priority queue is empty. -/// +/// /// # Example /// ``` /// let queue : @priority_queue.T[Int] = @priority_queue.new() @@ -255,7 +255,7 @@ pub fn is_empty[A](self : T[A]) -> Bool { ///| pub fn T::of[A : Compare](arr : FixedArray[A]) -> T[A] { - // CR: bad formatting + // CR: bad formatting let len = arr.length() for i = 0, acc = Node::Nil { if i < len { diff --git a/priority_queue/priority_queue_test.mbt b/priority_queue/priority_queue_test.mbt index 74e30fb1e..15c9bcffa 100644 --- a/priority_queue/priority_queue_test.mbt +++ b/priority_queue/priority_queue_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/priority_queue/types.mbt b/priority_queue/types.mbt index 3219dd2d7..36d1808fe 100644 --- a/priority_queue/types.mbt +++ b/priority_queue/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/queue/panic_test.mbt b/queue/panic_test.mbt index 1cec74877..7fc2b6ec5 100644 --- a/queue/panic_test.mbt +++ b/queue/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/queue/queue.mbt b/queue/queue.mbt index 3d54cbf8c..2cc34970b 100644 --- a/queue/queue.mbt +++ b/queue/queue.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/queue/queue_test.mbt b/queue/queue_test.mbt index 4ebabaa2d..58ebfc050 100644 --- a/queue/queue_test.mbt +++ b/queue/queue_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/queue/types.mbt b/queue/types.mbt index 7f3f21bb4..b7af0b1a2 100644 --- a/queue/types.mbt +++ b/queue/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/quickcheck/arbitrary_test.mbt b/quickcheck/arbitrary_test.mbt index b5dae5073..a86bf1aa3 100644 --- a/quickcheck/arbitrary_test.mbt +++ b/quickcheck/arbitrary_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/quickcheck/splitmix/random.mbt b/quickcheck/splitmix/random.mbt index 7c7583a28..0aa76c692 100644 --- a/quickcheck/splitmix/random.mbt +++ b/quickcheck/splitmix/random.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/quickcheck/utils.mbt b/quickcheck/utils.mbt index 34ab7c5cd..e87493950 100644 --- a/quickcheck/utils.mbt +++ b/quickcheck/utils.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/random/random.mbt b/random/random.mbt index 4f5886ac9..5ef3f6601 100644 --- a/random/random.mbt +++ b/random/random.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -49,9 +49,9 @@ test "next" { ///| /// [int] Return a non-negative pseudo-random 31-bit integer as an Int in the range [0, 2^31) or [0, limit) if limit is provided. -/// +/// /// # Arguments -/// +/// /// * `limit` - The upper bound (exclusive) of the random number to be generated (Optional). /// When limit is 0, the range is [0, 2^31). pub fn Rand::int(self : Rand, limit~ : Int = 0) -> Int { @@ -65,9 +65,9 @@ pub fn Rand::int(self : Rand, limit~ : Int = 0) -> Int { ///| /// [int64] returns a non-negative pseudo-random 63-bit integer as an Int64 in the range [0, 2^63) -/// +/// /// # Arguments -/// +/// /// * `limit` - The upper bound (exclusive) of the random number to be generated (Optional). /// When limit is 0, the range is [0, 2^63). pub fn Rand::int64(self : Rand, limit~ : Int64 = 0) -> Int64 { @@ -83,9 +83,9 @@ pub fn Rand::int64(self : Rand, limit~ : Int64 = 0) -> Int64 { ///| /// [uint] returns a non-negative pseudo-random 32-bit integer as a Uint in the range [0, 2^32) or [0, limit) if limit is provided. -/// +/// /// # Arguments -/// +/// /// * `limit` - The upper bound (exclusive) of the random number to be generated (Optional). /// When limit is 0, the range is [0, 2^32). pub fn Rand::uint(self : Rand, limit~ : UInt = 0) -> UInt { @@ -108,9 +108,9 @@ test "uint" { ///| /// [uint64] returns a non-negative pseudo-random 64-bit integer as a Uint64 in the range [0, 2^64) or [0, limit) if limit is provided. -/// +/// /// # Arguments -/// +/// /// * `limit` - The upper bound (exclusive) of the random number to be generated (Optional). /// When limit is 0, the range is [0, 2^64). pub fn Rand::uint64(self : Rand, limit~ : UInt64 = 0) -> UInt64 { @@ -219,7 +219,7 @@ test "umul128: handles zero correctly" { ///| /// [shuffle] shuffles the first n elements of an array using the Fisher-Yates shuffle algorithm. /// @alert unsafe "Panics if limit is negative" -/// +/// /// # Example /// ``` /// let r = @random.new() diff --git a/random/random_test.mbt b/random/random_test.mbt index 3a2b11393..8e91f8c8a 100644 --- a/random/random_test.mbt +++ b/random/random_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/rational/rational.mbt b/rational/rational.mbt index adca3806f..912bb84c2 100644 --- a/rational/rational.mbt +++ b/rational/rational.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ ///| /// Rational number type. -/// +/// /// Invariants: /// - The denominator is always positive. /// - The numerator and denominator are always coprime. diff --git a/rational/rational_test.mbt b/rational/rational_test.mbt index 10d94cc5a..0c9bad82f 100644 --- a/rational/rational_test.mbt +++ b/rational/rational_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/ref/ref.mbt b/ref/ref.mbt index de9c75827..eba8a4179 100644 --- a/ref/ref.mbt +++ b/ref/ref.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ pub fn map[T, R](self : Ref[T], f : (T) -> R) -> Ref[R] { } ///| -/// This function allows you to temporarily replace the value of a reference with a new value, +/// This function allows you to temporarily replace the value of a reference with a new value, /// execute a given function, and then restore the original value of the reference. /// /// # Arguments @@ -47,9 +47,9 @@ pub fn map[T, R](self : Ref[T], f : (T) -> R) -> Ref[R] { /// # Returns /// /// The result of executing the provided function `f`. -/// +/// /// # Example -/// +/// /// ``` /// let x = @ref.new(1) /// x.protect(2, fn!(){ diff --git a/ref/ref_test.mbt b/ref/ref_test.mbt index eec576238..5a745392f 100644 --- a/ref/ref_test.mbt +++ b/ref/ref_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/result/panic_test.mbt b/result/panic_test.mbt index 3d1b79d3b..f80113ec1 100644 --- a/result/panic_test.mbt +++ b/result/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/result/result.mbt b/result/result.mbt index e1a9ff836..d323b9b8c 100644 --- a/result/result.mbt +++ b/result/result.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -187,7 +187,7 @@ test "or_else" { ///| /// Flatten a `Result` of `Result` into a single `Result`. -/// +/// /// If the outer `Result` is an `Ok`, the inner `Result` is returned. If the outer `Result` is an `Err`, the inner `Result` is ignored and the `Err` is returned. /// /// # Example @@ -241,7 +241,7 @@ test "bind" { ///| /// Folds a `Result` into a single value. -/// +/// /// If the `Result` is an `Ok`, the `ok` function is applied to the value. If the `Result` is an `Err`, the `err` function is applied to the value. /// # Example /// @@ -268,7 +268,7 @@ test "fold" { ///| /// Converts a `Result` to an `Option`. -/// +/// /// Converts `Ok` to `Some` and `Err` to `None`. /// /// # Example diff --git a/result/result_test.mbt b/result/result_test.mbt index 7ed73dab9..f3d424b8d 100644 --- a/result/result_test.mbt +++ b/result/result_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sorted_map/map.mbt b/sorted_map/map.mbt index 0251a10e2..31fab04f9 100644 --- a/sorted_map/map.mbt +++ b/sorted_map/map.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sorted_map/map_test.mbt b/sorted_map/map_test.mbt index 29f74c9c0..994d7ac06 100644 --- a/sorted_map/map_test.mbt +++ b/sorted_map/map_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sorted_map/types.mbt b/sorted_map/types.mbt index a19b9cbe8..46a1a420a 100644 --- a/sorted_map/types.mbt +++ b/sorted_map/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sorted_map/utils.mbt b/sorted_map/utils.mbt index 0aa354367..19e946250 100644 --- a/sorted_map/utils.mbt +++ b/sorted_map/utils.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sorted_set/set_test.mbt b/sorted_set/set_test.mbt index a220e4e15..c4c23a4f1 100644 --- a/sorted_set/set_test.mbt +++ b/sorted_set/set_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sorted_set/types.mbt b/sorted_set/types.mbt index 0a8269f2b..364fa04c2 100644 --- a/sorted_set/types.mbt +++ b/sorted_set/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sorted_set/utils.mbt b/sorted_set/utils.mbt index 817474b3f..fda0cc12f 100644 --- a/sorted_set/utils.mbt +++ b/sorted_set/utils.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/strconv/bool.mbt b/strconv/bool.mbt index 3fd3cb6af..3df99f4d3 100644 --- a/strconv/bool.mbt +++ b/strconv/bool.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/strconv/double.mbt b/strconv/double.mbt index e634a2038..f5353d1f4 100644 --- a/strconv/double.mbt +++ b/strconv/double.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ let double_info : FloatInfo = { } ///| -/// TODO: For `f32` it is 23, but we don't have `f32` yet. +/// TODO: For `f32` it is 23, but we don't have `f32` yet. let mantissa_explicit_bits = 52 ///| diff --git a/strconv/errors.mbt b/strconv/errors.mbt index d09b2e9e5..ec9a24f67 100644 --- a/strconv/errors.mbt +++ b/strconv/errors.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/strconv/int.mbt b/strconv/int.mbt index 3cc29b340..22ffc493a 100644 --- a/strconv/int.mbt +++ b/strconv/int.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/strconv/int_test.mbt b/strconv/int_test.mbt index eccb5bd51..ea4f155b9 100644 --- a/strconv/int_test.mbt +++ b/strconv/int_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/strconv/number.mbt b/strconv/number.mbt index 43daf13ca..df95734d9 100644 --- a/strconv/number.mbt +++ b/strconv/number.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/strconv/string_slice.mbt b/strconv/string_slice.mbt index bb8945a26..d04f530de 100644 --- a/strconv/string_slice.mbt +++ b/strconv/string_slice.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ fn first_is_digit(self : StringSlice) -> Bool { } ///| -/// Step over `step` non-underscore characters. +/// Step over `step` non-underscore characters. /// Return None if there are not enough characters. fn step(self : StringSlice, step : Int) -> StringSlice? { let c = self diff --git a/string/deprecated.mbt b/string/deprecated.mbt index 24f98e9bf..cb85c4e0a 100644 --- a/string/deprecated.mbt +++ b/string/deprecated.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/string/panic_test.mbt b/string/panic_test.mbt index 68fc92e26..a6d15ef9e 100644 --- a/string/panic_test.mbt +++ b/string/panic_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/string/string.mbt b/string/string.mbt index 45dc16727..9fc0fa434 100644 --- a/string/string.mbt +++ b/string/string.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ ///| /// Convert char array to string. -/// +/// /// ``` /// let s = @string.from_array(['H', 'e', 'l', 'l', 'o']) /// assert_eq!(s, "Hello") /// ``` -/// +/// /// Do not convert large datas to `Array[Char]` and build a string with `String::from_array`. -/// +/// /// For efficiency considerations, it's recommended to use `Buffer` instead. pub fn String::from_array(chars : Array[Char]) -> String { let buf = StringBuilder::new(size_hint=chars.length() * 4) @@ -41,7 +41,7 @@ pub fn String::from_iter(iter : Iter[Char]) -> String { ///| /// Concatenate strings. -/// +/// /// ``` /// let s = @string.concat(["Hello", ", ", "world!"]) /// assert_eq!(s, "Hello, world!") @@ -192,26 +192,26 @@ pub fn rev_fold[A](self : String, init~ : A, f : (A, Char) -> A) -> A { } ///| -/// Returns an iterator that yields characters from the end to the start of the string. This function handles +/// Returns an iterator that yields characters from the end to the start of the string. This function handles /// Unicode surrogate pairs correctly, ensuring that characters are not split across surrogate pairs. -/// +/// /// # Parameters -/// +/// /// - `self` : The input `String` to be iterated in reverse. -/// +/// /// # Returns -/// +/// /// - An `Iter[Char]` that yields characters from the end to the start of the string. -/// +/// /// # Behavior -/// +/// /// - The function iterates over the string in reverse order. /// - If a trailing surrogate is encountered, it checks for a preceding leading surrogate to form a complete Unicode code point. /// - Yields each character or combined code point to the iterator. /// - Stops iteration if the `yield_` function returns `IterEnd`. -/// +/// /// # Examples -/// +/// /// ``` /// let input = "Hello, World!" /// let reversed = input.rev_iter().collect() @@ -451,24 +451,24 @@ pub fn ends_with(self : String, str : String) -> Bool { ///| /// Splits the input `String` into an `Iter` of `String` using the specified `separator`. -/// +/// /// # Parameters -/// +/// /// - `self` : The input `String` to be split. /// - `separator` : The `String` used as the delimiter for splitting. -/// +/// /// # Returns -/// +/// /// - An `Iter` of `String` where each element is a substring of the original string, separated by the `separator`. -/// +/// /// # Behavior -/// +/// /// - If the `separator` is an empty string (`""`), the function returns an `Iter` where each element is a single character from the input string converted to a `String`. /// - If the `separator` is not empty, the function searches for occurrences of the `separator` in the input string and yields substrings between these occurrences. /// - If no more occurrences of the `separator` are found, the remaining part of the string is yielded as the last element of the `Iter`. -/// +/// /// # Examples -/// +/// /// ``` /// let input = "a,b,c,d" /// let separator = "," @@ -606,9 +606,9 @@ pub fn repeat(self : String, n : Int) -> String { ///| /// `pad_start` is a new string with `padding_char`s prefixed to `self` if `self.length() < total_width`. The length of the /// returned string is `total_width`. -/// +/// /// Example: -/// +/// /// ``` /// assert_eq!("2".pad_start(3, '0'), "002") /// ``` @@ -633,9 +633,9 @@ pub fn pad_start( ///| /// `pad_end` is a new String with `padding_char`s suffixed to `self` if `self.length() < total_width`. The length of the /// returned string is `total_width`. -/// +/// /// Example: -/// +/// /// ``` /// assert_eq!("2".pad_end(3, 'x'), "2xx") /// ``` diff --git a/string/string_test.mbt b/string/string_test.mbt index 60efe79bf..69321f324 100644 --- a/string/string_test.mbt +++ b/string/string_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/test.mbt b/test/test.mbt index eb78d81e0..5d2e9165a 100644 --- a/test/test.mbt +++ b/test/test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/types.mbt b/test/types.mbt index 8bdad0525..1e82a1fd7 100644 --- a/test/types.mbt +++ b/test/types.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tuple/tuple.mbt b/tuple/tuple.mbt index b41d7db71..51db90303 100644 --- a/tuple/tuple.mbt +++ b/tuple/tuple.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ ///| /// Create a tuple with two elements. -/// +/// /// # Example /// ``` /// let tuple = @tuple.pair(1, 2) @@ -26,7 +26,7 @@ pub fn pair[T, U](x : T, y : U) -> (T, U) { ///| /// Get the first element of a tuple. -/// +/// /// # Example /// ``` /// let tuple = (1, 2) @@ -39,7 +39,7 @@ pub fn fst[T, U](tuple : (T, U)) -> T { ///| /// Get the second element of a tuple. -/// +/// /// # Example /// ``` /// let tuple = (1, 2) @@ -52,7 +52,7 @@ pub fn snd[T, U](tuple : (T, U)) -> U { ///| /// Map a function over the first element of a tuple. -/// +/// /// # Example /// ``` /// let tuple = (1, 2) @@ -65,7 +65,7 @@ pub fn map_fst[T, U, V](f : (T) -> U, tuple : (T, V)) -> (U, V) { ///| /// Map a function over the second element of a tuple. -/// +/// /// # Example /// ``` /// let tuple = (1, 2) @@ -78,7 +78,7 @@ pub fn map_snd[T, U, V](f : (T) -> U, tuple : (V, T)) -> (V, U) { ///| /// Map a function over both elements of a tuple. -/// +/// /// # Example /// ``` /// let tuple = (1, 2) @@ -95,7 +95,7 @@ pub fn map_both[T, U, V, W]( ///| /// Swap the elements of a tuple. -/// +/// /// # Example /// ``` /// let tuple = (1, 2) @@ -108,7 +108,7 @@ pub fn swap[T, U](tuple : (T, U)) -> (U, T) { ///| /// Curry a function. -/// +/// /// # Example /// ``` /// let add = fn(x : Int, y : Int) -> Int { x + y } @@ -121,7 +121,7 @@ pub fn curry[T, U, V](f : (T, U) -> V) -> (T) -> (U) -> V { ///| /// Uncurry a function. -/// +/// /// # Example /// ``` /// let add = fn(x : Int) -> (Int) -> Int { fn(y : Int) -> Int { x + y } } diff --git a/tuple/tuple_arbitrary.mbt b/tuple/tuple_arbitrary.mbt index 27648cb79..ee1b9e98e 100644 --- a/tuple/tuple_arbitrary.mbt +++ b/tuple/tuple_arbitrary.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tuple/tuple_test.mbt b/tuple/tuple_test.mbt index e58bc1b66..d04338018 100644 --- a/tuple/tuple_test.mbt +++ b/tuple/tuple_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/uint/uint_test.mbt b/uint/uint_test.mbt index 4b1dd10d4..b63197b81 100644 --- a/uint/uint_test.mbt +++ b/uint/uint_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/unit/unit.mbt b/unit/unit.mbt index 062887382..583bc5c14 100644 --- a/unit/unit.mbt +++ b/unit/unit.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/unit/unit_test.mbt b/unit/unit_test.mbt index f1157de34..01cebe0ec 100644 --- a/unit/unit_test.mbt +++ b/unit/unit_test.mbt @@ -1,4 +1,4 @@ -// Copyright 2024 International Digital Economy Academy +// Copyright 2025 International Digital Economy Academy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 300d12be2b53f197b53cfe59061a04889dcd60e0 Mon Sep 17 00:00:00 2001 From: Roman Heinrich Date: Sun, 12 Jan 2025 00:31:24 +0100 Subject: [PATCH 2/2] Chore: fix a typo happend -> happend --- builtin/linked_hash_map.mbt | 2 +- hashmap/hashmap.mbt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/linked_hash_map.mbt b/builtin/linked_hash_map.mbt index 5e4ad39fa..3688dc93e 100644 --- a/builtin/linked_hash_map.mbt +++ b/builtin/linked_hash_map.mbt @@ -66,7 +66,7 @@ fn power_2_above(x : Int, n : Int) -> Int { } let next = i << 1 if next < 0 { - // overflow happend + // overflow happened break i } continue next diff --git a/hashmap/hashmap.mbt b/hashmap/hashmap.mbt index 06f9c2264..4868a24bb 100644 --- a/hashmap/hashmap.mbt +++ b/hashmap/hashmap.mbt @@ -20,7 +20,7 @@ fn power_2_above(x : Int, n : Int) -> Int { } let next = i << 1 if next < 0 { - // overflow happend + // overflow happened break i } continue next