Achieve 100% Core Extensions compliance, 261 tests

Implement 25+ Core Extension words:
- VALUE/TO, DEFER/IS/ACTION-OF, :NONAME
- CASE/OF/ENDOF/ENDCASE, ?DO, AGAIN
- PARSE, PARSE-NAME, S\", C", HOLDS, BUFFER:
- 2>R, 2R>, 2R@, U>, .R, U.R, PAD, ERASE, UNUSED
- REFILL, SOURCE-ID, MARKER (stub)

Fix panic on invalid memory access (bounds check in FIND).
Rewrite FIND/WORD host functions for inline operation.
Add BeginAgain IR variant and codegen.

Three word sets at 100%: Core, Core Extensions, Exception.
This commit is contained in:
2026-03-30 22:19:49 +02:00
parent 2c74222193
commit f99f9d5290
6 changed files with 2014 additions and 12 deletions
+8
View File
@@ -436,6 +436,13 @@ fn emit_op(f: &mut Function, op: &IrOp) {
.instruction(&Instruction::End);
}
IrOp::BeginAgain { body } => {
f.instruction(&Instruction::Loop(BlockType::Empty));
emit_body(f, body);
f.instruction(&Instruction::Br(0))
.instruction(&Instruction::End);
}
IrOp::BeginWhileRepeat { test, body } => {
f.instruction(&Instruction::Block(BlockType::Empty));
f.instruction(&Instruction::Loop(BlockType::Empty));
@@ -702,6 +709,7 @@ fn count_needed_locals(ops: &[IrOp]) -> u32 {
IrOp::Rot | IrOp::Tuck => max = max.max(4),
IrOp::DoLoop { body, .. } => max = max.max(count_needed_locals(body)),
IrOp::BeginUntil { body } => max = max.max(count_needed_locals(body)),
IrOp::BeginAgain { body } => max = max.max(count_needed_locals(body)),
IrOp::BeginWhileRepeat { test, body } => {
max = max
.max(count_needed_locals(test))