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")
|
@file:Suppress("PRE_RELEASE_CLASS")
|
||||||
|
|
||||||
package net.mamoe.mirai.console.codegen
|
package net.mamoe.mirai.console.codegen.old
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* used to generate Java Setting
|
* used to generate Java Setting
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
@file:Suppress("PRE_RELEASE_CLASS")
|
@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 org.intellij.lang.annotations.Language
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -67,18 +67,33 @@ fun genAllValueUseSite(): String = buildString {
|
|||||||
|
|
||||||
// PRIMITIVE ARRAYS
|
// PRIMITIVE ARRAYS
|
||||||
for (number in NUMBERS + OTHER_PRIMITIVES.filterNot { it == "String" }) {
|
for (number in NUMBERS + OTHER_PRIMITIVES.filterNot { it == "String" }) {
|
||||||
appendln(genValueUseSite("${number}Array", "${number}Array"))
|
appendln(
|
||||||
|
genValueUseSite(
|
||||||
|
"${number}Array",
|
||||||
|
"${number}Array"
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TYPED ARRAYS
|
// TYPED ARRAYS
|
||||||
for (number in NUMBERS + OTHER_PRIMITIVES) {
|
for (number in NUMBERS + OTHER_PRIMITIVES) {
|
||||||
appendln(genValueUseSite("Array<${number}>", "Typed${number}Array"))
|
appendln(
|
||||||
|
genValueUseSite(
|
||||||
|
"Array<${number}>",
|
||||||
|
"Typed${number}Array"
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PRIMITIVE LISTS / PRIMITIVE SETS
|
// PRIMITIVE LISTS / PRIMITIVE SETS
|
||||||
for (collectionName in listOf("List", "Set")) {
|
for (collectionName in listOf("List", "Set")) {
|
||||||
for (number in NUMBERS + OTHER_PRIMITIVES) {
|
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")
|
@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 org.intellij.lang.annotations.Language
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -59,13 +59,27 @@ fun genAllValueImpl(): String = buildString {
|
|||||||
|
|
||||||
// PRIMITIVE
|
// PRIMITIVE
|
||||||
for (number in NUMBERS + OTHER_PRIMITIVES) {
|
for (number in NUMBERS + OTHER_PRIMITIVES) {
|
||||||
appendln(genPrimitiveValueImpl(number, number, "$number.serializer()", false))
|
appendln(
|
||||||
|
genPrimitiveValueImpl(
|
||||||
|
number,
|
||||||
|
number,
|
||||||
|
"$number.serializer()",
|
||||||
|
false
|
||||||
|
)
|
||||||
|
)
|
||||||
appendLine()
|
appendLine()
|
||||||
}
|
}
|
||||||
|
|
||||||
// PRIMITIVE ARRAYS
|
// PRIMITIVE ARRAYS
|
||||||
for (number in NUMBERS + OTHER_PRIMITIVES.filterNot { it == "String" }) {
|
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()
|
appendLine()
|
||||||
}
|
}
|
||||||
|
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
@file:Suppress("ClassName", "unused", "PRE_RELEASE_CLASS")
|
@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 org.intellij.lang.annotations.Language
|
||||||
import java.io.File
|
import java.io.File
|
Loading…
Reference in New Issue
Block a user