Add -- support to locals.

This commit is contained in:
Brad Nelson
2021-07-10 13:00:19 -07:00
parent 2ac24fff0f
commit 9ca16d123d
3 changed files with 13 additions and 3 deletions

View File

@ -150,9 +150,9 @@ $(GEN):
POSIX_BOOT = common/boot.fs common/conditionals.fs common/vocabulary.fs \
common/hide_calls.fs common/ansi.fs \
posix/posix.fs posix/posix_highlevel.fs posix/termios.fs common/locals.fs \
posix/posix.fs posix/posix_highlevel.fs posix/termios.fs \
common/tasks.fs common/utils.fs common/highlevel.fs common/filetools.fs \
posix/posix_desktop.fs \
common/locals.fs posix/posix_desktop.fs \
common/streams.fs common/blocks.fs \
posix/sockets.fs posix/telnetd.fs posix/httpd.fs posix/web_interface.fs \
posix/autoboot.fs \

View File

@ -34,10 +34,15 @@ scope-doer scope-template
: (local) ( a n -- )
>r >r postpone >r postpone ahead r> r> scope-create postpone then ;
: }? ( a n -- ) 1 <> if drop 0 exit then c@ [char] } = ;
: --? ( a n -- ) s" --" str= ;
: eat} begin bl parse }? until ;
also forth definitions
: { begin bl parse 2dup }? if 2drop exit then (local) again ; immediate
: { begin bl parse
2dup --? if 2drop eat} exit then
2dup }? if 2drop exit then
(local) again ; immediate
: ; scope-clear postpone ; ; immediate
only forth definitions

View File

@ -36,3 +36,8 @@ e: test-longname
: setPixelColor { pixelNum } pixelNum ;
1 setPixelColor 1 = assert
;e
e: test-dash
: test { a b c -- a a b b c c } a a b b c c ;
1 2 3 test * + * + * 23 = assert
;e