Merge Kotlin build-1.5.0-dev-1282 with K/N (6b8547b8f93adb)
Straighten Char-to-code and Char-to-digit conversions out #KT-23451 Kotlin/Native base commit: 6b8547b8f93adb49447d6583d3d9934acd1b0922
This commit is contained in:
@@ -18,12 +18,12 @@
|
||||
buildKotlinVersion=1.4.20-dev-2167
|
||||
buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.4.20-dev-2167,branch:default:any,pinned:true/artifacts/content/maven
|
||||
remoteRoot=konan_tests
|
||||
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.5.0-dev-1023,branch:default:any,pinned:true/artifacts/content/maven
|
||||
kotlinVersion=1.5.0-dev-1023
|
||||
kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.5.0-dev-1023,branch:default:any,pinned:true/artifacts/content/maven
|
||||
kotlinStdlibVersion=1.5.0-dev-1023
|
||||
kotlinStdlibTestsVersion=1.5.0-dev-1023
|
||||
testKotlinCompilerVersion=1.5.0-dev-1023
|
||||
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.5.0-dev-1282,branch:default:any,pinned:true/artifacts/content/maven
|
||||
kotlinVersion=1.5.0-dev-1282
|
||||
kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.5.0-dev-1282,branch:default:any,pinned:true/artifacts/content/maven
|
||||
kotlinStdlibVersion=1.5.0-dev-1282
|
||||
kotlinStdlibTestsVersion=1.5.0-dev-1282
|
||||
testKotlinCompilerVersion=1.5.0-dev-1282
|
||||
konanVersion=1.5.0
|
||||
|
||||
# A version of Xcode required to build the Kotlin/Native compiler.
|
||||
|
||||
@@ -461,7 +461,7 @@ staticLibraryRelocationMode.linux_arm32_hfp = pic
|
||||
|
||||
linker.linux_x64-linux_arm32_hfp = $targetToolchain.linux_x64-linux_arm32_hfp/bin/ld
|
||||
linkerHostSpecificFlags.linux_x64-linux_arm32_hfp =
|
||||
linker.mingw_x64-linux_arm32_hfp = $targetToolchain.mingw_x64-linux_arm32_hfp/bin/ld
|
||||
linker.mingw_x64-linux_arm32_hfp = $targetToolchain.mingw_x64-linux_arm32_hfp/bin/ld.gold
|
||||
linkerHostSpecificFlags.mingw_x64-linux_arm32_hfp =
|
||||
linker.macos_x64-linux_arm32_hfp = $targetToolchain.macos_x64-linux_arm32_hfp/bin/ld.lld
|
||||
linkerHostSpecificFlags.macos_x64-linux_arm32_hfp = --no-threads
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package kotlin
|
||||
|
||||
/**
|
||||
* Creates a Char with the specified [code].
|
||||
*
|
||||
* @sample samples.text.Chars.charFromCode
|
||||
*/
|
||||
@OptIn(ExperimentalUnsignedTypes::class)
|
||||
@ExperimentalStdlibApi
|
||||
@SinceKotlin("1.4")
|
||||
@kotlin.internal.InlineOnly
|
||||
public actual inline fun Char(code: UShort): Char {
|
||||
return code.toInt().toChar()
|
||||
}
|
||||
@@ -64,17 +64,75 @@ external public fun Char.isUpperCase(): Boolean
|
||||
external public fun Char.isLowerCase(): Boolean
|
||||
|
||||
/**
|
||||
* Converts this character to uppercase.
|
||||
* Converts this character to upper case using Unicode mapping rules of the invariant locale.
|
||||
*/
|
||||
@SymbolName("Kotlin_Char_toUpperCase")
|
||||
external public actual fun Char.toUpperCase(): Char
|
||||
|
||||
/**
|
||||
* Converts this character to lowercase.
|
||||
* Converts this character to upper case using Unicode mapping rules of the invariant locale.
|
||||
*
|
||||
* This function performs one-to-one character mapping.
|
||||
* To support one-to-many character mapping use the [uppercase] function.
|
||||
* If this character has no mapping equivalent, the character itself is returned.
|
||||
*
|
||||
* @sample samples.text.Chars.uppercase
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@ExperimentalStdlibApi
|
||||
public actual fun Char.uppercaseChar(): Char = toUpperCase()
|
||||
|
||||
/**
|
||||
* Converts this character to upper case using Unicode mapping rules of the invariant locale.
|
||||
*
|
||||
* This function supports one-to-many character mapping, thus the length of the returned string can be greater than one.
|
||||
* For example, `'\uFB00'.uppercase()` returns `"\u0046\u0046"`,
|
||||
* where `'\uFB00'` is the LATIN SMALL LIGATURE FF character (`ff`).
|
||||
* If this character has no upper case mapping, the result of `toString()` of this char is returned.
|
||||
*
|
||||
* @sample samples.text.Chars.uppercase
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@ExperimentalStdlibApi
|
||||
public actual fun Char.uppercase(): String {
|
||||
return uppercaseChar().toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts this character to lower case using Unicode mapping rules of the invariant locale.
|
||||
*/
|
||||
@SymbolName("Kotlin_Char_toLowerCase")
|
||||
external public actual fun Char.toLowerCase(): Char
|
||||
|
||||
/**
|
||||
* Converts this character to lower case using Unicode mapping rules of the invariant locale.
|
||||
*
|
||||
* This function performs one-to-one character mapping.
|
||||
* To support one-to-many character mapping use the [lowercase] function.
|
||||
* If this character has no mapping equivalent, the character itself is returned.
|
||||
*
|
||||
* @sample samples.text.Chars.lowercase
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@ExperimentalStdlibApi
|
||||
public actual fun Char.lowercaseChar(): Char = toLowerCase()
|
||||
|
||||
/**
|
||||
* Converts this character to lower case using Unicode mapping rules of the invariant locale.
|
||||
*
|
||||
* This function supports one-to-many character mapping, thus the length of the returned string can be greater than one.
|
||||
* For example, `'\u0130'.lowercase()` returns `"\u0069\u0307"`,
|
||||
* where `'\u0130'` is the LATIN CAPITAL LETTER I WITH DOT ABOVE character (`İ`).
|
||||
* If this character has no lower case mapping, the result of `toString()` of this char is returned.
|
||||
*
|
||||
* @sample samples.text.Chars.lowercase
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@ExperimentalStdlibApi
|
||||
public actual fun Char.lowercase(): String {
|
||||
return lowercaseChar().toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns `true` if this character is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).
|
||||
*/
|
||||
|
||||
@@ -158,13 +158,36 @@ public external fun String.regionMatches(
|
||||
@SymbolName("Kotlin_String_toUpperCase")
|
||||
public actual external fun String.toUpperCase(): String
|
||||
|
||||
/**
|
||||
* Returns a copy of this string converted to upper case using Unicode mapping rules of the invariant locale.
|
||||
*
|
||||
* This function supports one-to-many and many-to-one character mapping,
|
||||
* thus the length of the returned string can be different from the length of the original string.
|
||||
*
|
||||
* @sample samples.text.Strings.uppercase
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@ExperimentalStdlibApi
|
||||
public actual fun String.uppercase(): String = toUpperCase()
|
||||
|
||||
/**
|
||||
* Returns a copy of this string converted to lower case using the rules of the default locale.
|
||||
*/
|
||||
@SymbolName("Kotlin_String_toLowerCase")
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
public actual external fun String.toLowerCase(): String
|
||||
|
||||
/**
|
||||
* Returns a copy of this string converted to lower case using Unicode mapping rules of the invariant locale.
|
||||
*
|
||||
* This function supports one-to-many and many-to-one character mapping,
|
||||
* thus the length of the returned string can be different from the length of the original string.
|
||||
*
|
||||
* @sample samples.text.Strings.lowercase
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@ExperimentalStdlibApi
|
||||
public actual fun String.lowercase(): String = toLowerCase()
|
||||
|
||||
/**
|
||||
* Returns a [CharArray] containing characters of this string.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user