Feat: script execution performance optimization

This commit is contained in:
2026-02-22 14:16:38 +01:00
parent 3d552ec072
commit 81f475a75b
20 changed files with 377 additions and 134 deletions

View File

@@ -137,7 +137,7 @@ fn over2_underflow() {
#[test]
fn stack_persists() {
let f = forth();
let mut f = forth();
let ctx = default_ctx();
f.evaluate("1 2 3", &ctx).unwrap();
assert_eq!(f.stack(), vec![int(1), int(2), int(3)]);
@@ -147,7 +147,7 @@ fn stack_persists() {
#[test]
fn clear_stack() {
let f = forth();
let mut f = forth();
f.evaluate("1 2 3", &default_ctx()).unwrap();
f.clear_stack();
assert!(f.stack().is_empty());
@@ -180,7 +180,7 @@ fn rev_underflow() {
#[test]
fn shuffle_preserves_elements() {
let f = forth();
let mut f = forth();
f.evaluate("1 2 3 4 4 shuffle", &default_ctx()).unwrap();
let mut stack: Vec<i64> = f
.stack()