Compare commits
No commits in common. "104fd6b517a81bf9190dd4e0c2fc0e94249f5379" and "f2b99fe23bcf88832241477ea1e662186f86dd29" have entirely different histories.
104fd6b517
...
f2b99fe23b
@ -2247,7 +2247,7 @@ class Compiler(
|
|||||||
throw ScriptError(cc.currentPos(), "try block must have either catch or finally clause or both")
|
throw ScriptError(cc.currentPos(), "try block must have either catch or finally clause or both")
|
||||||
|
|
||||||
val stmtPos = body.pos
|
val stmtPos = body.pos
|
||||||
val tryStatement = object : Statement() {
|
return object : Statement() {
|
||||||
override val pos: Pos = stmtPos
|
override val pos: Pos = stmtPos
|
||||||
override suspend fun execute(scope: Scope): Obj {
|
override suspend fun execute(scope: Scope): Obj {
|
||||||
var result: Obj = ObjVoid
|
var result: Obj = ObjVoid
|
||||||
@ -2296,7 +2296,6 @@ class Compiler(
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TryStatement(tryStatement, stmtPos)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parseEnumDeclaration(isExtern: Boolean = false): Statement {
|
private fun parseEnumDeclaration(isExtern: Boolean = false): Statement {
|
||||||
|
|||||||
@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2026 Sergey S. Chernov
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package net.sergeych.lyng
|
|
||||||
|
|
||||||
import net.sergeych.lyng.obj.Obj
|
|
||||||
|
|
||||||
class TryStatement(
|
|
||||||
private val delegate: Statement,
|
|
||||||
private val startPos: Pos,
|
|
||||||
) : Statement() {
|
|
||||||
override val pos: Pos = startPos
|
|
||||||
|
|
||||||
override suspend fun execute(scope: Scope): Obj {
|
|
||||||
return delegate.execute(scope)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -78,23 +78,6 @@ class BytecodeCompiler(
|
|||||||
is VarDeclStatement -> compileVarDecl(name, stmt)
|
is VarDeclStatement -> compileVarDecl(name, stmt)
|
||||||
is net.sergeych.lyng.ThrowStatement -> compileThrowStatement(name, stmt)
|
is net.sergeych.lyng.ThrowStatement -> compileThrowStatement(name, stmt)
|
||||||
is net.sergeych.lyng.ExtensionPropertyDeclStatement -> compileExtensionPropertyDecl(name, stmt)
|
is net.sergeych.lyng.ExtensionPropertyDeclStatement -> compileExtensionPropertyDecl(name, stmt)
|
||||||
is net.sergeych.lyng.TryStatement -> {
|
|
||||||
val value = emitStatementEval(stmt)
|
|
||||||
builder.emit(Opcode.RET, value.slot)
|
|
||||||
val localCount = maxOf(nextSlot, value.slot + 1) - scopeSlotCount
|
|
||||||
builder.build(
|
|
||||||
name,
|
|
||||||
localCount,
|
|
||||||
addrCount = nextAddrSlot,
|
|
||||||
returnLabels = returnLabels,
|
|
||||||
scopeSlotDepths,
|
|
||||||
scopeSlotIndices,
|
|
||||||
scopeSlotNames,
|
|
||||||
localSlotNames,
|
|
||||||
localSlotMutables,
|
|
||||||
localSlotDepths
|
|
||||||
)
|
|
||||||
}
|
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -217,7 +200,6 @@ class BytecodeCompiler(
|
|||||||
is AssignOpRef -> compileAssignOp(ref) ?: compileEvalRef(ref)
|
is AssignOpRef -> compileAssignOp(ref) ?: compileEvalRef(ref)
|
||||||
is AssignIfNullRef -> compileAssignIfNull(ref)
|
is AssignIfNullRef -> compileAssignIfNull(ref)
|
||||||
is IncDecRef -> compileIncDec(ref, true)
|
is IncDecRef -> compileIncDec(ref, true)
|
||||||
is RangeRef -> compileRangeRef(ref)
|
|
||||||
is ConditionalRef -> compileConditional(ref)
|
is ConditionalRef -> compileConditional(ref)
|
||||||
is ElvisRef -> compileElvis(ref)
|
is ElvisRef -> compileElvis(ref)
|
||||||
is CallRef -> compileCall(ref)
|
is CallRef -> compileCall(ref)
|
||||||
@ -315,7 +297,12 @@ class BytecodeCompiler(
|
|||||||
builder.emit(Opcode.NEG_REAL, a.slot, out)
|
builder.emit(Opcode.NEG_REAL, a.slot, out)
|
||||||
CompiledValue(out, SlotType.REAL)
|
CompiledValue(out, SlotType.REAL)
|
||||||
}
|
}
|
||||||
else -> compileEvalRef(ref)
|
else -> {
|
||||||
|
val obj = ensureObjSlot(a)
|
||||||
|
val methodId = builder.addConst(BytecodeConst.StringVal("negate"))
|
||||||
|
builder.emit(Opcode.CALL_VIRTUAL, obj.slot, methodId, 0, 0, out)
|
||||||
|
CompiledValue(out, SlotType.OBJ)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
UnaryOp.NOT -> {
|
UnaryOp.NOT -> {
|
||||||
when (a.type) {
|
when (a.type) {
|
||||||
@ -325,7 +312,13 @@ class BytecodeCompiler(
|
|||||||
builder.emit(Opcode.INT_TO_BOOL, a.slot, tmp)
|
builder.emit(Opcode.INT_TO_BOOL, a.slot, tmp)
|
||||||
builder.emit(Opcode.NOT_BOOL, tmp, out)
|
builder.emit(Opcode.NOT_BOOL, tmp, out)
|
||||||
}
|
}
|
||||||
SlotType.OBJ, SlotType.UNKNOWN -> return compileEvalRef(ref)
|
SlotType.OBJ, SlotType.UNKNOWN -> {
|
||||||
|
val obj = ensureObjSlot(a)
|
||||||
|
val methodId = builder.addConst(BytecodeConst.StringVal("logicalNot"))
|
||||||
|
val tmpObj = allocSlot()
|
||||||
|
builder.emit(Opcode.CALL_VIRTUAL, obj.slot, methodId, 0, 0, tmpObj)
|
||||||
|
builder.emit(Opcode.OBJ_TO_BOOL, tmpObj, out)
|
||||||
|
}
|
||||||
else -> return null
|
else -> return null
|
||||||
}
|
}
|
||||||
CompiledValue(out, SlotType.BOOL)
|
CompiledValue(out, SlotType.BOOL)
|
||||||
@ -335,7 +328,10 @@ class BytecodeCompiler(
|
|||||||
builder.emit(Opcode.INV_INT, a.slot, out)
|
builder.emit(Opcode.INV_INT, a.slot, out)
|
||||||
return CompiledValue(out, SlotType.INT)
|
return CompiledValue(out, SlotType.INT)
|
||||||
}
|
}
|
||||||
return compileEvalRef(ref)
|
val obj = ensureObjSlot(a)
|
||||||
|
val methodId = builder.addConst(BytecodeConst.StringVal("bitNot"))
|
||||||
|
builder.emit(Opcode.CALL_VIRTUAL, obj.slot, methodId, 0, 0, out)
|
||||||
|
CompiledValue(out, SlotType.OBJ)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1217,34 +1213,6 @@ class BytecodeCompiler(
|
|||||||
return CompiledValue(dst, SlotType.OBJ)
|
return CompiledValue(dst, SlotType.OBJ)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun compileRangeRef(ref: RangeRef): CompiledValue? {
|
|
||||||
val startSlot = if (ref.left != null) {
|
|
||||||
val start = compileRefWithFallback(ref.left, null, Pos.builtIn) ?: return null
|
|
||||||
ensureObjSlot(start).slot
|
|
||||||
} else {
|
|
||||||
val slot = allocSlot()
|
|
||||||
builder.emit(Opcode.CONST_NULL, slot)
|
|
||||||
updateSlotType(slot, SlotType.OBJ)
|
|
||||||
slot
|
|
||||||
}
|
|
||||||
val endSlot = if (ref.right != null) {
|
|
||||||
val end = compileRefWithFallback(ref.right, null, Pos.builtIn) ?: return null
|
|
||||||
ensureObjSlot(end).slot
|
|
||||||
} else {
|
|
||||||
val slot = allocSlot()
|
|
||||||
builder.emit(Opcode.CONST_NULL, slot)
|
|
||||||
updateSlotType(slot, SlotType.OBJ)
|
|
||||||
slot
|
|
||||||
}
|
|
||||||
val inclusiveSlot = allocSlot()
|
|
||||||
val inclusiveId = builder.addConst(BytecodeConst.Bool(ref.isEndInclusive))
|
|
||||||
builder.emit(Opcode.CONST_BOOL, inclusiveId, inclusiveSlot)
|
|
||||||
val dst = allocSlot()
|
|
||||||
builder.emit(Opcode.MAKE_RANGE, startSlot, endSlot, inclusiveSlot, dst)
|
|
||||||
updateSlotType(dst, SlotType.OBJ)
|
|
||||||
return CompiledValue(dst, SlotType.OBJ)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun compileAssignOpBinary(
|
private fun compileAssignOpBinary(
|
||||||
targetType: SlotType,
|
targetType: SlotType,
|
||||||
rhs: CompiledValue,
|
rhs: CompiledValue,
|
||||||
@ -1297,17 +1265,16 @@ class BytecodeCompiler(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun compileIncDec(ref: IncDecRef, wantResult: Boolean): CompiledValue? {
|
private fun compileIncDec(ref: IncDecRef, wantResult: Boolean): CompiledValue? {
|
||||||
val target = ref.target as? LocalSlotRef
|
val target = ref.target as? LocalSlotRef ?: return null
|
||||||
if (target != null) {
|
if (!allowLocalSlots) return null
|
||||||
if (!allowLocalSlots) return null
|
if (!target.isMutable || target.isDelegated) return null
|
||||||
if (!target.isMutable || target.isDelegated) return null
|
val slot = resolveSlot(target) ?: return null
|
||||||
val slot = resolveSlot(target) ?: return null
|
val slotType = slotTypes[slot] ?: SlotType.UNKNOWN
|
||||||
val slotType = slotTypes[slot] ?: SlotType.UNKNOWN
|
if (slot < scopeSlotCount && slotType != SlotType.UNKNOWN) {
|
||||||
if (slot < scopeSlotCount && slotType != SlotType.UNKNOWN) {
|
val addrSlot = ensureScopeAddr(slot)
|
||||||
val addrSlot = ensureScopeAddr(slot)
|
val current = allocSlot()
|
||||||
val current = allocSlot()
|
emitLoadFromAddr(addrSlot, current, slotType)
|
||||||
emitLoadFromAddr(addrSlot, current, slotType)
|
val result = when (slotType) {
|
||||||
val result = when (slotType) {
|
|
||||||
SlotType.INT -> {
|
SlotType.INT -> {
|
||||||
if (wantResult && ref.isPost) {
|
if (wantResult && ref.isPost) {
|
||||||
val old = allocSlot()
|
val old = allocSlot()
|
||||||
@ -1365,9 +1332,9 @@ class BytecodeCompiler(
|
|||||||
}
|
}
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
if (result != null) return result
|
if (result != null) return result
|
||||||
}
|
}
|
||||||
return when (slotType) {
|
return when (slotType) {
|
||||||
SlotType.INT -> {
|
SlotType.INT -> {
|
||||||
if (wantResult && ref.isPost) {
|
if (wantResult && ref.isPost) {
|
||||||
val old = allocSlot()
|
val old = allocSlot()
|
||||||
@ -1439,32 +1406,8 @@ class BytecodeCompiler(
|
|||||||
CompiledValue(result, SlotType.OBJ)
|
CompiledValue(result, SlotType.OBJ)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> null
|
else -> null
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val indexTarget = ref.target as? IndexRef ?: return null
|
|
||||||
if (indexTarget.optionalRef) return null
|
|
||||||
val receiver = compileRefWithFallback(indexTarget.targetRef, null, Pos.builtIn) ?: return null
|
|
||||||
val index = compileRefWithFallback(indexTarget.indexRef, null, Pos.builtIn) ?: return null
|
|
||||||
val current = allocSlot()
|
|
||||||
builder.emit(Opcode.GET_INDEX, receiver.slot, index.slot, current)
|
|
||||||
updateSlotType(current, SlotType.OBJ)
|
|
||||||
val oneSlot = allocSlot()
|
|
||||||
val oneId = builder.addConst(BytecodeConst.ObjRef(ObjInt.One))
|
|
||||||
builder.emit(Opcode.CONST_OBJ, oneId, oneSlot)
|
|
||||||
val result = allocSlot()
|
|
||||||
val op = if (ref.isIncrement) Opcode.ADD_OBJ else Opcode.SUB_OBJ
|
|
||||||
if (wantResult && ref.isPost) {
|
|
||||||
val old = allocSlot()
|
|
||||||
builder.emit(Opcode.MOVE_OBJ, current, old)
|
|
||||||
builder.emit(op, current, oneSlot, result)
|
|
||||||
builder.emit(Opcode.SET_INDEX, receiver.slot, index.slot, result)
|
|
||||||
return CompiledValue(old, SlotType.OBJ)
|
|
||||||
}
|
|
||||||
builder.emit(op, current, oneSlot, result)
|
|
||||||
builder.emit(Opcode.SET_INDEX, receiver.slot, index.slot, result)
|
|
||||||
return CompiledValue(result, SlotType.OBJ)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun compileConditional(ref: ConditionalRef): CompiledValue? {
|
private fun compileConditional(ref: ConditionalRef): CompiledValue? {
|
||||||
@ -1882,7 +1825,6 @@ class BytecodeCompiler(
|
|||||||
is net.sergeych.lyng.ClassDeclStatement -> emitStatementEval(target)
|
is net.sergeych.lyng.ClassDeclStatement -> emitStatementEval(target)
|
||||||
is net.sergeych.lyng.FunctionDeclStatement -> emitStatementEval(target)
|
is net.sergeych.lyng.FunctionDeclStatement -> emitStatementEval(target)
|
||||||
is net.sergeych.lyng.EnumDeclStatement -> emitStatementEval(target)
|
is net.sergeych.lyng.EnumDeclStatement -> emitStatementEval(target)
|
||||||
is net.sergeych.lyng.TryStatement -> emitStatementEval(target)
|
|
||||||
is net.sergeych.lyng.BreakStatement -> compileBreak(target)
|
is net.sergeych.lyng.BreakStatement -> compileBreak(target)
|
||||||
is net.sergeych.lyng.ContinueStatement -> compileContinue(target)
|
is net.sergeych.lyng.ContinueStatement -> compileContinue(target)
|
||||||
is net.sergeych.lyng.ReturnStatement -> compileReturn(target)
|
is net.sergeych.lyng.ReturnStatement -> compileReturn(target)
|
||||||
|
|||||||
@ -105,7 +105,6 @@ class BytecodeStatement private constructor(
|
|||||||
is net.sergeych.lyng.ClassDeclStatement -> false
|
is net.sergeych.lyng.ClassDeclStatement -> false
|
||||||
is net.sergeych.lyng.FunctionDeclStatement -> false
|
is net.sergeych.lyng.FunctionDeclStatement -> false
|
||||||
is net.sergeych.lyng.EnumDeclStatement -> false
|
is net.sergeych.lyng.EnumDeclStatement -> false
|
||||||
is net.sergeych.lyng.TryStatement -> false
|
|
||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -182,8 +182,6 @@ class CmdBuilder {
|
|||||||
listOf(OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT)
|
listOf(OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT)
|
||||||
Opcode.SET_INDEX ->
|
Opcode.SET_INDEX ->
|
||||||
listOf(OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT)
|
listOf(OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT)
|
||||||
Opcode.MAKE_RANGE ->
|
|
||||||
listOf(OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT)
|
|
||||||
Opcode.LIST_LITERAL ->
|
Opcode.LIST_LITERAL ->
|
||||||
listOf(OperandKind.CONST, OperandKind.SLOT, OperandKind.COUNT, OperandKind.SLOT)
|
listOf(OperandKind.CONST, OperandKind.SLOT, OperandKind.COUNT, OperandKind.SLOT)
|
||||||
Opcode.GET_THIS_MEMBER ->
|
Opcode.GET_THIS_MEMBER ->
|
||||||
@ -227,7 +225,6 @@ class CmdBuilder {
|
|||||||
Opcode.BOX_OBJ -> CmdBoxObj(operands[0], operands[1])
|
Opcode.BOX_OBJ -> CmdBoxObj(operands[0], operands[1])
|
||||||
Opcode.OBJ_TO_BOOL -> CmdObjToBool(operands[0], operands[1])
|
Opcode.OBJ_TO_BOOL -> CmdObjToBool(operands[0], operands[1])
|
||||||
Opcode.RANGE_INT_BOUNDS -> CmdRangeIntBounds(operands[0], operands[1], operands[2], operands[3])
|
Opcode.RANGE_INT_BOUNDS -> CmdRangeIntBounds(operands[0], operands[1], operands[2], operands[3])
|
||||||
Opcode.MAKE_RANGE -> CmdMakeRange(operands[0], operands[1], operands[2], operands[3])
|
|
||||||
Opcode.CHECK_IS -> CmdCheckIs(operands[0], operands[1], operands[2])
|
Opcode.CHECK_IS -> CmdCheckIs(operands[0], operands[1], operands[2])
|
||||||
Opcode.ASSERT_IS -> CmdAssertIs(operands[0], operands[1])
|
Opcode.ASSERT_IS -> CmdAssertIs(operands[0], operands[1])
|
||||||
Opcode.RET_LABEL -> CmdRetLabel(operands[0], operands[1])
|
Opcode.RET_LABEL -> CmdRetLabel(operands[0], operands[1])
|
||||||
|
|||||||
@ -72,7 +72,6 @@ object CmdDisassembler {
|
|||||||
is CmdCheckIs -> Opcode.CHECK_IS to intArrayOf(cmd.objSlot, cmd.typeSlot, cmd.dst)
|
is CmdCheckIs -> Opcode.CHECK_IS to intArrayOf(cmd.objSlot, cmd.typeSlot, cmd.dst)
|
||||||
is CmdAssertIs -> Opcode.ASSERT_IS to intArrayOf(cmd.objSlot, cmd.typeSlot)
|
is CmdAssertIs -> Opcode.ASSERT_IS to intArrayOf(cmd.objSlot, cmd.typeSlot)
|
||||||
is CmdRangeIntBounds -> Opcode.RANGE_INT_BOUNDS to intArrayOf(cmd.src, cmd.startSlot, cmd.endSlot, cmd.okSlot)
|
is CmdRangeIntBounds -> Opcode.RANGE_INT_BOUNDS to intArrayOf(cmd.src, cmd.startSlot, cmd.endSlot, cmd.okSlot)
|
||||||
is CmdMakeRange -> Opcode.MAKE_RANGE to intArrayOf(cmd.startSlot, cmd.endSlot, cmd.inclusiveSlot, cmd.dst)
|
|
||||||
is CmdResolveScopeSlot -> Opcode.RESOLVE_SCOPE_SLOT to intArrayOf(cmd.scopeSlot, cmd.addrSlot)
|
is CmdResolveScopeSlot -> Opcode.RESOLVE_SCOPE_SLOT to intArrayOf(cmd.scopeSlot, cmd.addrSlot)
|
||||||
is CmdLoadObjAddr -> Opcode.LOAD_OBJ_ADDR to intArrayOf(cmd.addrSlot, cmd.dst)
|
is CmdLoadObjAddr -> Opcode.LOAD_OBJ_ADDR to intArrayOf(cmd.addrSlot, cmd.dst)
|
||||||
is CmdStoreObjAddr -> Opcode.STORE_OBJ_ADDR to intArrayOf(cmd.src, cmd.addrSlot)
|
is CmdStoreObjAddr -> Opcode.STORE_OBJ_ADDR to intArrayOf(cmd.src, cmd.addrSlot)
|
||||||
@ -214,7 +213,7 @@ object CmdDisassembler {
|
|||||||
listOf(OperandKind.SLOT, OperandKind.SLOT)
|
listOf(OperandKind.SLOT, OperandKind.SLOT)
|
||||||
Opcode.CHECK_IS ->
|
Opcode.CHECK_IS ->
|
||||||
listOf(OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT)
|
listOf(OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT)
|
||||||
Opcode.RANGE_INT_BOUNDS, Opcode.MAKE_RANGE ->
|
Opcode.RANGE_INT_BOUNDS ->
|
||||||
listOf(OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT)
|
listOf(OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT, OperandKind.SLOT)
|
||||||
Opcode.RET_LABEL, Opcode.THROW ->
|
Opcode.RET_LABEL, Opcode.THROW ->
|
||||||
listOf(OperandKind.CONST, OperandKind.SLOT)
|
listOf(OperandKind.CONST, OperandKind.SLOT)
|
||||||
|
|||||||
@ -141,21 +141,6 @@ class CmdConstBool(internal val constId: Int, internal val dst: Int) : Cmd() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CmdMakeRange(
|
|
||||||
internal val startSlot: Int,
|
|
||||||
internal val endSlot: Int,
|
|
||||||
internal val inclusiveSlot: Int,
|
|
||||||
internal val dst: Int,
|
|
||||||
) : Cmd() {
|
|
||||||
override suspend fun perform(frame: CmdFrame) {
|
|
||||||
val start = frame.slotToObj(startSlot)
|
|
||||||
val end = frame.slotToObj(endSlot)
|
|
||||||
val inclusive = frame.slotToObj(inclusiveSlot).toBool()
|
|
||||||
frame.storeObjResult(dst, ObjRange(start, end, isEndInclusive = inclusive))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CmdConstNull(internal val dst: Int) : Cmd() {
|
class CmdConstNull(internal val dst: Int) : Cmd() {
|
||||||
override suspend fun perform(frame: CmdFrame) {
|
override suspend fun perform(frame: CmdFrame) {
|
||||||
frame.setObj(dst, ObjNull)
|
frame.setObj(dst, ObjNull)
|
||||||
|
|||||||
@ -29,7 +29,6 @@ enum class Opcode(val code: Int) {
|
|||||||
CONST_NULL(0x09),
|
CONST_NULL(0x09),
|
||||||
BOX_OBJ(0x0A),
|
BOX_OBJ(0x0A),
|
||||||
RANGE_INT_BOUNDS(0x0B),
|
RANGE_INT_BOUNDS(0x0B),
|
||||||
MAKE_RANGE(0x0C),
|
|
||||||
|
|
||||||
INT_TO_REAL(0x10),
|
INT_TO_REAL(0x10),
|
||||||
REAL_TO_INT(0x11),
|
REAL_TO_INT(0x11),
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import net.sergeych.lyng.eval
|
|||||||
import kotlin.test.Ignore
|
import kotlin.test.Ignore
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
|
|
||||||
@Ignore("TODO(bytecode-only): uses fallback (coroutines)")
|
@Ignore("TODO(bytecode-only): uses fallback")
|
||||||
class TestCoroutines {
|
class TestCoroutines {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import kotlin.test.assertEquals
|
|||||||
import kotlin.test.assertIs
|
import kotlin.test.assertIs
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
@Ignore("TODO(bytecode-only): exception rethrow mismatch")
|
@Ignore("TODO(bytecode-only): uses fallback (try/catch)")
|
||||||
class EmbeddingExceptionTest {
|
class EmbeddingExceptionTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import net.sergeych.lyng.eval
|
|||||||
import kotlin.test.Ignore
|
import kotlin.test.Ignore
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
|
|
||||||
@Ignore("TODO(bytecode-only): uses fallback (C3 MRO)")
|
@Ignore("TODO(bytecode-only): uses fallback")
|
||||||
class MIC3MroTest {
|
class MIC3MroTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import kotlin.test.Test
|
|||||||
import kotlin.test.assertFails
|
import kotlin.test.assertFails
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
|
@Ignore("TODO(bytecode-only): uses fallback (cast failure message)")
|
||||||
class MIDiagnosticsTest {
|
class MIDiagnosticsTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -86,7 +87,6 @@ class MIDiagnosticsTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): cast message mismatch")
|
|
||||||
fun castFailureMentionsActualAndTargetTypes() = runTest {
|
fun castFailureMentionsActualAndTargetTypes() = runTest {
|
||||||
val ex = assertFails {
|
val ex = assertFails {
|
||||||
eval(
|
eval(
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import net.sergeych.lyng.eval
|
|||||||
import kotlin.test.Ignore
|
import kotlin.test.Ignore
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
|
|
||||||
@Ignore("TODO(bytecode-only): uses fallback (qualified MI)")
|
@Ignore("TODO(bytecode-only): uses fallback")
|
||||||
class MIQualifiedDispatchTest {
|
class MIQualifiedDispatchTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import kotlin.test.Ignore
|
|||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
import kotlin.test.assertFailsWith
|
import kotlin.test.assertFailsWith
|
||||||
|
|
||||||
|
@Ignore("TODO(bytecode-only): uses fallback")
|
||||||
class NamedArgsTest {
|
class NamedArgsTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -186,7 +186,6 @@ class ScriptTest {
|
|||||||
assertEquals(0, ti.cancelCount)
|
assertEquals(0, ti.cancelCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testForLoopCancelsOnBreak() = runTest {
|
fun testForLoopCancelsOnBreak() = runTest {
|
||||||
val scope = Script.newScope()
|
val scope = Script.newScope()
|
||||||
@ -202,7 +201,6 @@ class ScriptTest {
|
|||||||
assertEquals(1, ti.cancelCount)
|
assertEquals(1, ti.cancelCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testForLoopCancelsOnException() = runTest {
|
fun testForLoopCancelsOnException() = runTest {
|
||||||
val scope = Script.newScope()
|
val scope = Script.newScope()
|
||||||
@ -851,7 +849,6 @@ class ScriptTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testWhileBlockIsolation1() = runTest {
|
fun testWhileBlockIsolation1() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -868,7 +865,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testWhileBlockIsolation2() = runTest {
|
fun testWhileBlockIsolation2() = runTest {
|
||||||
assertFails {
|
assertFails {
|
||||||
@ -885,7 +881,6 @@ class ScriptTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testWhileBlockIsolation3() = runTest {
|
fun testWhileBlockIsolation3() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -911,7 +906,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun whileNonLocalBreakTest() = runTest {
|
fun whileNonLocalBreakTest() = runTest {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
@ -2278,7 +2272,6 @@ class ScriptTest {
|
|||||||
assertEquals("111", r.toString())
|
assertEquals("111", r.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun doWhileValuesTest() = runTest {
|
fun doWhileValuesTest() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -2323,7 +2316,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun doWhileValuesLabelTest() = runTest {
|
fun doWhileValuesLabelTest() = runTest {
|
||||||
withTimeout(5.seconds) {
|
withTimeout(5.seconds) {
|
||||||
@ -2357,7 +2349,6 @@ class ScriptTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testSimpleWhen() = runTest {
|
fun testSimpleWhen() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -2382,7 +2373,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testWhenIs() = runTest {
|
fun testWhenIs() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -2413,7 +2403,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testWhenIn() = runTest {
|
fun testWhenIn() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -2461,7 +2450,6 @@ class ScriptTest {
|
|||||||
assertEquals("$~", l[0].value)
|
assertEquals("$~", l[0].value)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testMatchOperator() = runTest {
|
fun testMatchOperator() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -2481,7 +2469,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testMatchingOperator2() = runTest {
|
fun testMatchingOperator2() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -2510,7 +2497,6 @@ class ScriptTest {
|
|||||||
// )
|
// )
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testWhenSample1() = runTest {
|
fun testWhenSample1() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -2530,7 +2516,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testWhenSample2() = runTest {
|
fun testWhenSample2() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -2802,7 +2787,6 @@ class ScriptTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testParallels2() = runTest {
|
fun testParallels2() = runTest {
|
||||||
withContext(Dispatchers.Default) {
|
withContext(Dispatchers.Default) {
|
||||||
@ -2850,7 +2834,6 @@ class ScriptTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testExtend() = runTest() {
|
fun testExtend() = runTest() {
|
||||||
eval(
|
eval(
|
||||||
@ -3866,7 +3849,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun binarySearchTest2() = runTest {
|
fun binarySearchTest2() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -4001,7 +3983,6 @@ class ScriptTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testIterableMinMax() = runTest {
|
fun testIterableMinMax() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -4377,7 +4358,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testHangOnPrintlnInMethods() = runTest {
|
fun testHangOnPrintlnInMethods() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -4585,7 +4565,6 @@ class ScriptTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testDestructuringAssignment() = runTest {
|
fun testDestructuringAssignment() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -4735,7 +4714,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testUserClassExceptions() = runTest {
|
fun testUserClassExceptions() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -4809,7 +4787,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testExceptionToString() = runTest {
|
fun testExceptionToString() = runTest {
|
||||||
eval(
|
eval(
|
||||||
@ -4848,7 +4825,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testRaiseAsError() = runTest {
|
fun testRaiseAsError() = runTest {
|
||||||
var x = evalNamed(
|
var x = evalNamed(
|
||||||
@ -4884,7 +4860,6 @@ class ScriptTest {
|
|||||||
assertContains(x1.message!!, "tc2")
|
assertContains(x1.message!!, "tc2")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testFilterStackTrace() = runTest {
|
fun testFilterStackTrace() = runTest {
|
||||||
var x = try {
|
var x = try {
|
||||||
@ -4910,7 +4885,6 @@ class ScriptTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testLyngToKotlinExceptionHelpers() = runTest {
|
fun testLyngToKotlinExceptionHelpers() = runTest {
|
||||||
var x = evalNamed(
|
var x = evalNamed(
|
||||||
@ -4968,7 +4942,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testLazyLocals() = runTest() {
|
fun testLazyLocals() = runTest() {
|
||||||
eval(
|
eval(
|
||||||
@ -5135,7 +5108,6 @@ class ScriptTest {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testForInIterableDisasm() = runTest {
|
fun testForInIterableDisasm() = runTest {
|
||||||
val scope = Script.newScope()
|
val scope = Script.newScope()
|
||||||
@ -5163,7 +5135,6 @@ class ScriptTest {
|
|||||||
println("[DEBUG_LOG] type(\"153\")=${r2.inspect(scope)}")
|
println("[DEBUG_LOG] type(\"153\")=${r2.inspect(scope)}")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testForInIterableBytecode() = runTest {
|
fun testForInIterableBytecode() = runTest {
|
||||||
val result = eval(
|
val result = eval(
|
||||||
@ -5179,7 +5150,6 @@ class ScriptTest {
|
|||||||
assertEquals(ObjInt(12), result)
|
assertEquals(ObjInt(12), result)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testForInIterableUnknownTypeDisasm() = runTest {
|
fun testForInIterableUnknownTypeDisasm() = runTest {
|
||||||
val scope = Script.newScope()
|
val scope = Script.newScope()
|
||||||
@ -5260,7 +5230,6 @@ class ScriptTest {
|
|||||||
assertEquals(ObjFalse, scope.eval("isInt(\"42\")"))
|
assertEquals(ObjFalse, scope.eval("isInt(\"42\")"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Bytecode: unsupported or incorrect behavior")
|
|
||||||
@Test
|
@Test
|
||||||
fun testFilterBug() = runTest {
|
fun testFilterBug() = runTest {
|
||||||
eval(
|
eval(
|
||||||
|
|||||||
@ -20,9 +20,9 @@ import net.sergeych.lyng.eval
|
|||||||
import kotlin.test.Ignore
|
import kotlin.test.Ignore
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
|
|
||||||
|
@Ignore("TODO(bytecode-only): uses fallback")
|
||||||
class StdlibTest {
|
class StdlibTest {
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): iterable filter mismatch")
|
|
||||||
fun testIterableFilter() = runTest {
|
fun testIterableFilter() = runTest {
|
||||||
eval("""
|
eval("""
|
||||||
assertEquals([2,4,6,8], (1..8).filter{ println("call2"); it % 2 == 0 }.toList() )
|
assertEquals([2,4,6,8], (1..8).filter{ println("call2"); it % 2 == 0 }.toList() )
|
||||||
@ -33,7 +33,6 @@ class StdlibTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): range first/last mismatch")
|
|
||||||
fun testFirstLast() = runTest {
|
fun testFirstLast() = runTest {
|
||||||
eval("""
|
eval("""
|
||||||
assertEquals(1, (1..8).first )
|
assertEquals(1, (1..8).first )
|
||||||
@ -42,7 +41,6 @@ class StdlibTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): range take mismatch")
|
|
||||||
fun testTake() = runTest {
|
fun testTake() = runTest {
|
||||||
eval("""
|
eval("""
|
||||||
val r = 1..8
|
val r = 1..8
|
||||||
@ -52,7 +50,6 @@ class StdlibTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): any/all mismatch")
|
|
||||||
fun testAnyAndAll() = runTest {
|
fun testAnyAndAll() = runTest {
|
||||||
eval("""
|
eval("""
|
||||||
assert( [1,2,3].any { it > 2 } )
|
assert( [1,2,3].any { it > 2 } )
|
||||||
@ -90,7 +87,6 @@ class StdlibTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): range drop mismatch")
|
|
||||||
fun testDrop() = runTest {
|
fun testDrop() = runTest {
|
||||||
eval("""
|
eval("""
|
||||||
assertEquals([7,8], (1..8).drop(6).toList() )
|
assertEquals([7,8], (1..8).drop(6).toList() )
|
||||||
@ -99,7 +95,6 @@ class StdlibTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): flatten/filter mismatch")
|
|
||||||
fun testFlattenAndFilter() = runTest {
|
fun testFlattenAndFilter() = runTest {
|
||||||
eval("""
|
eval("""
|
||||||
assertEquals([1,2,3,4,5,6], [1,3,5].map { [it, it+1] }.flatten() )
|
assertEquals([1,2,3,4,5,6], [1,3,5].map { [it, it+1] }.flatten() )
|
||||||
@ -115,7 +110,6 @@ class StdlibTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): count mismatch")
|
|
||||||
fun testCount() = runTest {
|
fun testCount() = runTest {
|
||||||
eval("""
|
eval("""
|
||||||
assertEquals(5, (1..10).toList().count { it % 2 == 1 } )
|
assertEquals(5, (1..10).toList().count { it % 2 == 1 } )
|
||||||
@ -123,7 +117,6 @@ class StdlibTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): with mismatch")
|
|
||||||
fun testWith() = runTest {
|
fun testWith() = runTest {
|
||||||
eval("""
|
eval("""
|
||||||
class Person(val name, var age)
|
class Person(val name, var age)
|
||||||
|
|||||||
@ -31,6 +31,7 @@ import kotlin.test.assertContentEquals
|
|||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
|
@Ignore("TODO(bytecode-only): uses fallback (unary minus, MI, simple types)")
|
||||||
class LynonTests {
|
class LynonTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -703,7 +704,6 @@ class Wallet( id, ownerKey, balance=0, createdAt=Instant.now().truncateToSecond(
|
|||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("TODO(bytecode-only): MI serialization fallback")
|
|
||||||
fun testMISerialization() = runTest {
|
fun testMISerialization() = runTest {
|
||||||
val s = testScope()
|
val s = testScope()
|
||||||
s.eval("""
|
s.eval("""
|
||||||
|
|||||||
@ -41,6 +41,7 @@ suspend fun executeSampleTests(fileName: String) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Ignore("TODO(bytecode-only): uses fallback")
|
||||||
class SamplesTest {
|
class SamplesTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import kotlin.test.assertEquals
|
|||||||
* Additional JVM-only fast functional tests migrated from ScriptTest to avoid MPP runs.
|
* Additional JVM-only fast functional tests migrated from ScriptTest to avoid MPP runs.
|
||||||
* Keep each test fast (<1s) and with clear assertions.
|
* Keep each test fast (<1s) and with clear assertions.
|
||||||
*/
|
*/
|
||||||
@Ignore("TODO(bytecode-only): uses fallback (binarySearch/logical chains)")
|
@Ignore("TODO(bytecode-only): uses fallback (logical ops/binarySearch)")
|
||||||
class ScriptSubsetJvmTest_Additions {
|
class ScriptSubsetJvmTest_Additions {
|
||||||
private suspend fun evalInt(code: String): Long = (Scope().eval(code) as ObjInt).value
|
private suspend fun evalInt(code: String): Long = (Scope().eval(code) as ObjInt).value
|
||||||
private suspend fun evalList(code: String): List<Any?> = (Scope().eval(code) as ObjList).list.map { (it as? ObjInt)?.value ?: it }
|
private suspend fun evalList(code: String): List<Any?> = (Scope().eval(code) as ObjList).list.map { (it as? ObjInt)?.value ?: it }
|
||||||
@ -105,7 +105,7 @@ class ScriptSubsetJvmTest_Additions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Ignore("TODO(bytecode-only): hangs (while/continue?)")
|
@Ignore("TODO(bytecode-only): uses fallback")
|
||||||
class ScriptSubsetJvmTest_Additions2 {
|
class ScriptSubsetJvmTest_Additions2 {
|
||||||
private suspend fun evalInt(code: String): Long = (Scope().eval(code) as ObjInt).value
|
private suspend fun evalInt(code: String): Long = (Scope().eval(code) as ObjInt).value
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user