Skip to content

Commit

Permalink
fix namespace visiting
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Aug 11, 2024
1 parent 143ed13 commit 8de4b7c
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ 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.DelegatePackageVisitor
import xyz.wagyourtail.unimined.mapping.visitor.delegate.NamespaceRecordingDelegate

/**
* for memory limited environments
Expand Down Expand Up @@ -198,8 +199,10 @@ class LazyMappingTree : AbstractMappingTree() {
tree.mergeNs(names.keys)
this._names.putAll(names)
val delegator = UMFWriter.UMFWriterDelegator(::append, true)
delegator.namespaces = tree.namespaces.toList()
return DelegateClassVisitor(EmptyClassVisitor(), delegator)
return DelegateClassVisitor(DelegateClassVisitor(EmptyClassVisitor(), delegator), NamespaceRecordingDelegate {
tree.mergeNs(it)
delegator.namespaces = tree.namespaces.toList()
})
}

fun resolve(): ClassNode {
Expand Down Expand Up @@ -244,8 +247,10 @@ class LazyMappingTree : AbstractMappingTree() {
tree.mergeNs(names.keys)
this._names.putAll(names)
val delegator = UMFWriter.UMFWriterDelegator(::append, true)
delegator.namespaces = tree.namespaces.toList()
return DelegatePackageVisitor(EmptyPackageVisitor(), delegator)
return DelegatePackageVisitor(DelegatePackageVisitor(EmptyPackageVisitor(), delegator), NamespaceRecordingDelegate {
tree.mergeNs(it)
delegator.namespaces = tree.namespaces.toList()
})
}

fun resolve(): PackageNode {
Expand Down

0 comments on commit 8de4b7c

Please sign in to comment.