mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Rearrange old codegen
This commit is contained in:
parent
9af8d74f36
commit
47e6328427
@ -8,7 +8,7 @@
|
||||
*/
|
||||
@file:Suppress("PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
package net.mamoe.mirai.console.codegen.old
|
||||
|
||||
/**
|
||||
* used to generate Java Setting
|
@ -9,7 +9,7 @@
|
||||
|
||||
@file:Suppress("PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
package net.mamoe.mirai.console.codegen.old
|
||||
|
||||
import org.intellij.lang.annotations.Language
|
||||
import java.io.File
|
||||
@ -67,18 +67,33 @@ fun genAllValueUseSite(): String = buildString {
|
||||
|
||||
// PRIMITIVE ARRAYS
|
||||
for (number in NUMBERS + OTHER_PRIMITIVES.filterNot { it == "String" }) {
|
||||
appendln(genValueUseSite("${number}Array", "${number}Array"))
|
||||
appendln(
|
||||
genValueUseSite(
|
||||
"${number}Array",
|
||||
"${number}Array"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// TYPED ARRAYS
|
||||
for (number in NUMBERS + OTHER_PRIMITIVES) {
|
||||
appendln(genValueUseSite("Array<${number}>", "Typed${number}Array"))
|
||||
appendln(
|
||||
genValueUseSite(
|
||||
"Array<${number}>",
|
||||
"Typed${number}Array"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// PRIMITIVE LISTS / PRIMITIVE SETS
|
||||
for (collectionName in listOf("List", "Set")) {
|
||||
for (number in NUMBERS + OTHER_PRIMITIVES) {
|
||||
appendln(genValueUseSite("${collectionName}<${number}>", "${number}${collectionName}"))
|
||||
appendln(
|
||||
genValueUseSite(
|
||||
"${collectionName}<${number}>",
|
||||
"${number}${collectionName}"
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
@file:Suppress("PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
package net.mamoe.mirai.console.codegen.old
|
||||
|
||||
import org.intellij.lang.annotations.Language
|
||||
import java.io.File
|
||||
@ -59,13 +59,27 @@ fun genAllValueImpl(): String = buildString {
|
||||
|
||||
// PRIMITIVE
|
||||
for (number in NUMBERS + OTHER_PRIMITIVES) {
|
||||
appendln(genPrimitiveValueImpl(number, number, "$number.serializer()", false))
|
||||
appendln(
|
||||
genPrimitiveValueImpl(
|
||||
number,
|
||||
number,
|
||||
"$number.serializer()",
|
||||
false
|
||||
)
|
||||
)
|
||||
appendLine()
|
||||
}
|
||||
|
||||
// PRIMITIVE ARRAYS
|
||||
for (number in NUMBERS + OTHER_PRIMITIVES.filterNot { it == "String" }) {
|
||||
appendln(genPrimitiveValueImpl("${number}Array", "${number}Array", "${number}ArraySerializer()", true))
|
||||
appendln(
|
||||
genPrimitiveValueImpl(
|
||||
"${number}Array",
|
||||
"${number}Array",
|
||||
"${number}ArraySerializer()",
|
||||
true
|
||||
)
|
||||
)
|
||||
appendLine()
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
@file:Suppress("ClassName", "unused", "PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
package net.mamoe.mirai.console.codegen.old
|
||||
|
||||
import org.intellij.lang.annotations.Language
|
||||
import java.io.File
|
Loading…
Reference in New Issue
Block a user