summaryrefslogtreecommitdiffstats
path: root/src/forth/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/forth/parser.rs')
-rw-r--r--src/forth/parser.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/forth/parser.rs b/src/forth/parser.rs
index 55ad64b..ac6715d 100644
--- a/src/forth/parser.rs
+++ b/src/forth/parser.rs
@@ -1,5 +1,7 @@
use super::interp::{ByteCode, OpCode, WordList};
+use log::debug;
+
use std::collections::HashMap;
use std::iter::{Enumerate, Iterator};
use std::str::Chars;
@@ -45,7 +47,7 @@ pub struct Parser<'a> {
// todo: don't be pub, have a method to extract a wordlist
pub wordlist: WordList,
// catalog of word to word index in `wordlist`
- wordalog: WordCatalog<'a>,
+ pub wordalog: WordCatalog<'a>,
// holds a stack of indices into `wordlist` that are currently
// being defined, with the top of stack being the most recent
// definition.
@@ -79,6 +81,7 @@ impl<'a> Parser<'a> {
self.enumerator.by_ref()
.find(|(_i, c)| c.is_whitespace())?;
let word = &self.text[start..end];
+ debug!("Parser::next_word → ‘{}’ ({} → {})", word, start, end);
Some((word, start, end))
}