Skip to content

Commit 28ddf72

Browse files
committed
Checks for +TO and ADDR
1 parent 924941b commit 28ddf72

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/gforth.fs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,29 @@ t{ action-of cod2 -> ' true }t
199199
t{ synonym source2 source -> }t
200200
t{ ' source2 -> ' source }t
201201
t{ action-of source2 -> action-of source }t
202+
203+
\ +to and addr
204+
205+
1 value foo#
206+
2. 2value foo##
207+
3e fvalue foo%
208+
: +foo# +to foo# ;
209+
: &foo# addr foo# ;
210+
: +foo## +to foo## ;
211+
: &foo## addr foo## ;
212+
: +foo% +to foo% ;
213+
: &foo% addr foo% ;
214+
215+
t{ 2 +to foo# foo# -> 3 }t
216+
t{ addr foo# @ -> 3 }t
217+
t{ 5. +to foo## foo## -> 7. }t
218+
t{ addr foo## 2@ -> 7. }t
219+
t{ 7e +to foo% foo% -> 10e }t
220+
t{ addr foo% f@ -> 10e }t
221+
222+
t{ 2 +foo# foo# -> 5 }t
223+
t{ &foo# @ -> 5 }t
224+
t{ 5. +foo## foo## -> 12. }t
225+
t{ &foo## 2@ -> 12. }t
226+
t{ 7e +foo% foo% -> 17e }t
227+
t{ &foo% f@ -> 17e }t

0 commit comments

Comments
 (0)