[K/N] Mark BitSet usages in stdlib with @ObsoleteNativeApi
This commit is contained in:
committed by
Space Team
parent
9ff863ced7
commit
9076e5b112
@@ -3,6 +3,8 @@
|
|||||||
* that can be found in the LICENSE file.
|
* that can be found in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@file:OptIn(kotlin.native.ObsoleteNativeApi::class)
|
||||||
|
|
||||||
package runtime.collections.BitSet
|
package runtime.collections.BitSet
|
||||||
|
|
||||||
import kotlin.test.*
|
import kotlin.test.*
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import kotlin.native.concurrent.AtomicReference
|
|||||||
import kotlin.native.concurrent.freeze
|
import kotlin.native.concurrent.freeze
|
||||||
import kotlin.native.BitSet
|
import kotlin.native.BitSet
|
||||||
import kotlin.native.FreezingIsDeprecated
|
import kotlin.native.FreezingIsDeprecated
|
||||||
|
import kotlin.native.ObsoleteNativeApi
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unicode category (i.e. Ll, Lu).
|
* Unicode category (i.e. Ll, Lu).
|
||||||
@@ -49,7 +50,7 @@ internal class UnicodeCategoryScope(category: Int) : UnicodeCategory(category) {
|
|||||||
* This class represents character classes, i.e. sets of character either predefined or user defined.
|
* This class represents character classes, i.e. sets of character either predefined or user defined.
|
||||||
* Note: this class represent a token, not node, so being constructed by lexer.
|
* Note: this class represent a token, not node, so being constructed by lexer.
|
||||||
*/
|
*/
|
||||||
@OptIn(FreezingIsDeprecated::class)
|
@OptIn(FreezingIsDeprecated::class, ObsoleteNativeApi::class)
|
||||||
internal abstract class AbstractCharClass : SpecialToken() {
|
internal abstract class AbstractCharClass : SpecialToken() {
|
||||||
/**
|
/**
|
||||||
* Show if the class has alternative meaning:
|
* Show if the class has alternative meaning:
|
||||||
|
|||||||
@@ -23,11 +23,13 @@
|
|||||||
package kotlin.text.regex
|
package kotlin.text.regex
|
||||||
|
|
||||||
import kotlin.native.BitSet
|
import kotlin.native.BitSet
|
||||||
|
import kotlin.native.ObsoleteNativeApi
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User defined character classes (e.g. [abef]).
|
* User defined character classes (e.g. [abef]).
|
||||||
*/
|
*/
|
||||||
// TODO: replace the implementation with one using BitSet for first 256 symbols and a hash table / tree for the rest of UTF.
|
// TODO: replace the implementation with one using BitSet for first 256 symbols and a hash table / tree for the rest of UTF.
|
||||||
|
@OptIn(ObsoleteNativeApi::class)
|
||||||
internal class CharClass(val ignoreCase: Boolean = false, negative: Boolean = false) : AbstractCharClass() {
|
internal class CharClass(val ignoreCase: Boolean = false, negative: Boolean = false) : AbstractCharClass() {
|
||||||
|
|
||||||
var invertedSurrogates = false
|
var invertedSurrogates = false
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2023 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.native
|
||||||
|
|
||||||
|
import kotlin.annotation.AnnotationTarget.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This annotation marks the Kotlin/Native standard library API that is considered obsolete and is being phased out.
|
||||||
|
*
|
||||||
|
* This is an internal copy of the public K/N annotation.
|
||||||
|
* It is used to [OptIn] obsolete K/N API used in the shared native-wasm directory.
|
||||||
|
*/
|
||||||
|
@RequiresOptIn(message = "This API is obsolete and subject to removal in a future release.", level = RequiresOptIn.Level.WARNING)
|
||||||
|
@Retention(AnnotationRetention.BINARY)
|
||||||
|
@Target(
|
||||||
|
AnnotationTarget.CLASS,
|
||||||
|
AnnotationTarget.ANNOTATION_CLASS,
|
||||||
|
AnnotationTarget.PROPERTY,
|
||||||
|
AnnotationTarget.FIELD,
|
||||||
|
AnnotationTarget.LOCAL_VARIABLE,
|
||||||
|
AnnotationTarget.VALUE_PARAMETER,
|
||||||
|
AnnotationTarget.CONSTRUCTOR,
|
||||||
|
AnnotationTarget.FUNCTION,
|
||||||
|
AnnotationTarget.PROPERTY_GETTER,
|
||||||
|
AnnotationTarget.PROPERTY_SETTER,
|
||||||
|
AnnotationTarget.TYPEALIAS
|
||||||
|
)
|
||||||
|
@MustBeDocumented
|
||||||
|
@SinceKotlin("1.9")
|
||||||
|
internal annotation class ObsoleteNativeApi
|
||||||
Reference in New Issue
Block a user