Making [IF] [THEN] work at console, bumping version.
This commit is contained in:
@ -15,9 +15,12 @@
|
||||
( Interpret time conditionals )
|
||||
|
||||
: DEFINED? ( "name" -- xt|0 )
|
||||
bl parse find state @ if aliteral then ; immediate
|
||||
begin bl parse dup 0= while 2drop refill 0= throw repeat
|
||||
find state @ if aliteral then ; immediate
|
||||
defer [SKIP]
|
||||
: [THEN] ; : [ELSE] [SKIP] ; : [IF] 0= if [SKIP] then ;
|
||||
: [THEN] ; immediate
|
||||
: [ELSE] [SKIP] ; immediate
|
||||
: [IF] 0= if [SKIP] then ; immediate
|
||||
: [SKIP]' 0 begin postpone defined? dup if
|
||||
dup ['] [IF] = if swap 1+ swap then
|
||||
dup ['] [ELSE] = if swap dup 0 <= if 2drop exit then swap then
|
||||
|
||||
@ -109,6 +109,9 @@ static cell_t same(const char *a, const char *b, cell_t len) {
|
||||
}
|
||||
|
||||
static cell_t find(const char *name, cell_t len) {
|
||||
if (len == 0) {
|
||||
return 0;
|
||||
}
|
||||
for (cell_t ***voc = g_sys->context; *voc; ++voc) {
|
||||
cell_t xt = (cell_t) **voc;
|
||||
while (xt) {
|
||||
|
||||
Reference in New Issue
Block a user