Step 16: remove ToBoolStatement
This commit is contained in:
parent
565dbf98ed
commit
ae88898f58
@ -53,9 +53,9 @@ Goal: migrate the compiler so all values live in frames/bytecode, keeping JVM te
|
|||||||
- [x] Step 15: Class-scope `?=` in bytecode.
|
- [x] Step 15: Class-scope `?=` in bytecode.
|
||||||
- [x] Handle `C.x ?= v` and `C?.x ?= v` for class-scope members without falling back.
|
- [x] Handle `C.x ?= v` and `C?.x ?= v` for class-scope members without falling back.
|
||||||
- [x] Add a JVM test for class-scope `?=` on static vars.
|
- [x] Add a JVM test for class-scope `?=` on static vars.
|
||||||
- [ ] Step 16: Remove dead `ToBoolStatement`.
|
- [x] Step 16: Remove dead `ToBoolStatement`.
|
||||||
- [ ] Confirm no parser/compiler paths construct `ToBoolStatement` and delete it plus interpreter hooks.
|
- [x] Confirm no parser/compiler paths construct `ToBoolStatement` and delete it plus interpreter hooks.
|
||||||
- [ ] Keep JVM tests green after removal.
|
- [x] Keep JVM tests green after removal.
|
||||||
- [x] Step 17: Callable property calls in bytecode.
|
- [x] Step 17: Callable property calls in bytecode.
|
||||||
- [x] Support `CallRef` where the target is a `FieldRef` (e.g., `(obj.fn)()`), keeping compile-time resolution.
|
- [x] Support `CallRef` where the target is a `FieldRef` (e.g., `(obj.fn)()`), keeping compile-time resolution.
|
||||||
- [x] Add a JVM test for a callable property call compiled to bytecode.
|
- [x] Add a JVM test for a callable property call compiled to bytecode.
|
||||||
|
|||||||
@ -439,15 +439,6 @@ class ThrowStatement(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ToBoolStatement(
|
|
||||||
val expr: Statement,
|
|
||||||
override val pos: Pos,
|
|
||||||
) : Statement() {
|
|
||||||
override suspend fun execute(scope: Scope): Obj {
|
|
||||||
return if (expr.execute(scope).toBool()) net.sergeych.lyng.obj.ObjTrue else net.sergeych.lyng.obj.ObjFalse
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ExpressionStatement(
|
class ExpressionStatement(
|
||||||
val ref: net.sergeych.lyng.obj.ObjRef,
|
val ref: net.sergeych.lyng.obj.ObjRef,
|
||||||
override val pos: Pos
|
override val pos: Pos
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user