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/compiler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/forth/compiler.rs') diff --git a/src/forth/compiler.rs b/src/forth/compiler.rs index 17f0113..97e94a9 100644 --- a/src/forth/compiler.rs +++ b/src/forth/compiler.rs @@ -1,4 +1,4 @@ -use super::vm::{ByteCode, OpCode, WordList}; +use super::vm::{ByteCode, DataStackType, OpCode, WordList}; use std::collections::HashMap; use std::iter::{Enumerate, Iterator}; @@ -116,7 +116,7 @@ impl<'a> Compiler<'a> { pub fn compile(&mut self) -> CompileResult<()> { while let Some((word, start, end)) = self.next_word() { let anno = Annotation { loc: (start, end) }; - if let Ok(i) = word.parse::() { + if let Ok(i) = word.parse::() { self.bc_push(OpCode::Num(i), anno); } else if let Some(i) = self.wordalog.0.get(word) { self.bc_push(OpCode::Call(*i), anno); -- cgit v1.3