From ee78cb6f7f8243217098bd420ea1482d5db254f2 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Mon, 25 Aug 2025 08:25:29 -0400 Subject: use ‘DataStackType’ instead of hard-coding i32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i want to try isize --- src/forth/vm.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/forth/vm.rs') diff --git a/src/forth/vm.rs b/src/forth/vm.rs index fe034a6..8cec0d2 100644 --- a/src/forth/vm.rs +++ b/src/forth/vm.rs @@ -2,9 +2,11 @@ use log::debug; use std::ops::Index; +pub type DataStackType = i32; + #[derive(Clone, Debug, Eq, PartialEq)] pub enum OpCode { - Num(i32), + Num(DataStackType), Str(usize, usize), Call(usize), TCall(usize), // tail call, really just ‘jmp’, but named to indicate desired usage. @@ -85,7 +87,7 @@ impl Default for InstructionPointer { } #[derive(Debug)] -pub struct DataStack(pub Vec); +pub struct DataStack(pub Vec); #[derive(Debug)] pub struct CallStack(pub Vec); -- cgit v1.3