diff options
| author | Brian Cully <bjc@spork.org> | 2025-08-25 08:25:29 -0400 |
|---|---|---|
| committer | Brian Cully <bjc@spork.org> | 2025-08-25 08:25:29 -0400 |
| commit | ee78cb6f7f8243217098bd420ea1482d5db254f2 (patch) | |
| tree | 2575519e7545075b4c71531676151e5c6c93e964 /src/forth/compiler.rs | |
| parent | 8879df0983737b42eee1df26004b861599dd88d6 (diff) | |
| download | automathon-ee78cb6f7f8243217098bd420ea1482d5db254f2.tar.gz automathon-ee78cb6f7f8243217098bd420ea1482d5db254f2.zip | |
use ‘DataStackType’ instead of hard-coding i32
i want to try isize
Diffstat (limited to 'src/forth/compiler.rs')
| -rw-r--r-- | src/forth/compiler.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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::<i32>() { + if let Ok(i) = word.parse::<DataStackType>() { self.bc_push(OpCode::Num(i), anno); } else if let Some(i) = self.wordalog.0.get(word) { self.bc_push(OpCode::Call(*i), anno); |
