From fc5c91b21982cb5b05387f48b502235caf1ada53 Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Wed, 31 Jul 2024 17:00:11 -0500 Subject: [PATCH] cleanup, fix filling unmappedNs's --- .../mapping/formats/FormatRegistry.kt | 8 +- .../formats/mcp/v1/MCPv1FieldReader.kt | 5 +- .../formats/mcp/v1/MCPv1MethodReader.kt | 8 +- .../formats/mcp/v6/MCPv6FieldReader.kt | 2 +- .../formats/mcp/v6/MCPv6MethodReader.kt | 5 +- .../mapping/formats/tiny/v2/TinyV2Writer.kt | 2 +- .../unimined/mapping/formats/umf/UMFReader.kt | 6 +- .../mapping/formats/unpick/UnpickReader.kt | 2 +- .../jvms/ext/FieldOrMethodDescriptor.kt | 1 - .../jvms/ext/annotation/AnnotationElement.kt | 4 - .../ext/annotation/AnnotationElementName.kt | 4 +- .../ext/annotation/AnnotationElementValue.kt | 3 - .../jvms/ext/annotation/ArrayConstant.kt | 4 - .../jvms/ext/annotation/ArrayElements.kt | 4 - .../jvms/ext/annotation/ClassConstant.kt | 1 - .../mapping/jvms/ext/annotation/Constant.kt | 4 +- .../four/seven/nine/one/JavaTypeSignature.kt | 1 - .../four/seven/nine/one/class/ClassBound.kt | 2 - .../seven/nine/one/class/InterfaceBound.kt | 2 - .../nine/one/class/SuperclassSignature.kt | 1 - .../nine/one/class/SuperinterfaceSignature.kt | 1 - .../seven/nine/one/field/FieldSignature.kt | 1 - .../jvms/four/seven/nine/one/method/Result.kt | 1 - .../seven/nine/one/method/ThrowsSignature.kt | 2 - .../nine/one/reference/ArrayTypeSignature.kt | 2 - .../one/reference/ClassTypeSignatureSuffix.kt | 2 - .../nine/one/reference/PackageSpecifier.kt | 4 - .../one/reference/ReferenceTypeSignature.kt | 1 - .../one/reference/SimpleClassTypeSignature.kt | 3 - .../seven/nine/one/reference/TypeArgument.kt | 4 - .../seven/nine/one/reference/TypeArguments.kt | 4 - .../one/reference/TypeVariableSignature.kt | 3 - .../nine/one/reference/WildcardIndicator.kt | 2 - .../four/three/three/ParameterDescriptor.kt | 1 - .../jvms/four/three/three/ReturnDescriptor.kt | 1 - .../jvms/four/three/three/VoidDescriptor.kt | 3 - .../mapping/jvms/four/three/two/ArrayType.kt | 2 - .../mapping/jvms/four/three/two/BaseType.kt | 2 - .../jvms/four/three/two/ComponentType.kt | 1 - .../jvms/four/three/two/FieldDescriptor.kt | 1 - .../mapping/jvms/four/three/two/FieldType.kt | 1 - .../mapping/jvms/four/three/two/ObjectType.kt | 4 - .../mapping/jvms/four/two/two/MethodName.kt | 4 - .../mapping/resolver/MappingResolver.kt | 2 +- .../unimined/mapping/tree/LazyMappingTree.kt | 9 +- .../mapping/tree/MemoryMappingTree.kt | 12 ++- .../mapping/tree/MergedMappingTree.kt | 4 +- .../mapping/tree/ReadOnlyMappingTree.kt | 5 +- .../unimined/mapping/tree/node/AccessNode.kt | 6 +- .../mapping/tree/node/AnnotationNode.kt | 7 +- .../unimined/mapping/tree/node/JavadocNode.kt | 5 +- .../mapping/tree/node/SignatureNode.kt | 4 +- .../mapping/tree/node/_class/ClassNode.kt | 8 +- .../tree/node/_class/InnerClassNode.kt | 7 +- .../_class/member/AbstractFieldMethodNode.kt | 6 +- .../_class/member/FieldMethodResolvable.kt | 3 +- .../tree/node/_class/member/FieldNode.kt | 6 +- .../tree/node/_class/member/MemberNode.kt | 7 +- .../tree/node/_class/member/MethodNode.kt | 12 +-- .../tree/node/_class/member/WildcardNode.kt | 4 +- .../_class/member/method/ExceptionNode.kt | 8 +- .../node/_class/member/method/LocalNode.kt | 7 +- .../_class/member/method/ParameterNode.kt | 7 +- .../tree/node/_constant/ConstantGroupNode.kt | 12 +-- .../tree/node/_constant/ConstantNode.kt | 6 +- .../mapping/tree/node/_constant/TargetNode.kt | 6 +- .../mapping/tree/node/_package/PackageNode.kt | 4 +- .../mapping/util/BufferedSourceUtils.kt | 99 ------------------- .../unimined/mapping/util/LazyMutable.kt | 1 - .../unimined/mapping/util/MustSet.kt | 2 - .../mapping/visitor/EmptyMappingVisitor.kt | 46 +++------ .../mapping/visitor/MappingVisitor.kt | 9 +- .../visitor/delegate/DelegateVisitor.kt | 6 +- .../mapping/visitor/delegate/MultiVisitor.kt | 44 +++------ .../delegate/NamespaceRecordingVisitor.kt | 2 +- .../visitor/delegate/NsFilteredVisitor.kt | 2 +- .../mapping/visitor/delegate/NullDelegator.kt | 2 +- .../mapping/visitor/delegate/Visitors.kt | 2 +- 78 files changed, 143 insertions(+), 348 deletions(-) diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/FormatRegistry.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/FormatRegistry.kt index 0df1590..1a58ea7 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/FormatRegistry.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/FormatRegistry.kt @@ -4,9 +4,9 @@ import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.EnvType import xyz.wagyourtail.unimined.mapping.formats.csrg.CsrgReader import xyz.wagyourtail.unimined.mapping.formats.feather.ExceptionReader +import xyz.wagyourtail.unimined.mapping.formats.feather.NestReader +import xyz.wagyourtail.unimined.mapping.formats.feather.SignatureReader import xyz.wagyourtail.unimined.mapping.formats.mcp.MCPExceptionReader -import xyz.wagyourtail.unimined.mapping.formats.tsrg.TsrgV1Reader -import xyz.wagyourtail.unimined.mapping.formats.tsrg.TsrgV2Reader import xyz.wagyourtail.unimined.mapping.formats.mcp.v1.MCPv1FieldReader import xyz.wagyourtail.unimined.mapping.formats.mcp.v1.MCPv1MethodReader import xyz.wagyourtail.unimined.mapping.formats.mcp.v3.MCPv3ClassesReader @@ -17,8 +17,6 @@ import xyz.wagyourtail.unimined.mapping.formats.mcpconfig.MCPConfigAccessReader import xyz.wagyourtail.unimined.mapping.formats.mcpconfig.MCPConfigConstructorReader import xyz.wagyourtail.unimined.mapping.formats.mcpconfig.MCPConfigExceptionsReader import xyz.wagyourtail.unimined.mapping.formats.mcpconfig.MCPConfigStaticMethodsReader -import xyz.wagyourtail.unimined.mapping.formats.feather.NestReader -import xyz.wagyourtail.unimined.mapping.formats.feather.SignatureReader import xyz.wagyourtail.unimined.mapping.formats.parchment.ParchmentReader import xyz.wagyourtail.unimined.mapping.formats.proguard.ProguardReader import xyz.wagyourtail.unimined.mapping.formats.rgs.RetroguardReader @@ -28,6 +26,8 @@ import xyz.wagyourtail.unimined.mapping.formats.srg.SrgWriter import xyz.wagyourtail.unimined.mapping.formats.tiny.v1.TinyV1Reader import xyz.wagyourtail.unimined.mapping.formats.tiny.v2.TinyV2Reader import xyz.wagyourtail.unimined.mapping.formats.tiny.v2.TinyV2Writer +import xyz.wagyourtail.unimined.mapping.formats.tsrg.TsrgV1Reader +import xyz.wagyourtail.unimined.mapping.formats.tsrg.TsrgV2Reader import xyz.wagyourtail.unimined.mapping.formats.umf.UMFReader import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.formats.unpick.UnpickReader diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v1/MCPv1FieldReader.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v1/MCPv1FieldReader.kt index c96ac75..03e4568 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v1/MCPv1FieldReader.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v1/MCPv1FieldReader.kt @@ -9,7 +9,10 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.tree.AbstractMappingTree import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.visitor.* +import xyz.wagyourtail.unimined.mapping.visitor.ClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.FieldVisitor +import xyz.wagyourtail.unimined.mapping.visitor.JavadocVisitor +import xyz.wagyourtail.unimined.mapping.visitor.MappingVisitor import xyz.wagyourtail.unimined.mapping.visitor.delegate.NullDelegator import xyz.wagyourtail.unimined.mapping.visitor.delegate.delegator diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v1/MCPv1MethodReader.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v1/MCPv1MethodReader.kt index f99919f..b3548ff 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v1/MCPv1MethodReader.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v1/MCPv1MethodReader.kt @@ -9,8 +9,12 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.tree.AbstractMappingTree import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.* +import xyz.wagyourtail.unimined.mapping.visitor.ClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.JavadocVisitor +import xyz.wagyourtail.unimined.mapping.visitor.MappingVisitor +import xyz.wagyourtail.unimined.mapping.visitor.MethodVisitor +import xyz.wagyourtail.unimined.mapping.visitor.delegate.NullDelegator +import xyz.wagyourtail.unimined.mapping.visitor.delegate.delegator /** * this reads the MCP 1-2.12 method csv files diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v6/MCPv6FieldReader.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v6/MCPv6FieldReader.kt index a04a3f6..797bea7 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v6/MCPv6FieldReader.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v6/MCPv6FieldReader.kt @@ -9,8 +9,8 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.tree.AbstractMappingTree import xyz.wagyourtail.unimined.mapping.util.CharReader import xyz.wagyourtail.unimined.mapping.visitor.ClassVisitor -import xyz.wagyourtail.unimined.mapping.visitor.JavadocVisitor import xyz.wagyourtail.unimined.mapping.visitor.FieldVisitor +import xyz.wagyourtail.unimined.mapping.visitor.JavadocVisitor import xyz.wagyourtail.unimined.mapping.visitor.MappingVisitor import xyz.wagyourtail.unimined.mapping.visitor.delegate.NullDelegator import xyz.wagyourtail.unimined.mapping.visitor.delegate.delegator diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v6/MCPv6MethodReader.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v6/MCPv6MethodReader.kt index 78571bf..a4a1214 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v6/MCPv6MethodReader.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/mcp/v6/MCPv6MethodReader.kt @@ -8,7 +8,10 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.tree.AbstractMappingTree import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.visitor.* +import xyz.wagyourtail.unimined.mapping.visitor.ClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.JavadocVisitor +import xyz.wagyourtail.unimined.mapping.visitor.MappingVisitor +import xyz.wagyourtail.unimined.mapping.visitor.MethodVisitor import xyz.wagyourtail.unimined.mapping.visitor.delegate.NullDelegator import xyz.wagyourtail.unimined.mapping.visitor.delegate.delegator diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/tiny/v2/TinyV2Writer.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/tiny/v2/TinyV2Writer.kt index d185bb8..ff81e1b 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/tiny/v2/TinyV2Writer.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/tiny/v2/TinyV2Writer.kt @@ -12,9 +12,9 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._class.InnerClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.visitor.* @Suppress("UNUSED_PARAMETER") diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/umf/UMFReader.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/umf/UMFReader.kt index a66198e..2d38211 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/umf/UMFReader.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/umf/UMFReader.kt @@ -13,10 +13,12 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.AccessFlag import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName import xyz.wagyourtail.unimined.mapping.tree.AbstractMappingTree -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._class.InnerClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode -import xyz.wagyourtail.unimined.mapping.util.* +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode +import xyz.wagyourtail.unimined.mapping.util.CharReader +import xyz.wagyourtail.unimined.mapping.util.TokenType +import xyz.wagyourtail.unimined.mapping.util.filterNotNullValues import xyz.wagyourtail.unimined.mapping.visitor.* /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/unpick/UnpickReader.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/unpick/UnpickReader.kt index e62dfda..e6df8a5 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/unpick/UnpickReader.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/formats/unpick/UnpickReader.kt @@ -14,8 +14,8 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.two.two.UnqualifiedName import xyz.wagyourtail.unimined.mapping.tree.AbstractMappingTree import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.visitor.MappingVisitor import xyz.wagyourtail.unimined.mapping.util.defaultedMapOf +import xyz.wagyourtail.unimined.mapping.visitor.MappingVisitor import xyz.wagyourtail.unimined.mapping.visitor.use /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/FieldOrMethodDescriptor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/FieldOrMethodDescriptor.kt index 1366831..bcf0703 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/FieldOrMethodDescriptor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/FieldOrMethodDescriptor.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.ext -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElement.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElement.kt index 5a0c05f..14a9ca4 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElement.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElement.kt @@ -1,11 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.ext.annotation -import okio.Buffer -import okio.BufferedSource -import okio.use import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElementName.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElementName.kt index 0aac16a..c2e7b14 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElementName.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElementName.kt @@ -1,8 +1,8 @@ package xyz.wagyourtail.unimined.mapping.jvms.ext.annotation -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion -import xyz.wagyourtail.unimined.mapping.util.* +import xyz.wagyourtail.unimined.mapping.util.CharReader +import xyz.wagyourtail.unimined.mapping.util.translateEscapes import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElementValue.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElementValue.kt index 5229945..80eddb1 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElementValue.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/AnnotationElementValue.kt @@ -1,8 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.ext.annotation -import okio.Buffer -import okio.BufferedSource -import okio.use import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader import kotlin.jvm.JvmInline diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ArrayConstant.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ArrayConstant.kt index ac1dfa1..0e90723 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ArrayConstant.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ArrayConstant.kt @@ -1,11 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.ext.annotation -import okio.Buffer -import okio.BufferedSource -import okio.use import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ArrayElements.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ArrayElements.kt index e2b3e01..230bbc3 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ArrayElements.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ArrayElements.kt @@ -1,11 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.ext.annotation -import okio.Buffer -import okio.BufferedSource -import okio.use import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ClassConstant.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ClassConstant.kt index 2cefea3..98598cc 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ClassConstant.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/ClassConstant.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.ext.annotation -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.ObjectType import xyz.wagyourtail.unimined.mapping.util.CharReader diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/Constant.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/Constant.kt index 2fbe8bc..c37af59 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/Constant.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/ext/annotation/Constant.kt @@ -1,8 +1,8 @@ package xyz.wagyourtail.unimined.mapping.jvms.ext.annotation -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion -import xyz.wagyourtail.unimined.mapping.util.* +import xyz.wagyourtail.unimined.mapping.util.CharReader +import xyz.wagyourtail.unimined.mapping.util.translateEscapes import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/JavaTypeSignature.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/JavaTypeSignature.kt index c89697c..d6b0b6c 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/JavaTypeSignature.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/JavaTypeSignature.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference.ReferenceTypeSignature import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.BaseType diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/ClassBound.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/ClassBound.kt index 3a414bf..3be16c3 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/ClassBound.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/ClassBound.kt @@ -1,10 +1,8 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.`class` -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference.ReferenceTypeSignature import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/InterfaceBound.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/InterfaceBound.kt index d3f7a8e..10c1808 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/InterfaceBound.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/InterfaceBound.kt @@ -1,10 +1,8 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.`class` -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference.ReferenceTypeSignature import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/SuperclassSignature.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/SuperclassSignature.kt index c8a1f9e..d2fb8fc 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/SuperclassSignature.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/SuperclassSignature.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.`class` -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference.ClassTypeSignature import xyz.wagyourtail.unimined.mapping.util.CharReader diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/SuperinterfaceSignature.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/SuperinterfaceSignature.kt index 39f31c8..1c24f2e 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/SuperinterfaceSignature.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/class/SuperinterfaceSignature.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.`class` -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference.ClassTypeSignature import xyz.wagyourtail.unimined.mapping.util.CharReader diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/field/FieldSignature.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/field/FieldSignature.kt index f29398f..02d6774 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/field/FieldSignature.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/field/FieldSignature.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.field -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference.ReferenceTypeSignature import xyz.wagyourtail.unimined.mapping.util.CharReader diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/method/Result.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/method/Result.kt index a67ee11..5ea3ade 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/method/Result.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/method/Result.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.method -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.JavaTypeSignature import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.VoidDescriptor diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/method/ThrowsSignature.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/method/ThrowsSignature.kt index 9c4d8e2..8d48912 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/method/ThrowsSignature.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/method/ThrowsSignature.kt @@ -1,11 +1,9 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.method -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference.ClassTypeSignature import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference.TypeVariableSignature import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ArrayTypeSignature.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ArrayTypeSignature.kt index f44b816..09d48a4 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ArrayTypeSignature.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ArrayTypeSignature.kt @@ -1,10 +1,8 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.JavaTypeSignature import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ClassTypeSignatureSuffix.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ClassTypeSignatureSuffix.kt index f8a4fc8..95812db 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ClassTypeSignatureSuffix.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ClassTypeSignatureSuffix.kt @@ -1,9 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/PackageSpecifier.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/PackageSpecifier.kt index b5c3c6b..3169144 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/PackageSpecifier.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/PackageSpecifier.kt @@ -1,12 +1,8 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.JVMS import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.appendCodePoint -import xyz.wagyourtail.unimined.mapping.util.checkedToChar -import xyz.wagyourtail.unimined.mapping.util.takeUTF8Until import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ReferenceTypeSignature.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ReferenceTypeSignature.kt index 7e51084..16f6ecb 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ReferenceTypeSignature.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/ReferenceTypeSignature.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader import kotlin.jvm.JvmInline diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/SimpleClassTypeSignature.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/SimpleClassTypeSignature.kt index 1cd004f..754677c 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/SimpleClassTypeSignature.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/SimpleClassTypeSignature.kt @@ -1,11 +1,8 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.JVMS import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar -import xyz.wagyourtail.unimined.mapping.util.takeUTF8Until import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeArgument.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeArgument.kt index 122ec65..f92dac2 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeArgument.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeArgument.kt @@ -1,11 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference -import okio.Buffer -import okio.BufferedSource -import okio.use import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeArguments.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeArguments.kt index 596b679..5822bfb 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeArguments.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeArguments.kt @@ -1,11 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference -import okio.Buffer -import okio.BufferedSource -import okio.use import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeVariableSignature.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeVariableSignature.kt index c8e92aa..0047863 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeVariableSignature.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/TypeVariableSignature.kt @@ -1,11 +1,8 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.JVMS import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar -import xyz.wagyourtail.unimined.mapping.util.takeUTF8Until import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/WildcardIndicator.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/WildcardIndicator.kt index f599f6f..9d99654 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/WildcardIndicator.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/seven/nine/one/reference/WildcardIndicator.kt @@ -1,9 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.seven.nine.one.reference -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/ParameterDescriptor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/ParameterDescriptor.kt index addc609..bf3c7e0 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/ParameterDescriptor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/ParameterDescriptor.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.three.three -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldType import xyz.wagyourtail.unimined.mapping.util.CharReader diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/ReturnDescriptor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/ReturnDescriptor.kt index 661cd6d..8ee20ae 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/ReturnDescriptor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/ReturnDescriptor.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.three.three -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldType import xyz.wagyourtail.unimined.mapping.util.CharReader diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/VoidDescriptor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/VoidDescriptor.kt index 5ea3d1f..c40c1b4 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/VoidDescriptor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/three/VoidDescriptor.kt @@ -4,11 +4,8 @@ */ package xyz.wagyourtail.unimined.mapping.jvms.four.three.three -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar -import xyz.wagyourtail.unimined.mapping.util.toUnicode import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ArrayType.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ArrayType.kt index 04b7278..df7a25e 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ArrayType.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ArrayType.kt @@ -1,9 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.three.two -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/BaseType.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/BaseType.kt index dbbc493..29b6a54 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/BaseType.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/BaseType.kt @@ -1,9 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.three.two -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ComponentType.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ComponentType.kt index 0e28784..9648c10 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ComponentType.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ComponentType.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.three.two -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader import kotlin.jvm.JvmInline diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/FieldDescriptor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/FieldDescriptor.kt index 66bb867..e84ec43 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/FieldDescriptor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/FieldDescriptor.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.three.two -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader import kotlin.jvm.JvmInline diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/FieldType.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/FieldType.kt index 0e69400..f25b7f3 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/FieldType.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/FieldType.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.three.two -import okio.BufferedSource import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader import kotlin.jvm.JvmInline diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ObjectType.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ObjectType.kt index 96bc459..8a69894 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ObjectType.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/three/two/ObjectType.kt @@ -1,12 +1,8 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.three.two -import okio.BufferedSource -import xyz.wagyourtail.unimined.mapping.jvms.JVMS import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar -import xyz.wagyourtail.unimined.mapping.util.takeUTF8Until import kotlin.jvm.JvmInline /** diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/two/two/MethodName.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/two/two/MethodName.kt index 40b105a..4b265cd 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/two/two/MethodName.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/jvms/four/two/two/MethodName.kt @@ -1,11 +1,7 @@ package xyz.wagyourtail.unimined.mapping.jvms.four.two.two -import okio.BufferedSource -import xyz.wagyourtail.unimined.mapping.jvms.JVMS import xyz.wagyourtail.unimined.mapping.jvms.TypeCompanion import xyz.wagyourtail.unimined.mapping.util.CharReader -import xyz.wagyourtail.unimined.mapping.util.checkedToChar -import xyz.wagyourtail.unimined.mapping.util.takeUTF8Until import kotlin.jvm.JvmInline @JvmInline diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/resolver/MappingResolver.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/resolver/MappingResolver.kt index 7e44bc6..92aa423 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/resolver/MappingResolver.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/resolver/MappingResolver.kt @@ -200,7 +200,7 @@ abstract class MappingResolver>(val name: String) { afterLoad(resolved) - val filled = mutableSetOf() + val filled = unmappedNs.toMutableSet() for (entry in sorted) { val toFill = entry.provides.map { it.first }.toSet() - filled if (toFill.isNotEmpty()) { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/LazyMappingTree.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/LazyMappingTree.kt index 7c9fcb9..2920a7a 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/LazyMappingTree.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/LazyMappingTree.kt @@ -13,7 +13,6 @@ import xyz.wagyourtail.unimined.mapping.util.CharReader import xyz.wagyourtail.unimined.mapping.visitor.* import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateClassVisitor import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateConstantGroupVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateMappingVisitor import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegatePackageVisitor /** @@ -136,7 +135,7 @@ class LazyMappingTree : AbstractMappingTree() { return node.visitPackage(names) } - override fun visitClass(names: Map): ClassVisitor? { + override fun visitClass(names: Map): ClassVisitor { for (ns in namespaces.filter { it in names }) { // check if exists val existing = getLazyClass(ns, names[ns]!!) @@ -163,7 +162,7 @@ class LazyMappingTree : AbstractMappingTree() { name: String?, baseNs: Namespace, namespaces: Set - ): ConstantGroupVisitor? { + ): ConstantGroupVisitor { val node = LazyConstantGroupNode(this, type, name, baseNs, namespaces) _constantGroups.add(node) return node.visitConstantGroup(type, name, baseNs, namespaces) @@ -211,7 +210,7 @@ class LazyMappingTree : AbstractMappingTree() { return ClassNode(tree).also { node -> node.setNames(names) accept(object: ThrowingVisitor() { - override fun visitClass(names: Map): ClassVisitor? { + override fun visitClass(names: Map): ClassVisitor { return node } }, tree.namespaces.toSet()) @@ -245,7 +244,7 @@ class LazyMappingTree : AbstractMappingTree() { this.value += value } - fun visitPackage(names: Map): PackageVisitor? { + fun visitPackage(names: Map): PackageVisitor { tree.mergeNs(names.keys) this._names.putAll(names) val delegator = UMFWriter.UMFWriterDelegator(::append, true) diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/MemoryMappingTree.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/MemoryMappingTree.kt index 38765c4..d5fd9e5 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/MemoryMappingTree.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/MemoryMappingTree.kt @@ -1,14 +1,16 @@ package xyz.wagyourtail.unimined.mapping.tree import xyz.wagyourtail.unimined.mapping.Namespace -import xyz.wagyourtail.unimined.mapping.tree.node._class.ClassNode -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName +import xyz.wagyourtail.unimined.mapping.tree.node._class.ClassNode +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._package.PackageNode import xyz.wagyourtail.unimined.mapping.util.defaultedMapOf import xyz.wagyourtail.unimined.mapping.util.filterNotNullValues -import xyz.wagyourtail.unimined.mapping.visitor.* +import xyz.wagyourtail.unimined.mapping.visitor.ConstantGroupVisitor +import xyz.wagyourtail.unimined.mapping.visitor.MappingVisitor +import xyz.wagyourtail.unimined.mapping.visitor.PackageVisitor class MemoryMappingTree : AbstractMappingTree() { private val _namespaces = mutableListOf() @@ -86,7 +88,7 @@ class MemoryMappingTree : AbstractMappingTree() { } } - override fun visitPackage(names: Map): PackageVisitor? { + override fun visitPackage(names: Map): PackageVisitor { for (ns in namespaces.filter { it in names }) { // check if exists val existing = packages.firstOrNull { it.names[ns] == names[ns] } @@ -123,7 +125,7 @@ class MemoryMappingTree : AbstractMappingTree() { name: String?, baseNs: Namespace, namespaces: Set - ): ConstantGroupVisitor? { + ): ConstantGroupVisitor { val node = ConstantGroupNode(this, type, name, baseNs) node.addNamespaces(namespaces) _constantGroups.add(node) diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/MergedMappingTree.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/MergedMappingTree.kt index bb315a6..9fb21a9 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/MergedMappingTree.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/MergedMappingTree.kt @@ -143,7 +143,7 @@ class MergedMappingTree(val trees: List) : AbstractMappingT val visitor = object : ThrowingVisitor() { - override fun visitClass(names: Map): ClassVisitor? { + override fun visitClass(names: Map): ClassVisitor { cNode.setNames(names) return cNode } @@ -166,7 +166,7 @@ class MergedMappingTree(val trees: List) : AbstractMappingT val visitor = object : ThrowingVisitor() { - override fun visitPackage(names: Map): PackageVisitor? { + override fun visitPackage(names: Map): PackageVisitor { pNode.setNames(names) return pNode } diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/ReadOnlyMappingTree.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/ReadOnlyMappingTree.kt index a32e156..85eaac6 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/ReadOnlyMappingTree.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/ReadOnlyMappingTree.kt @@ -6,7 +6,10 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName import xyz.wagyourtail.unimined.mapping.tree.node._class.ClassNode import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._package.PackageNode -import xyz.wagyourtail.unimined.mapping.visitor.* +import xyz.wagyourtail.unimined.mapping.visitor.ClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.ConstantGroupVisitor +import xyz.wagyourtail.unimined.mapping.visitor.MappingVisitor +import xyz.wagyourtail.unimined.mapping.visitor.PackageVisitor class ReadOnlyMappingTree(val tree: AbstractMappingTree) : AbstractMappingTree() { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/AccessNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/AccessNode.kt index 56476cc..0928832 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/AccessNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/AccessNode.kt @@ -4,8 +4,10 @@ import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.jvms.ext.condition.AccessConditions import xyz.wagyourtail.unimined.mapping.jvms.four.AccessFlag -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateAccessVisitor +import xyz.wagyourtail.unimined.mapping.visitor.AccessParentVisitor +import xyz.wagyourtail.unimined.mapping.visitor.AccessType +import xyz.wagyourtail.unimined.mapping.visitor.AccessVisitor +import xyz.wagyourtail.unimined.mapping.visitor.EmptyAccessParentVisitor class AccessNode>(parent: BaseNode, val accessType: AccessType, val accessFlag: AccessFlag, val conditions: AccessConditions) : BaseNode(parent), AccessVisitor { private val _namespaces: MutableSet = mutableSetOf() diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/AnnotationNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/AnnotationNode.kt index 26ee771..9e392f2 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/AnnotationNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/AnnotationNode.kt @@ -3,9 +3,10 @@ package xyz.wagyourtail.unimined.mapping.tree.node import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.jvms.ext.annotation.Annotation -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateAccessVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateAnnotationVisitor +import xyz.wagyourtail.unimined.mapping.visitor.AnnotationParentVisitor +import xyz.wagyourtail.unimined.mapping.visitor.AnnotationType +import xyz.wagyourtail.unimined.mapping.visitor.AnnotationVisitor +import xyz.wagyourtail.unimined.mapping.visitor.EmptyAnnotationParentVisitor class AnnotationNode>(parent: BaseNode, val type: AnnotationType, val baseNs: Namespace, val annotation: Annotation) : BaseNode(parent), AnnotationVisitor { val _namespaces: MutableSet = mutableSetOf() diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/JavadocNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/JavadocNode.kt index b81468e..5a60743 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/JavadocNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/JavadocNode.kt @@ -2,8 +2,9 @@ package xyz.wagyourtail.unimined.mapping.tree.node import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter -import xyz.wagyourtail.unimined.mapping.tree.node._class.member.MemberNode -import xyz.wagyourtail.unimined.mapping.visitor.* +import xyz.wagyourtail.unimined.mapping.visitor.EmptyJavadocParentVisitor +import xyz.wagyourtail.unimined.mapping.visitor.JavadocParentNode +import xyz.wagyourtail.unimined.mapping.visitor.JavadocVisitor class JavadocNode>(parent: BaseNode, val value: String, val baseNs: Namespace) : BaseNode(parent), JavadocVisitor { val _namespaces: MutableSet = mutableSetOf() diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/SignatureNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/SignatureNode.kt index f363732..3b5735c 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/SignatureNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/SignatureNode.kt @@ -9,7 +9,9 @@ import xyz.wagyourtail.unimined.mapping.tree.node._class.ClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.FieldNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.MethodNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode -import xyz.wagyourtail.unimined.mapping.visitor.* +import xyz.wagyourtail.unimined.mapping.visitor.EmptySignatureParentVisitor +import xyz.wagyourtail.unimined.mapping.visitor.SignatureParentVisitor +import xyz.wagyourtail.unimined.mapping.visitor.SignatureVisitor class SignatureNode>(parent: BaseNode, val value: String, val baseNs: Namespace) : BaseNode(parent), SignatureVisitor { val _namespaces: MutableSet = mutableSetOf() diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/ClassNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/ClassNode.kt index 7af83c8..3664046 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/ClassNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/ClassNode.kt @@ -1,16 +1,16 @@ package xyz.wagyourtail.unimined.mapping.tree.node._class -import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.jvms.ext.FieldOrMethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.ext.FullyQualifiedName import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor +import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.tree.AbstractMappingTree -import xyz.wagyourtail.unimined.mapping.tree.node._class.member.FieldNode import xyz.wagyourtail.unimined.mapping.tree.node.LazyResolvables import xyz.wagyourtail.unimined.mapping.tree.node.SignatureNode +import xyz.wagyourtail.unimined.mapping.tree.node._class.member.FieldNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.MemberNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.MethodNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode @@ -69,7 +69,7 @@ class ClassNode(parent: AbstractMappingTree) : MemberNode): SignatureVisitor? { + override fun visitSignature(value: String, baseNs: Namespace, namespaces: Set): SignatureVisitor { val node = SignatureNode(this, value, baseNs) node.addNamespaces(namespaces) _signatures.add(node) @@ -98,7 +98,7 @@ class ClassNode(parent: AbstractMappingTree) : MemberNode> - ): InnerClassVisitor? { + ): InnerClassVisitor { // find existing val inner = if (type in inners) { inners.getValue(type) diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/InnerClassNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/InnerClassNode.kt index 35b5a2a..9109a52 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/InnerClassNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/InnerClassNode.kt @@ -4,10 +4,9 @@ import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.jvms.ext.FullyQualifiedName import xyz.wagyourtail.unimined.mapping.tree.node.AccessParentNode -import xyz.wagyourtail.unimined.mapping.util.filterNotNullValues -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateClassVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateInnerClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.ClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.EmptyClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.InnerClassVisitor class InnerClassNode(parent: ClassNode, val innerType: InnerType) : AccessParentNode(parent), InnerClassVisitor { private val _names: MutableMap = mutableMapOf() diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/AbstractFieldMethodNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/AbstractFieldMethodNode.kt index b51f29f..f6df3b9 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/AbstractFieldMethodNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/AbstractFieldMethodNode.kt @@ -1,12 +1,10 @@ package xyz.wagyourtail.unimined.mapping.tree.node._class.member import xyz.wagyourtail.unimined.mapping.Namespace -import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.jvms.ext.FieldOrMethodDescriptor import xyz.wagyourtail.unimined.mapping.tree.node._class.ClassNode -import xyz.wagyourtail.unimined.mapping.util.filterNotNullValues -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.ClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.MemberVisitor abstract class AbstractFieldMethodNode>(parent: ClassNode) : MemberNode(parent) { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/FieldMethodResolvable.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/FieldMethodResolvable.kt index 7ac95b6..c8352d3 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/FieldMethodResolvable.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/FieldMethodResolvable.kt @@ -1,12 +1,11 @@ package xyz.wagyourtail.unimined.mapping.tree.node._class.member -import xyz.wagyourtail.unimined.mapping.tree.MemoryMappingTree import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.jvms.ext.FieldOrMethodDescriptor +import xyz.wagyourtail.unimined.mapping.tree.MemoryMappingTree import xyz.wagyourtail.unimined.mapping.tree.node.LazyResolvableEntry import xyz.wagyourtail.unimined.mapping.tree.node._class.ClassNode import xyz.wagyourtail.unimined.mapping.visitor.MemberVisitor -import xyz.wagyourtail.unimined.mapping.visitor.SignatureParentVisitor abstract class FieldMethodResolvable, U: MemberVisitor>(parent: ClassNode, val create: (ClassNode) -> T) : AbstractFieldMethodNode(parent), LazyResolvableEntry { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/FieldNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/FieldNode.kt index 21a6a0d..737387d 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/FieldNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/FieldNode.kt @@ -6,8 +6,10 @@ import xyz.wagyourtail.unimined.mapping.jvms.ext.FieldOrMethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.tree.node.SignatureNode import xyz.wagyourtail.unimined.mapping.tree.node._class.ClassNode -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateFieldVisitor +import xyz.wagyourtail.unimined.mapping.visitor.ClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.EmptyClassVisitor +import xyz.wagyourtail.unimined.mapping.visitor.FieldVisitor +import xyz.wagyourtail.unimined.mapping.visitor.SignatureVisitor class FieldNode(parent: ClassNode): FieldMethodResolvable(parent, ::FieldNode), FieldVisitor { private val _signatures = mutableSetOf>() diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MemberNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MemberNode.kt index c2f7ebb..81859cb 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MemberNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MemberNode.kt @@ -2,7 +2,10 @@ package xyz.wagyourtail.unimined.mapping.tree.node._class.member import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.jvms.ext.annotation.Annotation -import xyz.wagyourtail.unimined.mapping.tree.node.* +import xyz.wagyourtail.unimined.mapping.tree.node.AccessParentNode +import xyz.wagyourtail.unimined.mapping.tree.node.AnnotationNode +import xyz.wagyourtail.unimined.mapping.tree.node.BaseNode +import xyz.wagyourtail.unimined.mapping.tree.node.JavadocNode import xyz.wagyourtail.unimined.mapping.visitor.* abstract class MemberNode, U: BaseVisitor>(parent: BaseNode) : AccessParentNode(parent), MemberVisitor { @@ -15,7 +18,7 @@ abstract class MemberNode, U: BaseVisitor>(parent: BaseNo override fun visitJavadoc(value: String, baseNs: Namespace, namespaces: Set): JavadocVisitor? { val node = JavadocNode(this, value, baseNs) node.addNamespaces(namespaces) - _comments?.add(node) + _comments.add(node) return node } diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MethodNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MethodNode.kt index afb49e5..a060f37 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MethodNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MethodNode.kt @@ -6,13 +6,11 @@ import xyz.wagyourtail.unimined.mapping.jvms.ext.FieldOrMethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.tree.node.SignatureNode -import xyz.wagyourtail.unimined.mapping.tree.node._class.member.method.ExceptionNode import xyz.wagyourtail.unimined.mapping.tree.node._class.ClassNode +import xyz.wagyourtail.unimined.mapping.tree.node._class.member.method.ExceptionNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.method.LocalNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.method.ParameterNode import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateFieldVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateMethodVisitor class MethodNode(parent: ClassNode) : FieldMethodResolvable(parent, ::MethodNode), MethodVisitor { private val _signatures = mutableSetOf>() @@ -33,14 +31,14 @@ class MethodNode(parent: ClassNode) : FieldMethodResolvable): SignatureVisitor? { + override fun visitSignature(value: String, baseNs: Namespace, namespaces: Set): SignatureVisitor { val node = SignatureNode(this, value, baseNs) node.addNamespaces(namespaces) _signatures.add(node) return node } - override fun visitParameter(index: Int?, lvOrd: Int?, names: Map): ParameterVisitor? { + override fun visitParameter(index: Int?, lvOrd: Int?, names: Map): ParameterVisitor { for (param in params) { if (index != null && param.index == index) { param.setNames(names) @@ -57,7 +55,7 @@ class MethodNode(parent: ClassNode) : FieldMethodResolvable): LocalVariableVisitor? { + override fun visitLocalVariable(lvOrd: Int, startOp: Int?, names: Map): LocalVariableVisitor { for (local in locals) { if (lvOrd == local.lvOrd && startOp == local.startOp) { local.setNames(names) @@ -75,7 +73,7 @@ class MethodNode(parent: ClassNode) : FieldMethodResolvable - ): ExceptionVisitor? { + ): ExceptionVisitor { val node = ExceptionNode(this, type, exception, baseNs) node.addNamespaces(namespaces) _exceptions.add(node) diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/WildcardNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/WildcardNode.kt index dcd5bd9..7c81400 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/WildcardNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/WildcardNode.kt @@ -7,8 +7,8 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.ElementType import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.tree.node.LazyResolvableEntry import xyz.wagyourtail.unimined.mapping.tree.node.SignatureNode -import xyz.wagyourtail.unimined.mapping.tree.node._class.member.method.ExceptionNode import xyz.wagyourtail.unimined.mapping.tree.node._class.ClassNode +import xyz.wagyourtail.unimined.mapping.tree.node._class.member.method.ExceptionNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.method.LocalNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.method.ParameterNode import xyz.wagyourtail.unimined.mapping.visitor.* @@ -45,7 +45,7 @@ class WildcardNode(parent: ClassNode, val type: WildcardType, descs: Map): SignatureVisitor? { + override fun visitSignature(value: String, baseNs: Namespace, namespaces: Set): SignatureVisitor { val node = SignatureNode(this, value, baseNs) node.addNamespaces(namespaces) _signatures.add(node) diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/ExceptionNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/ExceptionNode.kt index 6fc6cc7..c0b24a1 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/ExceptionNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/ExceptionNode.kt @@ -4,10 +4,10 @@ import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.tree.node.BaseNode -import xyz.wagyourtail.unimined.mapping.tree.node._class.member.MethodNode -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateExceptionVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateWildcardVisitor +import xyz.wagyourtail.unimined.mapping.visitor.EmptyMethodVisitor +import xyz.wagyourtail.unimined.mapping.visitor.ExceptionType +import xyz.wagyourtail.unimined.mapping.visitor.ExceptionVisitor +import xyz.wagyourtail.unimined.mapping.visitor.InvokableVisitor class ExceptionNode>(parent: BaseNode, val type: ExceptionType, val exception: InternalName, val baseNs: Namespace) : BaseNode(parent), ExceptionVisitor { private val _namespaces: MutableSet = mutableSetOf() diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/LocalNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/LocalNode.kt index c27c569..6ecebc7 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/LocalNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/LocalNode.kt @@ -4,10 +4,9 @@ import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.tree.node.BaseNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.MemberNode -import xyz.wagyourtail.unimined.mapping.tree.node._class.member.MethodNode -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateExceptionVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateLocalVariableVisitor +import xyz.wagyourtail.unimined.mapping.visitor.EmptyMethodVisitor +import xyz.wagyourtail.unimined.mapping.visitor.InvokableVisitor +import xyz.wagyourtail.unimined.mapping.visitor.LocalVariableVisitor class LocalNode>(parent: BaseNode, val lvOrd: Int, val startOp: Int?) : MemberNode(parent), LocalVariableVisitor { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/ParameterNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/ParameterNode.kt index d3dacad..48180c3 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/ParameterNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/method/ParameterNode.kt @@ -4,10 +4,9 @@ import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.tree.node.BaseNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.MemberNode -import xyz.wagyourtail.unimined.mapping.tree.node._class.member.MethodNode -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateExceptionVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateParameterVisitor +import xyz.wagyourtail.unimined.mapping.visitor.EmptyMethodVisitor +import xyz.wagyourtail.unimined.mapping.visitor.InvokableVisitor +import xyz.wagyourtail.unimined.mapping.visitor.ParameterVisitor class ParameterNode>(parent: BaseNode, val index: Int?, val lvOrd: Int?) : MemberNode(parent), ParameterVisitor { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/ConstantGroupNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/ConstantGroupNode.kt index 288bd54..9eba4af 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/ConstantGroupNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/ConstantGroupNode.kt @@ -1,16 +1,14 @@ package xyz.wagyourtail.unimined.mapping.tree.node._constant -import xyz.wagyourtail.unimined.mapping.jvms.ext.FullyQualifiedName -import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName -import xyz.wagyourtail.unimined.mapping.jvms.four.two.two.UnqualifiedName import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter +import xyz.wagyourtail.unimined.mapping.jvms.ext.FullyQualifiedName import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor +import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName +import xyz.wagyourtail.unimined.mapping.jvms.four.two.two.UnqualifiedName import xyz.wagyourtail.unimined.mapping.tree.AbstractMappingTree import xyz.wagyourtail.unimined.mapping.tree.node.BaseNode import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateConstantGroupVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateParameterVisitor class ConstantGroupNode(parent: AbstractMappingTree, val type: InlineType, val name: String?, val baseNs: Namespace) : BaseNode(parent), ConstantGroupVisitor { private val _namespaces: MutableSet = mutableSetOf() @@ -37,13 +35,13 @@ class ConstantGroupNode(parent: AbstractMappingTree, val type: InlineType, val n fieldClass: InternalName, fieldName: UnqualifiedName, fieldDesc: FieldDescriptor? - ): ConstantVisitor? { + ): ConstantVisitor { val node = ConstantNode(this, baseNs, fieldClass, fieldName, fieldDesc) _constants.add(node) return node } - override fun visitTarget(target: FullyQualifiedName, paramIdx: Int?): TargetVisitor? { + override fun visitTarget(target: FullyQualifiedName, paramIdx: Int?): TargetVisitor { val node = TargetNode(this, baseNs, target, paramIdx) _targets.add(node) return node diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/ConstantNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/ConstantNode.kt index cb574de..90416c8 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/ConstantNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/ConstantNode.kt @@ -10,9 +10,9 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.ObjectType import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.two.UnqualifiedName import xyz.wagyourtail.unimined.mapping.tree.node.BaseNode -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateConstantGroupVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateConstantVisitor +import xyz.wagyourtail.unimined.mapping.visitor.ConstantGroupVisitor +import xyz.wagyourtail.unimined.mapping.visitor.ConstantVisitor +import xyz.wagyourtail.unimined.mapping.visitor.EmptyConstantGroupVisitor class ConstantNode(parent: ConstantGroupNode, val baseNs: Namespace, val constClass: InternalName, val constName: UnqualifiedName, val fieldDesc: FieldDescriptor?) : BaseNode(parent), ConstantVisitor { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/TargetNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/TargetNode.kt index 59ef328..2c71ad1 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/TargetNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_constant/TargetNode.kt @@ -4,9 +4,9 @@ import xyz.wagyourtail.unimined.mapping.Namespace import xyz.wagyourtail.unimined.mapping.formats.umf.UMFWriter import xyz.wagyourtail.unimined.mapping.jvms.ext.FullyQualifiedName import xyz.wagyourtail.unimined.mapping.tree.node.BaseNode -import xyz.wagyourtail.unimined.mapping.visitor.* -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateConstantVisitor -import xyz.wagyourtail.unimined.mapping.visitor.delegate.DelegateTargetVisitor +import xyz.wagyourtail.unimined.mapping.visitor.ConstantGroupVisitor +import xyz.wagyourtail.unimined.mapping.visitor.EmptyConstantGroupVisitor +import xyz.wagyourtail.unimined.mapping.visitor.TargetVisitor class TargetNode(parent: ConstantGroupNode, val baseNs: Namespace, val target: FullyQualifiedName, val paramIdx: Int?) : BaseNode(parent), TargetVisitor { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_package/PackageNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_package/PackageNode.kt index c06baff..e68ab3c 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_package/PackageNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_package/PackageNode.kt @@ -44,7 +44,7 @@ class PackageNode(parent: AbstractMappingTree) : BaseNode - ): AnnotationVisitor? { + ): AnnotationVisitor { val node = AnnotationNode(this, type, baseNs, annotation) node.addNamespaces(namespaces) _annotations.add(node) @@ -52,7 +52,7 @@ class PackageNode(parent: AbstractMappingTree) : BaseNode): JavadocVisitor? { + override fun visitJavadoc(value: String, baseNs: Namespace, namespaces: Set): JavadocVisitor { val node = JavadocNode(this, value, baseNs) node.addNamespaces(namespaces) _comments.add(node) diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/BufferedSourceUtils.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/BufferedSourceUtils.kt index 7fe1b65..82e57cd 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/BufferedSourceUtils.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/BufferedSourceUtils.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.util -import okio.Buffer import okio.BufferedSource import okio.ByteString.Companion.encodeUtf8 import okio.use @@ -20,101 +19,3 @@ fun BufferedSource.isZip(): Boolean { } } } - -fun BufferedSource.takeWhitespace(): String { - return buildString { - while (!exhausted()) { - if (peek().readUtf8CodePoint().checkedToChar()?.isWhitespace() != true) { - break - } - appendCodePoint(readUtf8CodePoint()) - } - } -} - -fun BufferedSource.takeNext(): Pair { - takeWhitespace() - if (exhausted()) { - return TokenType.LITERAL to "" - } - val next = peek().readUtf8CodePoint().checkedToChar() - if (next == '"') { - return TokenType.STRING to takeString().let { - it.substring(1, it.length - 1).translateEscapes() - } - } - return TokenType.LITERAL to takeUTF8Until { it.checkedToChar()?.isWhitespace() == true } -} - -fun BufferedSource.takeRemainingOnLine(): List> { - val list = mutableListOf>() - while (!exhausted() && !peek().takeWhitespace().contains('\n')) { - list.add(takeNext()) - } - return list -} - -fun BufferedSource.expect(c: Char): Char { - val next = readUtf8CodePoint().checkedToChar() - if (next != c) { - throw IllegalArgumentException("Expected $c, found $next") - } - return next -} - -fun BufferedSource.expect(s: String) = buildString { - for (c in s) { - append(expect(c)) - } -} - -fun BufferedSource.takeLineAsBuffer(): BufferedSource { - return Buffer().also { - readUtf8Line()?.let { line -> - it.writeUtf8(line) - } - } -} - -inline fun BufferedSource.takeUTF8Until(condition: (Int) -> Boolean): String { - return buildString { - while (!exhausted()) { - val c = peek().readUtf8CodePoint() - if (condition(c)) { - break - } - appendCodePoint(readUtf8CodePoint()) - } - } -} - -/** - * reads an escaped string from the source - * " characters " - */ -fun BufferedSource.takeString(): String { - return buildString { - var c = readUtf8CodePoint() - if (c.checkedToChar() != '"') { - throw IllegalArgumentException("Expected \", found ${c.checkedToChar()}") - } - appendCodePoint(c) - var escapes = 0 - while (true) { - c = readUtf8CodePoint() - if (c == '"'.code && escapes == 0) { - appendCodePoint(c) - break - } - if (c == '\\'.code) { - escapes++ - } else { - escapes = 0 - } - appendCodePoint(c) - if (escapes == 2) { - escapes = 0 - } - } - } -} \ No newline at end of file diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/LazyMutable.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/LazyMutable.kt index d0f34ab..54bccd3 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/LazyMutable.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/LazyMutable.kt @@ -1,6 +1,5 @@ package xyz.wagyourtail.unimined.mapping.util -import kotlinx.coroutines.internal.synchronized import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/MustSet.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/MustSet.kt index 5cca4bf..ff32be5 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/MustSet.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/util/MustSet.kt @@ -1,7 +1,5 @@ package xyz.wagyourtail.unimined.mapping.util -import kotlinx.coroutines.InternalCoroutinesApi -import kotlinx.coroutines.internal.synchronized import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/EmptyMappingVisitor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/EmptyMappingVisitor.kt index 5e67c70..567119d 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/EmptyMappingVisitor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/EmptyMappingVisitor.kt @@ -11,9 +11,9 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName import xyz.wagyourtail.unimined.mapping.jvms.four.two.two.UnqualifiedName -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._class.InnerClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode open class EmptyBaseVisitor> : BaseVisitor { @@ -154,9 +154,7 @@ open class EmptyMethodVisitor : EmptyMemberVisitor(), SignaturePa } -open class EmptyFieldVisitor : EmptyMemberVisitor(), SignatureParentVisitor by EmptySignatureParentVisitor(), FieldVisitor { - -} +open class EmptyFieldVisitor : EmptyMemberVisitor(), SignatureParentVisitor by EmptySignatureParentVisitor(), FieldVisitor open class EmptyWildcardVisitor : EmptyMemberVisitor(), SignatureParentVisitor by EmptySignatureParentVisitor(), WildcardVisitor { override fun visitParameter(index: Int?, lvOrd: Int?, names: Map): ParameterVisitor? { @@ -178,33 +176,19 @@ open class EmptyWildcardVisitor : EmptyMemberVisitor(), Signatu } -open class EmptyParameterVisitor : EmptyMemberVisitor(), ParameterVisitor { - -} - -open class EmptyLocalVariableVisitor : EmptyMemberVisitor(), LocalVariableVisitor { - -} - -open class EmptyExceptionVisitor : EmptyBaseVisitor(), ExceptionVisitor { - -} - -open class EmptyJavadocVisitor : EmptyBaseVisitor(), JavadocVisitor { - -} +open class EmptyParameterVisitor : EmptyMemberVisitor(), ParameterVisitor -open class EmptySignatureVisitor : EmptyBaseVisitor(), SignatureVisitor { +open class EmptyLocalVariableVisitor : EmptyMemberVisitor(), LocalVariableVisitor -} +open class EmptyExceptionVisitor : EmptyBaseVisitor(), ExceptionVisitor -open class EmptyAccessVisitor : EmptyBaseVisitor(), AccessVisitor { +open class EmptyJavadocVisitor : EmptyBaseVisitor(), JavadocVisitor -} +open class EmptySignatureVisitor : EmptyBaseVisitor(), SignatureVisitor -open class EmptyAnnotationVisitor : EmptyBaseVisitor(), AnnotationVisitor { +open class EmptyAccessVisitor : EmptyBaseVisitor(), AccessVisitor -} +open class EmptyAnnotationVisitor : EmptyBaseVisitor(), AnnotationVisitor open class EmptyConstantGroupVisitor : EmptyBaseVisitor(), ConstantGroupVisitor { override fun visitConstant( @@ -221,14 +205,8 @@ open class EmptyConstantGroupVisitor : EmptyBaseVisitor(), } -open class EmptyConstantVisitor : EmptyBaseVisitor(), ConstantVisitor { +open class EmptyConstantVisitor : EmptyBaseVisitor(), ConstantVisitor -} - -open class EmptyTargetVisitor : EmptyBaseVisitor(), TargetVisitor { - -} - -open class EmptyInnerClassVisitor : EmptyBaseVisitor(), AccessParentVisitor by EmptyAccessParentVisitor(), InnerClassVisitor { +open class EmptyTargetVisitor : EmptyBaseVisitor(), TargetVisitor -} +open class EmptyInnerClassVisitor : EmptyBaseVisitor(), AccessParentVisitor by EmptyAccessParentVisitor(), InnerClassVisitor diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/MappingVisitor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/MappingVisitor.kt index e4fa119..a884d96 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/MappingVisitor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/MappingVisitor.kt @@ -1,20 +1,19 @@ package xyz.wagyourtail.unimined.mapping.visitor -import okio.BufferedSink +import xyz.wagyourtail.unimined.mapping.Namespace +import xyz.wagyourtail.unimined.mapping.jvms.ext.FieldOrMethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.ext.FullyQualifiedName import xyz.wagyourtail.unimined.mapping.jvms.ext.annotation.Annotation +import xyz.wagyourtail.unimined.mapping.jvms.ext.condition.AccessConditions import xyz.wagyourtail.unimined.mapping.jvms.four.AccessFlag import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName -import xyz.wagyourtail.unimined.mapping.Namespace -import xyz.wagyourtail.unimined.mapping.jvms.ext.FieldOrMethodDescriptor -import xyz.wagyourtail.unimined.mapping.jvms.ext.condition.AccessConditions import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName import xyz.wagyourtail.unimined.mapping.jvms.four.two.two.UnqualifiedName -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._class.InnerClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.util.Scoped interface BaseVisitor> { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/DelegateVisitor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/DelegateVisitor.kt index b0da76c..9f26570 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/DelegateVisitor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/DelegateVisitor.kt @@ -11,9 +11,9 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName import xyz.wagyourtail.unimined.mapping.jvms.four.two.two.UnqualifiedName -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._class.InnerClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.visitor.* open class Delegator(delegator: Delegator? = null) { @@ -304,9 +304,7 @@ open class Delegator(delegator: Delegator? = null) { } -abstract class DelegateBaseVisitor>(val delegate: T, val delegator: Delegator) : BaseVisitor { - -} +abstract class DelegateBaseVisitor>(val delegate: T, val delegator: Delegator) : BaseVisitor open class DelegateMappingVisitor(delegate: MappingVisitor, delegator: Delegator) : DelegateBaseVisitor(delegate, delegator), MappingVisitor { override fun nextUnnamedNs(): Namespace { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/MultiVisitor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/MultiVisitor.kt index 16591a3..d76ca64 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/MultiVisitor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/MultiVisitor.kt @@ -181,9 +181,7 @@ open class MultiMethodVisitor(visitors: List): MultiMemberVisitor } -open class MultiFieldVisitor(visitors: List): MultiMemberVisitor(visitors), FieldVisitor, SignatureParentVisitor by MultiSignatureParentVisitor(visitors) { - -} +open class MultiFieldVisitor(visitors: List): MultiMemberVisitor(visitors), FieldVisitor, SignatureParentVisitor by MultiSignatureParentVisitor(visitors) open class MultiWildcardVisitor(visitors: List): MultiMemberVisitor(visitors), WildcardVisitor, SignatureParentVisitor by MultiSignatureParentVisitor(visitors) { override fun visitParameter(index: Int?, lvOrd: Int?, names: Map): ParameterVisitor? { @@ -211,33 +209,19 @@ open class MultiWildcardVisitor(visitors: List): MultiMemberVis } -open class MultiParameterVisitor(visitors: List): MultiMemberVisitor(visitors), ParameterVisitor { - -} - -open class MultiLocalVariableVisitor(visitors: List): MultiMemberVisitor(visitors), LocalVariableVisitor { - -} - -open class MultiExceptionVisitor(visitors: List): MultiBaseVisitor(visitors), ExceptionVisitor { - -} - -open class MultiJavadocVisitor(visitors: List): MultiBaseVisitor(visitors), JavadocVisitor { +open class MultiParameterVisitor(visitors: List): MultiMemberVisitor(visitors), ParameterVisitor -} - -open class MultiSignatureVisitor(visitors: List): MultiBaseVisitor(visitors), SignatureVisitor { +open class MultiLocalVariableVisitor(visitors: List): MultiMemberVisitor(visitors), LocalVariableVisitor -} +open class MultiExceptionVisitor(visitors: List): MultiBaseVisitor(visitors), ExceptionVisitor -open class MultiAccessVisitor(visitors: List): MultiBaseVisitor(visitors), AccessVisitor { +open class MultiJavadocVisitor(visitors: List): MultiBaseVisitor(visitors), JavadocVisitor -} +open class MultiSignatureVisitor(visitors: List): MultiBaseVisitor(visitors), SignatureVisitor -open class MultiAnnotationVisitor(visitors: List): MultiBaseVisitor(visitors), AnnotationVisitor { +open class MultiAccessVisitor(visitors: List): MultiBaseVisitor(visitors), AccessVisitor -} +open class MultiAnnotationVisitor(visitors: List): MultiBaseVisitor(visitors), AnnotationVisitor open class MultiConstantGroupVisitor(visitors: List): MultiBaseVisitor(visitors), ConstantGroupVisitor { override fun visitConstant( @@ -258,15 +242,9 @@ open class MultiConstantGroupVisitor(visitors: List): Mult } -open class MultiConstantVisitor(visitors: List): MultiBaseVisitor(visitors), ConstantVisitor { +open class MultiConstantVisitor(visitors: List): MultiBaseVisitor(visitors), ConstantVisitor -} +open class MultiTargetVisitor(visitors: List): MultiBaseVisitor(visitors), TargetVisitor -open class MultiTargetVisitor(visitors: List): MultiBaseVisitor(visitors), TargetVisitor { - -} - -open class MultiInnerClassVisitor(visitors: List): MultiAccessParentVisitor(visitors), InnerClassVisitor { - -} +open class MultiInnerClassVisitor(visitors: List): MultiAccessParentVisitor(visitors), InnerClassVisitor diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NamespaceRecordingVisitor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NamespaceRecordingVisitor.kt index 259724a..6f954c0 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NamespaceRecordingVisitor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NamespaceRecordingVisitor.kt @@ -10,9 +10,9 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._class.InnerClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.visitor.* fun MappingVisitor.recordNamespaces(recorder: (Set) -> Unit): MappingVisitor { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NsFilteredVisitor.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NsFilteredVisitor.kt index c70f479..0022398 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NsFilteredVisitor.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NsFilteredVisitor.kt @@ -10,9 +10,9 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._class.InnerClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.visitor.* fun MappingVisitor.nsFiltered(vararg ns: String, inverted: Boolean = false) = nsFiltered(ns.map { Namespace(it) }.toSet(), inverted) diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NullDelegator.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NullDelegator.kt index 0fb4cad..53886ab 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NullDelegator.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/NullDelegator.kt @@ -11,9 +11,9 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName import xyz.wagyourtail.unimined.mapping.jvms.four.two.two.UnqualifiedName -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._class.InnerClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.visitor.* open class NullDelegator : Delegator() { diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/Visitors.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/Visitors.kt index 9f42fc1..44cf98f 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/Visitors.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/visitor/delegate/Visitors.kt @@ -10,9 +10,9 @@ import xyz.wagyourtail.unimined.mapping.jvms.four.three.three.MethodDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.three.two.FieldDescriptor import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.InternalName import xyz.wagyourtail.unimined.mapping.jvms.four.two.one.PackageName -import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.tree.node._class.InnerClassNode import xyz.wagyourtail.unimined.mapping.tree.node._class.member.WildcardNode +import xyz.wagyourtail.unimined.mapping.tree.node._constant.ConstantGroupNode import xyz.wagyourtail.unimined.mapping.visitor.* fun MappingVisitor.delegator(delegator: Delegator) = DelegateMappingVisitor(this, delegator)