From ca8ced9494f567e2463cda0d4fdcd4fd9ea8bd8b Mon Sep 17 00:00:00 2001 From: psf Date: Tue, 17 May 2022 22:43:39 -0700 Subject: [PATCH] WORD no longer leaves delimiter on stack --- frustration2.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frustration2.rs b/frustration2.rs index 368bfae..7bbbf01 100644 --- a/frustration2.rs +++ b/frustration2.rs @@ -310,12 +310,12 @@ fn build_dictionary(c: &mut Core) { d.entry(); d.name(5, *b"get"); let getcs = d.here; forth!(getcs_helper, RET); - // word ( -- c ) + // word ( -- ) // Not quite standard. d.entry(); d.name(4, *b"wor"); let word = d.here; forth!(Literal(word_buf), DUP, Literal(2), ADD, Literal(0x2020), SWP, ST, Literal(0x2000), SWP, ST, - skipws, getcs, RET); + skipws, getcs, DRP, RET); // latest ( -- a ) // Address of "latest" variable. This variable stores the address of @@ -346,7 +346,7 @@ fn build_dictionary(c: &mut Core) { // ' ( -- xt|0 ) d.entry(); d.name(1, *b"' "); - forth!(word, DRP, find, RET); + forth!(word, find, RET); /* --- The outer interpreter --- */ @@ -441,11 +441,11 @@ fn build_dictionary(c: &mut Core) { // quit ( -- ) d.entry(); d.name(4, *b"qui"); let quit = d.here; - forth!(word, DRP, find, dispatch, quit); + forth!(word, find, dispatch, quit); // create ( -- ) d.entry(); d.name(6, *b"cre"); let create = d.here; - forth!(word, DRP, + forth!(word, here, LD, latest, LD, comma, latest, ST, Literal(word_buf), DUP, LD, comma, Literal(2), ADD, LD, comma, RET);