Update parsers structure

This commit is contained in:
2025-02-26 16:19:32 +02:00
parent 29cf04c804
commit f681ed270b
148 changed files with 1123 additions and 1022 deletions

View File

@@ -70,6 +70,7 @@ class ParserProcessor(
package org.koitharu.kotatsu.parsers
import org.koitharu.kotatsu.parsers.model.MangaParserSource
import org.koitharu.kotatsu.parsers.core.MangaParserWrapper
internal fun MangaParserSource.newParser(context: MangaLoaderContext): MangaParser = when (this) {
@@ -98,10 +99,11 @@ class ParserProcessor(
factoryWriter?.write(
"""
MangaParserSource.DUMMY -> throw NotImplementedError("Manga parser ${'$'}name cannot be instantiated")
}.also {
}.let {
require(it.source == this) {
"Cannot instantiate manga parser: ${'$'}name mapped to ${'$'}{it.source}"
}
MangaParserWrapper(it)
}
""".trimIndent(),
)