From 225be54c61edf6dd13a79d953bec8d1e37c4a13c Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Mon, 31 May 2021 01:25:45 +0300 Subject: [PATCH] Get rid of platform differences in Regex.find doc --- kotlin-native/runtime/src/main/kotlin/kotlin/text/Regex.kt | 1 + libraries/stdlib/common/src/kotlin/TextH.kt | 1 + libraries/stdlib/js/src/kotlin/text/regex.kt | 4 +++- libraries/stdlib/jvm/src/kotlin/text/regex/Regex.kt | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/text/Regex.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/text/Regex.kt index 3cf7e328b7f..5ac1b0e6dd2 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/text/Regex.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/text/Regex.kt @@ -156,6 +156,7 @@ public actual class Regex internal constructor(internal val nativePattern: Patte * @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()` * @return An instance of [MatchResult] if match was found or `null` otherwise. * @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence. + * @sample samples.text.Regexps.find */ @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") actual fun find(input: CharSequence, startIndex: Int = 0): MatchResult? { diff --git a/libraries/stdlib/common/src/kotlin/TextH.kt b/libraries/stdlib/common/src/kotlin/TextH.kt index eedf5fb97a3..7cc34a8e326 100644 --- a/libraries/stdlib/common/src/kotlin/TextH.kt +++ b/libraries/stdlib/common/src/kotlin/TextH.kt @@ -25,6 +25,7 @@ expect class Regex { * * @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()` * @return An instance of [MatchResult] if match was found or `null` otherwise. + * @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence. * @sample samples.text.Regexps.find */ fun find(input: CharSequence, startIndex: Int = 0): MatchResult? diff --git a/libraries/stdlib/js/src/kotlin/text/regex.kt b/libraries/stdlib/js/src/kotlin/text/regex.kt index c5cd563217b..fcbba68fd59 100644 --- a/libraries/stdlib/js/src/kotlin/text/regex.kt +++ b/libraries/stdlib/js/src/kotlin/text/regex.kt @@ -66,11 +66,13 @@ public actual class Regex actual constructor(pattern: String, options: Set