less debug noise
This commit is contained in:
1 parent
f45310f7d9
commit
202e70a99a
6 files changed
+26
-13
No files matched your search
@@ -65,7 +65,6 @@ open class LynonDecoder(val bin: BitInput, val settings: LynonSettings = LynonSe
|
||||
|
||||
private suspend fun decodeClassObj(scope: Scope): ObjClass {
|
||||
val className = decodeObject(scope, ObjString.type, null) as ObjString
|
||||
println("expected class name $className")
|
||||
return scope.get(className.value)?.value?.let {
|
||||
if (it !is ObjClass)
|
||||
scope.raiseClassCastError("Expected obj class but got ${it::class.simpleName}")
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.sergeych.lyng.obj.ObjString
|
||||
|
||||
object ObjLynonClass : ObjClass("Lynon") {
|
||||
|
||||
suspend fun encodeAny(scope: Scope, obj: Obj): Obj {
|
||||
suspend fun encodeAny(scope: Scope, obj: Obj): ObjBitBuffer {
|
||||
val bout = MemoryBitOutput()
|
||||
val serializer = LynonEncoder(bout)
|
||||
serializer.encodeAny(scope, obj)
|
||||
@@ -51,4 +51,18 @@ object ObjLynonClass : ObjClass("Lynon") {
|
||||
decodeAny(this, requireOnlyArg<Obj>())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
suspend fun lynonEncodeAny(scope: Scope, value: Obj): UByteArray =
|
||||
(ObjLynonClass.encodeAny(scope, value))
|
||||
.bitArray.asUbyteArray()
|
||||
|
||||
@Suppress("unused")
|
||||
suspend fun lynonDecodeAny(scope: Scope, encoded: UByteArray): Obj =
|
||||
ObjLynonClass.decodeAny(
|
||||
scope,
|
||||
ObjBitBuffer(
|
||||
BitArray(encoded, 8)
|
||||
)
|
||||
)
|
||||
Reference in new issue
Block a user