summaryrefslogtreecommitdiffstats
path: root/src/forth
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-08-23 08:51:24 -0400
committerBrian Cully <bjc@spork.org>2025-08-23 08:51:24 -0400
commit12c06171b3f94696e852c3910c116f56cbfc5b64 (patch)
tree2a595842ae68c23150db63ef87bc01a1e9bfde8e /src/forth
parent79441128958669b16ce8dfe39a3684069921f604 (diff)
downloadautomathon-12c06171b3f94696e852c3910c116f56cbfc5b64.tar.gz
automathon-12c06171b3f94696e852c3910c116f56cbfc5b64.zip
wip: pass interp between js and rust
Diffstat (limited to 'src/forth')
-rw-r--r--src/forth/interp.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/forth/interp.rs b/src/forth/interp.rs
index b34ed31..cacc5e3 100644
--- a/src/forth/interp.rs
+++ b/src/forth/interp.rs
@@ -28,7 +28,7 @@ pub enum OpCode {
}
#[derive(Clone, Debug)]
-pub(super) struct ByteCode(pub(super) Vec<OpCode>);
+pub struct ByteCode(pub Vec<OpCode>);
impl ByteCode {
pub fn len(&self) -> usize {
@@ -45,9 +45,9 @@ impl Index<usize> for ByteCode {
}
#[derive(Debug, Copy, Clone, PartialEq)]
-pub(super) struct InstructionPointer {
- pub(super) word: usize,
- pub(super) offset: usize,
+pub struct InstructionPointer {
+ pub word: usize,
+ pub offset: usize,
}
impl InstructionPointer {
@@ -60,21 +60,21 @@ impl InstructionPointer {
}
#[derive(Debug)]
-pub(super) struct DataStack(pub(super) Vec<i32>);
+pub struct DataStack(pub Vec<i32>);
#[derive(Debug)]
-pub(super) struct CallStack(pub(super) Vec<InstructionPointer>);
+pub struct CallStack(pub Vec<InstructionPointer>);
#[derive(Clone, Debug)]
-pub struct WordList(pub(super) Vec<ByteCode>);
+pub struct WordList(pub Vec<ByteCode>);
#[derive(Debug)]
pub struct Interp {
// todo: don't be pub, probably
- pub(super) stack: DataStack,
+ pub stack: DataStack,
callstack: CallStack,
// todo: don't be pub
- pub(super) wordlist: WordList,
+ pub wordlist: WordList,
ip: InstructionPointer,
}