-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a062ad
commit 48c9986
Showing
9 changed files
with
49 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
.../kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/oir/type/SpecialReferenceOirType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
package co.touchlab.skie.oir.type | ||
|
||
sealed class SpecialReferenceOirType(private val name: String) : NonNullReferenceOirType() { | ||
sealed class SpecialReferenceOirType(val name: String) : NonNullReferenceOirType() { | ||
|
||
object Id : SpecialReferenceOirType("id") | ||
|
||
object InstanceType : SpecialReferenceOirType("instancetype") | ||
|
||
object Class : SpecialReferenceOirType("Class") | ||
|
||
object Protocol : SpecialReferenceOirType("Protocol") { | ||
|
||
override fun render(attrsAndName: String, needsNonnullAttribute: Boolean): String = | ||
buildString { | ||
append(name) | ||
append(" *") | ||
appendAttrsAndName(attrsAndName) | ||
} | ||
} | ||
|
||
override fun render(attrsAndName: String, needsNonnullAttribute: Boolean): String = | ||
name.withAttrsAndName(attrsAndName.plusNonnullAttributeIfNeeded(needsNonnullAttribute)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/io/outfoxx/swiftpoet/ProtocolTypeName.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.outfoxx.swiftpoet | ||
|
||
/* | ||
* Copyright 2023 Touchlab | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
class ProtocolTypeName private constructor() : TypeName() { | ||
|
||
override fun emit(out: CodeWriter): CodeWriter { | ||
out.emit("Protocol") | ||
return out | ||
} | ||
|
||
companion object { | ||
|
||
val INSTANCE = ProtocolTypeName() | ||
} | ||
} |