Skip to content

Commit 8dd5d45

Browse files
lppeddftomassetti
authored andcommitted
refactor: make WeakHashMap internal
1 parent b7a54cb commit 8dd5d45

File tree

5 files changed

+9
-8
lines changed
  • antlr-kotlin-runtime/src

5 files changed

+9
-8
lines changed

antlr-kotlin-runtime/src/commonMain/kotlin/com/strumenta/antlrkotlin/runtime/WeakHashMap.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Copyright 2024-present Strumenta and contributors, licensed under BSD 3-Clause.
33
package com.strumenta.antlrkotlin.runtime
44

5-
public expect class WeakHashMap<K, V>() : MutableMap<K, V> {
5+
internal expect class WeakHashMap<K, V>() : MutableMap<K, V> {
66
override val size: Int
77
override val entries: MutableSet<MutableMap.MutableEntry<K, V>>
88
override val keys: MutableSet<K>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2017-present Strumenta and contributors, licensed under Apache 2.0.
22
// Copyright 2024-present Strumenta and contributors, licensed under BSD 3-Clause.
3-
43
package com.strumenta.antlrkotlin.runtime
54

65
// Note(Edoardo): this is implemented as an HashMap in the JS target,
76
// so let's keep it as it is
8-
public actual typealias WeakHashMap<K, V> = HashMap<K, V>
7+
@Suppress("ACTUAL_WITHOUT_EXPECT")
8+
internal actual typealias WeakHashMap<K, V> = HashMap<K, V>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2017-present Strumenta and contributors, licensed under Apache 2.0.
22
// Copyright 2024-present Strumenta and contributors, licensed under BSD 3-Clause.
3-
43
package com.strumenta.antlrkotlin.runtime
54

65
import java.util.WeakHashMap as JavaWeakHashMap
76

8-
public actual typealias WeakHashMap<K, V> = JavaWeakHashMap<K, V>
7+
@Suppress("ACTUAL_WITHOUT_EXPECT")
8+
internal actual typealias WeakHashMap<K, V> = JavaWeakHashMap<K, V>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright 2017-present Strumenta and contributors, licensed under Apache 2.0.
22
// Copyright 2024-present Strumenta and contributors, licensed under BSD 3-Clause.
3-
43
package com.strumenta.antlrkotlin.runtime
54

65
// TODO(Edoardo): implement real weak keys.
76
// See kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.ref
87
// for classes and functions useful for a possible implementation
9-
public actual typealias WeakHashMap<K, V> = HashMap<K, V>
8+
@Suppress("ACTUAL_WITHOUT_EXPECT")
9+
internal actual typealias WeakHashMap<K, V> = HashMap<K, V>

antlr-kotlin-runtime/src/wasmWasiMain/kotlin/com/strumenta/antlrkotlin/runtime/WeakHashMap.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
package com.strumenta.antlrkotlin.runtime
44

55
// TODO(Edoardo): implement real weak keys
6-
public actual typealias WeakHashMap<K, V> = HashMap<K, V>
6+
@Suppress("ACTUAL_WITHOUT_EXPECT")
7+
internal actual typealias WeakHashMap<K, V> = HashMap<K, V>

0 commit comments

Comments
 (0)