@@ -6,6 +6,7 @@ import at.petrak.hexcasting.api.spell.SpellList
66import at.petrak.hexcasting.api.spell.casting.CastingHarness
77import at.petrak.hexcasting.api.spell.casting.CastingHarness.CastResult
88import at.petrak.hexcasting.api.spell.casting.ResolvedPatternType
9+ import at.petrak.hexcasting.api.spell.casting.SpecialPatterns
910import at.petrak.hexcasting.api.spell.casting.eval.*
1011import at.petrak.hexcasting.api.spell.casting.eval.SpellContinuation.Done
1112import at.petrak.hexcasting.api.spell.casting.eval.SpellContinuation.NotDone
@@ -23,6 +24,7 @@ import gay.`object`.hexdebug.casting.eval.*
2324import gay.`object`.hexdebug.debugger.allocators.SourceAllocator
2425import gay.`object`.hexdebug.debugger.allocators.VariablesAllocator
2526import gay.`object`.hexdebug.utils.ceilToPow
27+ import net.minecraft.network.chat.Component
2628import net.minecraft.server.level.ServerLevel
2729import net.minecraft.sounds.SoundSource
2830import net.minecraft.world.level.gameevent.GameEvent
@@ -671,11 +673,7 @@ class HexDebugger(
671673 }
672674
673675 private fun iotaToString (iota : Iota , isSource : Boolean = false): String = when (iota) {
674- is PatternIota -> try {
675- PatternRegistry .matchPattern(iota.pattern, vm.ctx.world).displayName
676- } catch (e: MishapInvalidPattern ) {
677- PatternNameHelper .representationForPattern(iota.pattern)
678- }.string
676+ is PatternIota -> patternToString(iota.pattern, isSource).string
679677
680678 else -> {
681679 val result = when (iota) {
@@ -690,6 +688,21 @@ class HexDebugger(
690688 }
691689 }
692690 }
691+
692+ private fun patternToString (pattern : HexPattern , isSource : Boolean = false): Component {
693+ if (isSource) {
694+ when (pattern) {
695+ SpecialPatterns .INTROSPECTION -> return Component .literal(" {" )
696+ SpecialPatterns .RETROSPECTION -> return Component .literal(" }" )
697+ else -> {}
698+ }
699+ }
700+ return try {
701+ PatternRegistry .matchPattern(pattern, vm.ctx.world).displayName
702+ } catch (e: MishapInvalidPattern ) {
703+ PatternNameHelper .representationForPattern(pattern)
704+ }
705+ }
693706}
694707
695708val SpellContinuation .frame get() = (this as ? NotDone )?.frame
0 commit comments