fix NONAME recurse

master
Ondřej Hruška 3 years ago
parent e7d0053915
commit 3c90303589
  1. 11
      src/fh_builtins_meta.c

@ -82,14 +82,17 @@ static enum fh_error w_colon_noname(struct fh_thread_s *fh, const struct fh_word
struct fh_word_s *new_word = fh_word_at(fh, ptr);
if (!new_word) return FH_ERR_INTERNAL;
new_word->previous = MAGICADDR_DICTFIRST;
//new_word->previous = MAGICADDR_DICTFIRST;
new_word->previous = fh->dict_last;
new_word->param = fh->here;
new_word->handler = w_user_word;
new_word->name[0] = 0;
new_word->flags = WORDFLAG_WORD; // noname word exists outside the dict, so HIDDEN is not needed
new_word->name[0] = 0; // no name, really
new_word->flags = WORDFLAG_WORD | WORDFLAG_HIDDEN;
TRY(ds_push(fh, ptr)); // TODO maybe should do this at semicolon?
fh->dict_last = ptr;
return FH_OK;
}
@ -328,7 +331,7 @@ static enum fh_error w_semicolon(struct fh_thread_s *fh, const struct fh_word_s
// unhide the entry, if hidden (colon does this to make the word unresolvable before it's finished)
struct fh_word_s *ww = fh_word_at(fh, fh->dict_last);
if (ww && (ww->flags & WORDFLAG_WORD)) {
if (ww && (ww->flags & WORDFLAG_WORD) && ww->name[0] != 0) {
ww->flags &= ~WORDFLAG_HIDDEN;
}

Loading…
Cancel
Save